Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/space_image.c
| Show First 20 Lines • Show All 314 Lines • ▼ Show 20 Lines | if (scene->nodetree) { | ||||
| Mask *mask = ED_space_image_get_mask(sima); | Mask *mask = ED_space_image_get_mask(sima); | ||||
| if (mask) { | if (mask) { | ||||
| ED_node_composite_job(C, scene->nodetree, scene); | ED_node_composite_job(C, scene->nodetree, scene); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void image_listener(wmWindow *win, ScrArea *area, wmNotifier *wmn, Scene *UNUSED(scene)) | static void image_listener(const wmSpaceTypeListenerParams *params) | ||||
| { | { | ||||
| wmWindow *win = params->window; | |||||
| ScrArea *area = params->area; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| SpaceImage *sima = (SpaceImage *)area->spacedata.first; | SpaceImage *sima = (SpaceImage *)area->spacedata.first; | ||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_WINDOW: | case NC_WINDOW: | ||||
| /* notifier comes from editing color space */ | /* notifier comes from editing color space */ | ||||
| image_scopes_tag_refresh(area); | image_scopes_tag_refresh(area); | ||||
| ED_area_tag_redraw(area); | ED_area_tag_redraw(area); | ||||
| ▲ Show 20 Lines • Show All 390 Lines • ▼ Show 20 Lines | ED_mask_draw_region(depsgraph, | ||||
| NULL, | NULL, | ||||
| C); | C); | ||||
| } | } | ||||
| WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D); | WM_gizmomap_draw(region->gizmo_map, C, WM_GIZMOMAP_DRAWSTEP_2D); | ||||
| draw_image_cache(C, region); | draw_image_cache(C, region); | ||||
| } | } | ||||
| static void image_main_region_listener(wmWindow *UNUSED(win), | static void image_main_region_listener(const wmRegionListenerParams *params) | ||||
| ScrArea *area, | |||||
| ARegion *region, | |||||
| wmNotifier *wmn, | |||||
| const Scene *UNUSED(scene)) | |||||
| { | { | ||||
| ScrArea *area = params->area; | |||||
| ARegion *region = params->region; | |||||
| wmNotifier *wmn = params->notifier; | |||||
| /* context changes */ | /* context changes */ | ||||
| switch (wmn->category) { | switch (wmn->category) { | ||||
| case NC_GEOM: | case NC_GEOM: | ||||
| if (ELEM(wmn->data, ND_DATA, ND_SELECT)) { | if (ELEM(wmn->data, ND_DATA, ND_SELECT)) { | ||||
| WM_gizmomap_tag_refresh(region->gizmo_map); | WM_gizmomap_tag_refresh(region->gizmo_map); | ||||
| } | } | ||||
| break; | break; | ||||
| case NC_GPENCIL: | case NC_GPENCIL: | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | if (category) { | ||||
| } | } | ||||
| } | } | ||||
| ED_space_image_release_buffer(sima, ibuf, lock); | ED_space_image_release_buffer(sima, ibuf, lock); | ||||
| /* Layout handles details. */ | /* Layout handles details. */ | ||||
| ED_region_panels_draw(C, region); | ED_region_panels_draw(C, region); | ||||
| } | } | ||||
| static void image_buttons_region_listener(wmWindow *UNUSED(win), | static void image_buttons_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_TEXTURE: | case NC_TEXTURE: | ||||
| case NC_MATERIAL: | case NC_MATERIAL: | ||||
| /* sending by texture render job and needed to properly update displaying | /* sending by texture render job and needed to properly update displaying | ||||
| * brush texture icon */ | * brush texture icon */ | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | static void image_tools_region_init(wmWindowManager *wm, ARegion *region) | ||||
| WM_event_add_keymap_handler(®ion->handlers, keymap); | WM_event_add_keymap_handler(®ion->handlers, keymap); | ||||
| } | } | ||||
| static void image_tools_region_draw(const bContext *C, ARegion *region) | static void image_tools_region_draw(const bContext *C, ARegion *region) | ||||
| { | { | ||||
| ED_region_panels(C, region); | ED_region_panels(C, region); | ||||
| } | } | ||||
| static void image_tools_region_listener(wmWindow *UNUSED(win), | static void image_tools_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_GPENCIL: | case NC_GPENCIL: | ||||
| if (wmn->data == ND_DATA || ELEM(wmn->action, NA_EDITED, NA_SELECTED)) { | if (wmn->data == ND_DATA || ELEM(wmn->action, NA_EDITED, NA_SELECTED)) { | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| } | } | ||||
| break; | break; | ||||
| case NC_BRUSH: | case NC_BRUSH: | ||||
| Show All 35 Lines | static void image_header_region_draw(const bContext *C, ARegion *region) | ||||
| ScrArea *area = CTX_wm_area(C); | ScrArea *area = CTX_wm_area(C); | ||||
| SpaceImage *sima = area->spacedata.first; | SpaceImage *sima = area->spacedata.first; | ||||
| image_user_refresh_scene(C, sima); | image_user_refresh_scene(C, sima); | ||||
| ED_region_header(C, region); | ED_region_header(C, region); | ||||
| } | } | ||||
| static void image_header_region_listener(wmWindow *UNUSED(win), | static void image_header_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_SCENE: | case NC_SCENE: | ||||
| switch (wmn->data) { | switch (wmn->data) { | ||||
| case ND_MODE: | case ND_MODE: | ||||
| case ND_TOOLSETTINGS: | case ND_TOOLSETTINGS: | ||||
| ED_region_tag_redraw(region); | ED_region_tag_redraw(region); | ||||
| break; | break; | ||||
| ▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines | |||||