[Bf-blender-cvs] [4e7a99047fc] workspaces: Add/use utility macros for getters/setters in BKE_workspace.h

Julian Eisel noreply at git.blender.org
Sat Apr 8 17:43:08 CEST 2017


Commit: 4e7a99047fc9a8f923b47a668b5efab08966c830
Author: Julian Eisel
Date:   Sat Apr 8 17:42:29 2017 +0200
Branches: workspaces
https://developer.blender.org/rB4e7a99047fc9a8f923b47a668b5efab08966c830

Add/use utility macros for getters/setters in BKE_workspace.h

===================================================================

M	source/blender/blenkernel/BKE_workspace.h

===================================================================

diff --git a/source/blender/blenkernel/BKE_workspace.h b/source/blender/blenkernel/BKE_workspace.h
index 77d4af49257..a2f577ad006 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -99,48 +99,54 @@ WorkSpaceLayout *BKE_workspace_layout_iter_circular(
 /* -------------------------------------------------------------------- */
 /* Getters/Setters */
 
-WorkSpace *BKE_workspace_active_get(WorkSpaceInstanceHook *hook) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-void       BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) ATTR_NONNULL(1);
-struct ID *BKE_workspace_id_get(WorkSpace *workspace);
-const char *BKE_workspace_name_get(const WorkSpace *workspace);
-WorkSpace *BKE_workspace_next_get(const WorkSpace *workspace) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-WorkSpace *BKE_workspace_prev_get(const WorkSpace *workspace) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-WorkSpace *BKE_workspace_temp_store_get(WorkSpaceInstanceHook *hook) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-void       BKE_workspace_temp_store_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) ATTR_NONNULL(1);
-WorkSpaceLayout *BKE_workspace_active_layout_get(const WorkSpaceInstanceHook *hook) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-void             BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook, WorkSpaceLayout *layout) ATTR_NONNULL(1);
-WorkSpaceLayout *BKE_workspace_temp_layout_store_get(const WorkSpaceInstanceHook *hook) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-void             BKE_workspace_temp_layout_store_set(WorkSpaceInstanceHook *hook, WorkSpaceLayout *layout) ATTR_NONNULL(1);
-struct bScreen *BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+#define GETTER_ATTRS ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT
+#define SETTER_ATTRS ATTR_NONNULL(1)
+
+WorkSpace *BKE_workspace_active_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS;
+void       BKE_workspace_active_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS;
+struct ID *BKE_workspace_id_get(WorkSpace *workspace) GETTER_ATTRS;
+const char *BKE_workspace_name_get(const WorkSpace *workspace) GETTER_ATTRS;
+WorkSpace *BKE_workspace_next_get(const WorkSpace *workspace) GETTER_ATTRS;
+WorkSpace *BKE_workspace_prev_get(const WorkSpace *workspace) GETTER_ATTRS;
+WorkSpace *BKE_workspace_temp_store_get(WorkSpaceInstanceHook *hook) GETTER_ATTRS;
+void       BKE_workspace_temp_store_set(WorkSpaceInstanceHook *hook, WorkSpace *workspace) SETTER_ATTRS;
+WorkSpaceLayout *BKE_workspace_active_layout_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS;
+void             BKE_workspace_active_layout_set(WorkSpaceInstanceHook *hook, WorkSpaceLayout *layout) SETTER_ATTRS;
+WorkSpaceLayout *BKE_workspace_temp_layout_store_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS;
+void             BKE_workspace_temp_layout_store_set(WorkSpaceInstanceHook *hook, WorkSpaceLayout *layout) SETTER_ATTRS;
+struct bScreen *BKE_workspace_active_screen_get(const WorkSpaceInstanceHook *hook) GETTER_ATTRS;
 void            BKE_workspace_active_screen_set(
-        WorkSpaceInstanceHook *hook, struct WorkSpace *workspace, struct bScreen *screen) ATTR_NONNULL(1);
-enum ObjectMode BKE_workspace_object_mode_get(const WorkSpace *workspace) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+        WorkSpaceInstanceHook *hook, struct WorkSpace *workspace, struct bScreen *screen) SETTER_ATTRS;
+enum ObjectMode BKE_workspace_object_mode_get(const WorkSpace *workspace) GETTER_ATTRS;
 #ifdef USE_WORKSPACE_MODE
