Cleanup: operator type API, header
authorCampbell Barton <ideasman42@gmail.com>
Fri, 13 Jul 2018 10:46:10 +0000 (12:46 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 13 Jul 2018 10:47:04 +0000 (12:47 +0200)
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_operator_type.c
source/blender/windowmanager/intern/wm_operators.c

index 95d5a4813852b43b1476dbd9ab9180d1853feb43..2ae2a65e2c947bf837c238e534fafc45634097cd 100644 (file)
@@ -261,19 +261,6 @@ void               WM_operator_type_set(struct wmOperator *op, struct wmOperatorType *ot);
 void           WM_operator_stack_clear(struct wmWindowManager *wm);
 void           WM_operator_handlers_clear(wmWindowManager *wm, struct wmOperatorType *ot);
 
-struct wmOperatorType *WM_operatortype_find(const char *idname, bool quiet);
-void        WM_operatortype_iter(struct GHashIterator *ghi);
-void           WM_operatortype_append(void (*opfunc)(struct wmOperatorType *));
-void           WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType *, void *), void *userdata);
-void           WM_operatortype_append_macro_ptr(void (*opfunc)(struct wmOperatorType *, void *), void *userdata);
-void        WM_operatortype_remove_ptr(struct wmOperatorType *ot);
-bool        WM_operatortype_remove(const char *idname);
-void        WM_operatortype_last_properties_clear_all(void);
-
-struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag);
-struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname);
-
-
 bool        WM_operator_poll           (struct bContext *C, struct wmOperatorType *ot);
 bool        WM_operator_poll_context(struct bContext *C, struct wmOperatorType *ot, short context);
 int         WM_operator_call_ex(struct bContext *C, struct wmOperator *op, const bool store);
@@ -367,14 +354,28 @@ void              WM_operator_bl_idname(char *to, const char *from);
 void           WM_operator_py_idname(char *to, const char *from);
 bool        WM_operator_py_idname_ok_or_report(struct ReportList *reports, const char *classname, const char *idname);
 
-/* *************** uilist types ******************** */
+
+/* wm_operator_type.c */
+struct wmOperatorType *WM_operatortype_find(const char *idname, bool quiet);
+void WM_operatortype_iter(struct GHashIterator *ghi);
+void WM_operatortype_append(void (*opfunc)(struct wmOperatorType *));
+void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType *, void *), void *userdata);
+void WM_operatortype_append_macro_ptr(void (*opfunc)(struct wmOperatorType *, void *), void *userdata);
+void WM_operatortype_remove_ptr(struct wmOperatorType *ot);
+bool WM_operatortype_remove(const char *idname);
+void WM_operatortype_last_properties_clear_all(void);
+
+struct wmOperatorType *WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag);
+struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, const char *idname);
+
+/* wm_uilist_type.c */
 void                WM_uilisttype_init(void);
 struct uiListType  *WM_uilisttype_find(const char *idname, bool quiet);
 bool                WM_uilisttype_add(struct uiListType *ult);
 void                WM_uilisttype_freelink(struct uiListType *ult);
 void                WM_uilisttype_free(void);
 
-/* *************** menu types ******************** */
+/* wm_menu_type.c */
 void                WM_menutype_init(void);
 struct MenuType    *WM_menutype_find(const char *idname, bool quiet);
 bool                WM_menutype_add(struct MenuType *mt);
index 35efdb2c4a24ca799c3aa7267cf616424cfa92cf..62b378e08666e942f976be5460eb3cee9a8a838b 100644 (file)
@@ -199,6 +199,27 @@ void wm_operatortype_free(void)
        global_ops_hash = NULL;
 }
 
+/**
+ * Remove memory of all previously executed tools.
+ */
+void WM_operatortype_last_properties_clear_all(void)
+{
+       GHashIterator iter;
+
+       for (WM_operatortype_iter(&iter);
+            (!BLI_ghashIterator_done(&iter));
+            (BLI_ghashIterator_step(&iter)))
+       {
+               wmOperatorType *ot = BLI_ghashIterator_getValue(&iter);
+
+               if (ot->last_properties) {
+                       IDP_FreeProperty(ot->last_properties);
+                       MEM_freeN(ot->last_properties);
+                       ot->last_properties = NULL;
+               }
+       }
+}
+
 /** \} */
 
 /* -------------------------------------------------------------------- */
index d2fb49ffd571cba6302972365c7b921320aa0297..ffa6b0fc371c84b473a1b488b4047438aa728d4d 100644 (file)
 #define UNDOCUMENTED_OPERATOR_TIP N_("(undocumented operator)")
 
 /* ************ operator API, exported ********** */
-/**
- * Remove memory of all previously executed tools.
- */
-void WM_operatortype_last_properties_clear_all(void)
-{
-       GHashIterator iter;
-
-       for (WM_operatortype_iter(&iter);
-            (!BLI_ghashIterator_done(&iter));
-            (BLI_ghashIterator_step(&iter)))
-       {
-               wmOperatorType *ot = BLI_ghashIterator_getValue(&iter);
-
-               if (ot->last_properties) {
-                       IDP_FreeProperty(ot->last_properties);
-                       MEM_freeN(ot->last_properties);
-                       ot->last_properties = NULL;
-               }
-       }
-}
 
 /* SOME_OT_op -> some.op */
 void WM_operator_py_idname(char *to, const char *from)