[Bf-blender-cvs] [89ef87f] wiggly-widgets: Register widgets & drop boxes together with operator types
Julian Eisel
noreply at git.blender.org
Thu Feb 18 01:01:57 CET 2016
Commit: 89ef87f240b5af19ef3e009a584f829f67d4961b
Author: Julian Eisel
Date: Thu Feb 18 01:00:24 2016 +0100
Branches: wiggly-widgets
https://developer.blender.org/rB89ef87f240b5af19ef3e009a584f829f67d4961b
Register widgets & drop boxes together with operator types
Avoids looping twice.
===================================================================
M source/blender/editors/include/ED_space_api.h
M source/blender/editors/space_api/spacetypes.c
M source/blender/windowmanager/intern/wm_init_exit.c
===================================================================
diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h
index fc812e0..d268c57 100644
--- a/source/blender/editors/include/ED_space_api.h
+++ b/source/blender/editors/include/ED_space_api.h
@@ -36,7 +36,6 @@ struct bContext;
void ED_spacetypes_init(void);
void ED_spacemacros_init(void);
-void ED_spacedropwidgets_init(void);
/* the pluginnable API for export to editors */
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index cd85141..c34be79 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -122,11 +122,15 @@ void ED_spacetypes_init(void)
ED_operatortypes_view2d();
ED_button_operatortypes();
- /* register operators */
spacetypes = BKE_spacetypes_list();
for (type = spacetypes->first; type; type = type->next) {
+ /* register operators, dropboxes, widgets */
if (type->operatortypes)
type->operatortypes();
+ if (type->dropboxes)
+ type->dropboxes();
+ if (type->widgets)
+ type->widgets();
}
/* register internal render callbacks */
@@ -153,21 +157,6 @@ void ED_spacemacros_init(void)
ED_operatormacros_gpencil();
}
-void ED_spacedropwidgets_init(void)
-{
- const ListBase *spacetypes;
- SpaceType *type;
-
- /* register dropboxes (can use macros) */
- spacetypes = BKE_spacetypes_list();
- for (type = spacetypes->first; type; type = type->next) {
- if (type->dropboxes)
- type->dropboxes();
- if (type->widgets)
- type->widgets();
- }
-}
-
/* called in wm.c */
/* keymap definitions are registered only once per WM initialize, usually on file read,
* using the keymap the actual areas/regions add the handlers */
diff --git a/source/blender/windowmanager/intern/wm_init_exit.c b/source/blender/windowmanager/intern/wm_init_exit.c
index 60e4518..6e54d36 100644
--- a/source/blender/windowmanager/intern/wm_init_exit.c
+++ b/source/blender/windowmanager/intern/wm_init_exit.c
@@ -175,8 +175,6 @@ void WM_init(bContext *C, int argc, const char **argv)
/* Enforce loading the UI for the initial homefile */
G.fileflags &= ~G_FILE_NO_UI;
- ED_spacedropwidgets_init();
-
/* reports cant be initialized before the wm,
* but keep before file reading, since that may report errors */
wm_init_reports(C);
More information about the Bf-blender-cvs
mailing list