Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/workspace/screen_context.c
- This file was moved from source/blender/editors/screen/screen_context.c.
| Show All 16 Lines | |||||
| * | * | ||||
| * The Original Code is Copyright (C) 2008 Blender Foundation. | * The Original Code is Copyright (C) 2008 Blender Foundation. | ||||
| * All rights reserved. | * All rights reserved. | ||||
| * | * | ||||
| * | * | ||||
| * ***** END GPL LICENSE BLOCK ***** | * ***** END GPL LICENSE BLOCK ***** | ||||
| */ | */ | ||||
| /** \file blender/editors/screen/screen_context.c | /** \file blender/editors/workspace/screen_context.c | ||||
| * \ingroup edscr | * \ingroup edworkspace | ||||
| */ | */ | ||||
| #include <stdio.h> | #include <stdio.h> | ||||
| #include <stdlib.h> | #include <stdlib.h> | ||||
| #include <string.h> | #include <string.h> | ||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_armature_types.h" | #include "DNA_armature_types.h" | ||||
| ▲ Show 20 Lines • Show All 52 Lines • ▼ Show 20 Lines | const char *screen_context_dir[] = { | ||||
| "visible_gpencil_layers", "editable_gpencil_layers", "editable_gpencil_strokes", | "visible_gpencil_layers", "editable_gpencil_layers", "editable_gpencil_strokes", | ||||
| "active_gpencil_layer", "active_gpencil_frame", "active_gpencil_palette", | "active_gpencil_layer", "active_gpencil_frame", "active_gpencil_palette", | ||||
| "active_gpencil_palettecolor", "active_gpencil_brush", | "active_gpencil_palettecolor", "active_gpencil_brush", | ||||
| "active_operator", | "active_operator", | ||||
| NULL}; | NULL}; | ||||
| int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result) | int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result) | ||||
| { | { | ||||
| wmWindow *win = CTX_wm_window(C); | |||||
| bScreen *sc = CTX_wm_screen(C); | bScreen *sc = CTX_wm_screen(C); | ||||
| ScrArea *sa = CTX_wm_area(C); | ScrArea *sa = CTX_wm_area(C); | ||||
| Scene *scene = sc->scene; | Scene *scene = WM_window_get_active_scene(win); | ||||
| Base *base; | Base *base; | ||||
| #if 0 /* Using the context breaks adding objects in the UI. Need to find out why - campbell */ | #if 0 /* Using the context breaks adding objects in the UI. Need to find out why - campbell */ | ||||
| Object *obact = CTX_data_active_object(C); | Object *obact = CTX_data_active_object(C); | ||||
| Object *obedit = CTX_data_edit_object(C); | Object *obedit = CTX_data_edit_object(C); | ||||
| base = CTX_data_active_base(C); | base = CTX_data_active_base(C); | ||||
| #else | #else | ||||
| Object *obedit = scene->obedit; | Object *obedit = scene->obedit; | ||||
| ▲ Show 20 Lines • Show All 512 Lines • Show Last 20 Lines | |||||