-void            BKE_workspace_object_mode_set(WorkSpace *workspace, const enum ObjectMode mode) ATTR_NONNULL();
+void            BKE_workspace_object_mode_set(WorkSpace *workspace, const enum ObjectMode mode) SETTER_ATTRS;
 #endif
-struct SceneLayer *BKE_workspace_render_layer_get(const WorkSpace *workspace) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-void               BKE_workspace_render_layer_set(WorkSpace *workspace, struct SceneLayer *layer) ATTR_NONNULL(1);
-struct ListBase *BKE_workspace_layouts_get(WorkSpace *workspace) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+struct SceneLayer *BKE_workspace_render_layer_get(const WorkSpace *workspace) GETTER_ATTRS;
+void               BKE_workspace_render_layer_set(WorkSpace *workspace, struct SceneLayer *layer) SETTER_ATTRS;
+struct ListBase *BKE_workspace_layouts_get(WorkSpace *workspace) GETTER_ATTRS;
 
-const char *BKE_workspace_layout_name_get(const WorkSpaceLayout *layout) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+const char *BKE_workspace_layout_name_get(const WorkSpaceLayout *layout) GETTER_ATTRS;
 void        BKE_workspace_layout_name_set(WorkSpace *workspace, WorkSpaceLayout *layout, const char *new_name) ATTR_NONNULL();
-struct bScreen *BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-void            BKE_workspace_layout_screen_set(WorkSpaceLayout *layout, struct bScreen *screen) ATTR_NONNULL(1);
-WorkSpaceLayout *BKE_workspace_layout_next_get(const WorkSpaceLayout *layout) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-WorkSpaceLayout *BKE_workspace_layout_prev_get(const WorkSpaceLayout *layout) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+struct bScreen *BKE_workspace_layout_screen_get(const WorkSpaceLayout *layout) GETTER_ATTRS;
+void            BKE_workspace_layout_screen_set(WorkSpaceLayout *layout, struct bScreen *screen) SETTER_ATTRS;
+WorkSpaceLayout *BKE_workspace_layout_next_get(const WorkSpaceLayout *layout) GETTER_ATTRS;
+WorkSpaceLayout *BKE_workspace_layout_prev_get(const WorkSpaceLayout *layout) GETTER_ATTRS;
 
 WorkSpaceLayout *BKE_workspace_hook_layout_for_workspace_get(
-        const WorkSpaceInstanceHook *hook, const WorkSpace *workspace) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+        const WorkSpaceInstanceHook *hook, const WorkSpace *workspace) GETTER_ATTRS;
 void             BKE_workspace_hook_layout_for_workspace_set(
-        WorkSpaceInstanceHook *hook, WorkSpace *workspace, WorkSpaceLayout *layout) ATTR_NONNULL(1);
-struct ListBase *BKE_workspace_hook_layout_relations_get(WorkSpace *workspace) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+        WorkSpaceInstanceHook *hook, WorkSpace *workspace, WorkSpaceLayout *layout) ATTR_NONNULL();
+struct ListBase *BKE_workspace_hook_layout_relations_get(WorkSpace *workspace) GETTER_ATTRS;
 
-struct WorkSpaceDataRelation *BKE_workspace_relation_next_get(const struct WorkSpaceDataRelation *relation) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+struct WorkSpaceDataRelation *BKE_workspace_relation_next_get(const struct WorkSpaceDataRelation *relation) GETTER_ATTRS;
 void BKE_workspace_relation_data_get(
         const struct WorkSpaceDataRelation *relation,
         void **parent, void **data) ATTR_NONNULL();
 void BKE_workspace_relation_data_set(struct WorkSpaceDataRelation *relation, void *parent, void *data) ATTR_NONNULL();
 
+#undef GETTER_ATTRS
+#undef SETTER_ATTRS
+
 /* -------------------------------------------------------------------- */
 /* Don't use outside of BKE! */




More information about the Bf-blender-cvs mailing list