Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_buttons/space_buttons.c
| Show First 20 Lines • Show All 508 Lines • ▼ Show 20 Lines | static void buttons_main_region_layout(const bContext *C, ARegion *region) | ||||
| if (region->flag & RGN_FLAG_SEARCH_FILTER_ACTIVE) { | if (region->flag & RGN_FLAG_SEARCH_FILTER_ACTIVE) { | ||||
| buttons_main_region_property_search(C, sbuts, region); | buttons_main_region_property_search(C, sbuts, region); | ||||
| } | } | ||||
| sbuts->mainbo = sbuts->mainb; | sbuts->mainbo = sbuts->mainb; | ||||
| } | } | ||||
| static void buttons_main_region_listener(wmWindow *UNUSED(win), | static void buttons_main_region_listener(const wmRegionListenerParams *params) | ||||
| ScrArea *UNUSED(area), | |||||
| ARegion *region, | |||||
| wmNotifier *wmn, | |||||
| const Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ARegion *region = params->region; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_SCREEN: | case NC_SCREEN: | ||||
| if (ELEM(wmn->data, ND_LAYER)) { | if (ELEM(wmn->data, ND_LAYER)) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| } | } | ||||
| Show All 31 Lines | static void buttons_header_region_draw(const bContext *C, ARegion *region) | ||||
| SpaceProperties *sbuts = CTX_wm_space_properties(C); | SpaceProperties *sbuts = CTX_wm_space_properties(C); | ||||
| /* Needed for RNA to get the good values! */ | /* Needed for RNA to get the good values! */ | ||||
| buttons_context_compute(C, sbuts); | buttons_context_compute(C, sbuts); | ||||
| ED_region_header(C, region); | ED_region_header(C, region); | ||||
| } | } | ||||
| static void buttons_header_region_message_subscribe(const bContext *UNUSED(C), | static void buttons_header_region_message_subscribe(const wmRegionMessageSubscribeParams *params) | ||||
| WorkSpace *UNUSED(workspace), | |||||
| Scene *UNUSED(scene), | |||||
| bScreen *UNUSED(screen), | |||||
| ScrArea *area, | |||||
| ARegion *region, | |||||
| struct wmMsgBus *mbus) | |||||
| { | { | ||||
| struct wmMsgBus *mbus = params->message_bus; | |||||
| ScrArea *area = params->area; | |||||
| ARegion *region = params->region; | |||||
| SpaceProperties *sbuts = area->spacedata.first; | SpaceProperties *sbuts = area->spacedata.first; | ||||
| wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { | wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { | ||||
| .owner = region, | .owner = region, | ||||
| .user_data = region, | .user_data = region, | ||||
| .notify = ED_region_do_msg_notify_tag_redraw, | .notify = ED_region_do_msg_notify_tag_redraw, | ||||
| }; | }; | ||||
| /* Don't check for SpaceProperties.mainb here, we may toggle between view-layers | /* Don't check for SpaceProperties.mainb here, we may toggle between view-layers | ||||
| * where one has no active object, so that available contexts changes. */ | * where one has no active object, so that available contexts changes. */ | ||||
| Show All 29 Lines | static void buttons_navigation_bar_region_draw(const bContext *C, ARegion *region) | ||||
| } | } | ||||
| ED_region_panels_layout(C, region); | ED_region_panels_layout(C, region); | ||||
| /* ED_region_panels_layout adds vertical scrollbars, we don't want them. */ | /* ED_region_panels_layout adds vertical scrollbars, we don't want them. */ | ||||
| region->v2d.scroll &= ~V2D_SCROLL_VERTICAL; | region->v2d.scroll &= ~V2D_SCROLL_VERTICAL; | ||||
| ED_region_panels_draw(C, region); | ED_region_panels_draw(C, region); | ||||
| } | } | ||||
| static void buttons_navigation_bar_region_message_subscribe(const bContext *UNUSED(C), | static void buttons_navigation_bar_region_message_subscribe( | ||||
| WorkSpace *UNUSED(workspace), | const wmRegionMessageSubscribeParams *params) | ||||
| Scene *UNUSED(scene), | |||||
| bScreen *UNUSED(screen), | |||||
| ScrArea *UNUSED(area), | |||||
| ARegion *region, | |||||
| struct wmMsgBus *mbus) | |||||
| { | { | ||||
| struct wmMsgBus *mbus = params->message_bus; | |||||
| ARegion *region = params->region; | |||||
| wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { | wmMsgSubscribeValue msg_sub_value_region_tag_redraw = { | ||||
| .owner = region, | .owner = region, | ||||
| .user_data = region, | .user_data = region, | ||||
| .notify = ED_region_do_msg_notify_tag_redraw, | .notify = ED_region_do_msg_notify_tag_redraw, | ||||
| }; | }; | ||||
| WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw); | WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw); | ||||
| } | } | ||||
| Show All 12 Lines | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name Area-Level Code | /** \name Area-Level Code | ||||
| * \{ */ | * \{ */ | ||||
| /* reused! */ | /* reused! */ | ||||
| static void buttons_area_listener(wmWindow *UNUSED(win), | static void buttons_area_listener(const wmSpaceTypeListenerParams *params) | ||||
| ScrArea *area, | |||||
| wmNotifier *wmn, | |||||
| Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ScrArea *area = params->area; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| SpaceProperties *sbuts = area->spacedata.first; | SpaceProperties *sbuts = area->spacedata.first; | ||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_SCENE: | case NC_SCENE: | ||||
| switch (wmn->data) { | switch (wmn->data) { | ||||
| case ND_RENDER_OPTIONS: | case ND_RENDER_OPTIONS: | ||||
| buttons_area_redraw(area, BCONTEXT_RENDER); | buttons_area_redraw(area, BCONTEXT_RENDER); | ||||
| ▲ Show 20 Lines • Show All 327 Lines • Show Last 20 Lines | |||||