diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-02-15 17:38:43 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-02-15 17:38:43 +0300 |
commit | 86cf6b40162b683a209cef499fd5beb2d69cc6e1 (patch) | |
tree | b9d115434046ea6aebd9b2743b1bc1298533c93e /source/blender | |
parent | efb21625bf690e97cc1d38096bb7f4bf9b85f2fc (diff) |
moving dir strings into global namespace for doc access (coming up)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/screen/screen_context.c | 26 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 14 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/image_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_image/space_image.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_node/space_node.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_text/space_text.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_text/text_intern.h | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/space_view3d.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_intern.h | 2 |
12 files changed, 48 insertions, 32 deletions
diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 7d526d217b9..931cc06d6cd 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -49,6 +49,18 @@ #include "screen_intern.h" +const char *screen_context_dir[] = { + "scene", "visible_objects", "visible_bases", "selectable_objects", "selectable_bases", + "selected_objects", "selected_bases", + "selected_editable_objects", "selected_editable_bases", + "visible_bones", "editable_bones", "selected_bones", "selected_editable_bones", + "visible_pose_bones", "selected_pose_bones", "active_bone", "active_pose_bone", + "active_base", "active_object", "object", "edit_object", + "sculpt_object", "vertex_paint_object", "weight_paint_object", + "texture_paint_object", "particle_edit_object", + "sequences", "selected_sequences", "selected_editable_sequences", /* sequencer */ + NULL}; + int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result) { bScreen *sc= CTX_wm_screen(C); @@ -67,19 +79,7 @@ int ed_screen_context(const bContext *C, const char *member, bContextDataResult #endif if(CTX_data_dir(member)) { - static const char *dir[] = { - "scene", "visible_objects", "visible_bases", "selectable_objects", "selectable_bases", - "selected_objects", "selected_bases", - "selected_editable_objects", "selected_editable_bases", - "visible_bones", "editable_bones", "selected_bones", "selected_editable_bones", - "visible_pose_bones", "selected_pose_bones", "active_bone", "active_pose_bone", - "active_base", "active_object", "object", "edit_object", - "sculpt_object", "vertex_paint_object", "weight_paint_object", - "texture_paint_object", "particle_edit_object", - "sequences", "selected_sequences", "selected_editable_sequences", /* sequencer */ - NULL}; - - CTX_data_dir_set(result, dir); + CTX_data_dir_set(result, screen_context_dir); return 1; } else if(CTX_data_equals(member, "scene")) { diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index 2c2ba4f148e..5f0d264ea4b 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -56,6 +56,8 @@ struct AZone *is_in_area_actionzone(ScrArea *sa, int x, int y); /* screen_context.c */ int ed_screen_context(const bContext *C, const char *member, bContextDataResult *result); +extern const char *screen_context_dir[]; /* doc access */ + /* screendump.c */ void SCREEN_OT_screenshot(struct wmOperatorType *ot); void SCREEN_OT_screencast(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index ee8b67a146a..fe49c20c040 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -617,6 +617,12 @@ void buttons_context_compute(const bContext *C, SpaceButs *sbuts) /************************* Context Callback ************************/ +const char *buttons_context_dir[] = { + "world", "object", "mesh", "armature", "lattice", "curve", + "meta_ball", "lamp", "camera", "material", "material_slot", + "texture", "texture_slot", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable", + "cloth", "soft_body", "fluid", "smoke", "collision", "brush", NULL}; + int buttons_context(const bContext *C, const char *member, bContextDataResult *result) { SpaceButs *sbuts= CTX_wm_space_buts(C); @@ -627,13 +633,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r /* here we handle context, getting data from precomputed path */ if(CTX_data_dir(member)) { - static const char *dir[] = { - "world", "object", "mesh", "armature", "lattice", "curve", - "meta_ball", "lamp", "camera", "material", "material_slot", - "texture", "texture_slot", "bone", "edit_bone", "pose_bone", "particle_system", "particle_system_editable", - "cloth", "soft_body", "fluid", "smoke", "collision", "brush", NULL}; - - CTX_data_dir_set(result, dir); + CTX_data_dir_set(result, buttons_context_dir); return 1; } else if(CTX_data_equals(member, "world")) { diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 9478168f35a..407454d4347 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -65,6 +65,8 @@ void buttons_context_draw(const struct bContext *C, struct uiLayout *layout); void buttons_context_register(struct ARegionType *art); struct ID *buttons_context_id_path(const struct bContext *C); +extern const char *buttons_context_dir[]; /* doc access */ + /* buttons_ops.c */ void BUTTONS_OT_file_browse(struct wmOperatorType *ot); void BUTTONS_OT_toolbox(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index 1b3bd59f648..327749125a5 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -46,6 +46,8 @@ struct bNodeTree; struct ARegion *image_has_buttons_region(struct ScrArea *sa); struct ARegion *image_has_scope_region(struct ScrArea *sa); +extern const char *image_context_dir[]; /* doc access */ + /* image_header.c */ void image_header_buttons(const struct bContext *C, struct ARegion *ar); diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 6606ca4cc4e..1d7cb357e5f 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -665,13 +665,14 @@ static void image_listener(ScrArea *sa, wmNotifier *wmn) } } +const char *image_context_dir[] = {"edit_image", NULL}; + static int image_context(const bContext *C, const char *member, bContextDataResult *result) { SpaceImage *sima= CTX_wm_space_image(C); if(CTX_data_dir(member)) { - static const char *dir[] = {"edit_image", NULL}; - CTX_data_dir_set(result, dir); + CTX_data_dir_set(result, image_context_dir); } else if(CTX_data_equals(member, "edit_image")) { CTX_data_id_pointer_set(result, (ID*)ED_space_image(sima)); diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index 831e157deef..eb7e1209801 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -121,6 +121,8 @@ void NODE_OT_backimage_sample(wmOperatorType *ot); void NODE_OT_add_file(struct wmOperatorType *ot); +extern const char *node_context_dir[]; + // XXXXXX // XXX from BSE_node.h diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index 90bf8ebb39f..db4d02a776c 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -411,13 +411,14 @@ static void node_region_listener(ARegion *ar, wmNotifier *wmn) } } +const char *node_context_dir[] = {"selected_nodes", NULL}; + static int node_context(const bContext *C, const char *member, bContextDataResult *result) { SpaceNode *snode= CTX_wm_space_node(C); if(CTX_data_dir(member)) { - static const char *dir[] = {"selected_nodes", NULL}; - CTX_data_dir_set(result, dir); + CTX_data_dir_set(result, node_context_dir); return 1; } else if(CTX_data_equals(member, "selected_nodes")) { diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index e9e98a9f7bf..506976e1ebc 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -351,13 +351,14 @@ static void text_keymap(struct wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "TEXT_OT_insert", KM_TEXTINPUT, KM_ANY, KM_ANY, 0); // last! } +const char *text_context_dir[] = {"edit_text", NULL}; + static int text_context(const bContext *C, const char *member, bContextDataResult *result) { SpaceText *st= CTX_wm_space_text(C); if(CTX_data_dir(member)) { - static const char *dir[] = {"edit_text", NULL}; - CTX_data_dir_set(result, dir); + CTX_data_dir_set(result, text_context_dir); return 1; } else if(CTX_data_equals(member, "edit_text")) { diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index 5f6b2e05ba7..6b0ab523075 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -157,5 +157,8 @@ void TEXT_OT_to_3d_object(struct wmOperatorType *ot); void TEXT_OT_resolve_conflict(struct wmOperatorType *ot); +/* space_text.c */ +extern const char *text_context_dir[]; /* doc access */ + #endif /* ED_TEXT_INTERN_H */ diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index f7ccebda6ae..ef2fa693cb1 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -951,6 +951,11 @@ static void space_view3d_listener(struct ScrArea *sa, struct wmNotifier *wmn) #endif } +const char *view3d_context_dir[] = { + "selected_objects", "selected_bases", "selected_editable_objects", + "selected_editable_bases", "visible_objects", "visible_bases", "selectable_objects", "selectable_bases", + "active_base", "active_object", NULL}; + static int view3d_context(const bContext *C, const char *member, bContextDataResult *result) { View3D *v3d= CTX_wm_view3d(C); @@ -959,12 +964,7 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes unsigned int lay = v3d ? v3d->lay:scene->lay; /* fallback to the scene layer, allows duplicate and other oject operators to run outside the 3d view */ if(CTX_data_dir(member)) { - static const char *dir[] = { - "selected_objects", "selected_bases", "selected_editable_objects", - "selected_editable_bases", "visible_objects", "visible_bases", "selectable_objects", "selectable_bases", - "active_base", "active_object", NULL}; - - CTX_data_dir_set(result, dir); + CTX_data_dir_set(result, view3d_context_dir); } else if(CTX_data_equals(member, "selected_objects") || CTX_data_equals(member, "selected_bases")) { int selected_objects= CTX_data_equals(member, "selected_objects"); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 0f1fe2fba07..b7efa7fced7 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -187,6 +187,8 @@ void VIEW3D_OT_snap_cursor_to_active(struct wmOperatorType *ot); ARegion *view3d_has_buttons_region(ScrArea *sa); ARegion *view3d_has_tools_region(ScrArea *sa); +extern const char *view3d_context_dir[]; /* doc access */ + /* draw_volume.c */ void draw_volume(struct ARegion *ar, struct GPUTexture *tex, float *min, float *max, int res[3], float dx, struct GPUTexture *tex_shadow); |