[Bf-blender-cvs] [6fa06bdb793] workspaces: Minor changes
Campbell Barton
noreply at git.blender.org
Wed Apr 5 08:39:38 CEST 2017
Commit: 6fa06bdb7935692170f277f80cf8b6c9dfcacf21
Author: Campbell Barton
Date: Tue Apr 4 23:49:21 2017 +1000
Branches: workspaces
https://developer.blender.org/rB6fa06bdb7935692170f277f80cf8b6c9dfcacf21
Minor changes
- Remove utildefines from BKE_workspace header
- doxy example are typically for code examples, just use heading
- wrap args, avoid right shift
===================================================================
M source/blender/blenkernel/BKE_workspace.h
M source/blender/blenkernel/intern/workspace.c
A source/blender/makesdna/DNA_workspace_types.h
M source/blender/makesdna/dna_workspace_types.h
M source/blender/makesrna/intern/rna_workspace.c
===================================================================
diff --git a/source/blender/blenkernel/BKE_workspace.h b/source/blender/blenkernel/BKE_workspace.h
index 19166a6a5bd..c66952096d2 100644
--- a/source/blender/blenkernel/BKE_workspace.h
+++ b/source/blender/blenkernel/BKE_workspace.h
@@ -26,7 +26,6 @@
#define __BKE_WORKSPACE_H__
#include "BLI_compiler_attrs.h"
-#include "BLI_utildefines.h"
struct bScreen;
struct ListBase;
@@ -59,8 +58,10 @@ void BKE_workspace_remove(WorkSpace *workspace, struct Main *bmain);
WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const struct Main *bmain);
void BKE_workspace_instance_hook_free(WorkSpaceInstanceHook *hook, const struct Main *bmain);
-struct WorkSpaceLayout *BKE_workspace_layout_add(WorkSpace *workspace, struct bScreen *screen, const char *name) ATTR_NONNULL();
-void BKE_workspace_layout_remove(WorkSpace *workspace, WorkSpaceLayout *layout, struct Main *bmain) ATTR_NONNULL();
+struct WorkSpaceLayout *BKE_workspace_layout_add(
+ WorkSpace *workspace, struct bScreen *screen, const char *name) ATTR_NONNULL();
+void BKE_workspace_layout_remove(
+ WorkSpace *workspace, WorkSpaceLayout *layout, struct Main *bmain) ATTR_NONNULL();
/* -------------------------------------------------------------------- */
@@ -71,11 +72,14 @@ void BKE_workspace_layout_remove(WorkSpace *workspace, WorkSpaceLayout *layout,
_workspace##_next = BKE_workspace_next_get(_workspace); /* support removing workspace from list */
#define BKE_workspace_iter_end } (void)0
-void BKE_workspaces_transform_orientation_remove(const struct ListBase *workspaces,
- const struct TransformOrientation *orientation) ATTR_NONNULL();
+void BKE_workspaces_transform_orientation_remove(
+ const struct ListBase *workspaces,
+ const struct TransformOrientation *orientation) ATTR_NONNULL();
-WorkSpaceLayout *BKE_workspace_layout_find(const WorkSpace *ws, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
-WorkSpaceLayout *BKE_workspace_layout_find_exec(const WorkSpace *ws, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+WorkSpaceLayout *BKE_workspace_layout_find(
+ const WorkSpace *ws, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
+WorkSpaceLayout *BKE_workspace_layout_find_exec(
+ const WorkSpace *ws, const struct bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT;
#define BKE_workspace_layout_iter_begin(_layout, _start_layout) \
for (WorkSpaceLayout *_layout = _start_layout, *_layout##_next; _layout; _layout = _layout##_next) { \
@@ -85,9 +89,10 @@ WorkSpaceLayout *BKE_workspace_layout_find_exec(const WorkSpace *ws, const struc
_layout##_prev = BKE_workspace_layout_prev_get(_layout); /* support removing layout from list */
#define BKE_workspace_layout_iter_end } (void)0
-WorkSpaceLayout *BKE_workspace_layout_iter_circular(const WorkSpace *workspace, WorkSpaceLayout *start,
- bool (*callback)(const WorkSpaceLayout *layout, void *arg),
- void *arg, const bool iter_backward);
+WorkSpaceLayout *BKE_workspace_layout_iter_circular(
+ const WorkSpace *workspace, WorkSpaceLayout *start,
+ bool (*callback)(const WorkSpaceLayout *layout, void *arg),
+ void *arg, const bool iter_backward);
/* -------------------------------------------------------------------- */
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index 1efac3c0235..e95e22fd136 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -255,9 +255,10 @@ WorkSpaceLayout *BKE_workspace_layout_find(const WorkSpace *ws, const bScreen *s
return NULL;
}
-WorkSpaceLayout *BKE_workspace_layout_iter_circular(const WorkSpace *workspace, WorkSpaceLayout *start,
- bool (*callback)(const WorkSpaceLayout *layout, void *arg),
- void *arg, const bool iter_backward)
+WorkSpaceLayout *BKE_workspace_layout_iter_circular(
+ const WorkSpace *workspace, WorkSpaceLayout *start,
+ bool (*callback)(const WorkSpaceLayout *layout, void *arg),
+ void *arg, const bool iter_backward)
{
WorkSpaceLayout *iter_layout;
diff --git a/source/blender/makesdna/dna_workspace_types.h b/source/blender/makesdna/DNA_workspace_types.h
similarity index 100%
copy from source/blender/makesdna/dna_workspace_types.h
copy to source/blender/makesdna/DNA_workspace_types.h
diff --git a/source/blender/makesdna/dna_workspace_types.h b/source/blender/makesdna/dna_workspace_types.h
index 2eb449444d6..0b4c884dc3c 100644
--- a/source/blender/makesdna/dna_workspace_types.h
+++ b/source/blender/makesdna/dna_workspace_types.h
@@ -49,7 +49,7 @@ typedef struct WorkSpaceLayout {
typedef struct WorkSpace {
ID id;
- ListBase layouts;
+ ListBase layouts; /* WorkSpaceLayout */
/* Store for each hook (so for each window) which layout has
* been activated the last time this workspace was visible. */
ListBase hook_layout_relations; /* WorkSpaceDataRelation */
@@ -66,20 +66,22 @@ typedef struct WorkSpace {
*
* Using this we can restore the old state of a workspace if the user switches back to it.
*
- * \example When activating a workspace, it should activate the screen-layout that was active in that
- * workspace before *in this window*.
- * More concretely:
- * * There are two windows, win1 and win2.
- * * Both show workspace ws1, but both also had workspace ws2 activated at some point before.
- * * Last time ws2 was active in win1, screen-layout sl1 was activated.
- * * Last time ws2 was active in win2, screen-layout sl2 was activated.
- * * When changing from ws1 to ws2 in win1, screen-layout sl1 should be activated again.
- * * When changing from ws1 to ws2 in win2, screen-layout sl2 should be activated again.
- * So that means we have to store the active screen-layout in a per workspace, per window
- * relation. This struct is used to store an active screen-layout for each window within the
- * workspace.
- * To find the screen-layout to activate for this window-workspace combination, simply lookup
- * the WorkSpaceDataRelation with the workspace-hook of the window set as parent.
+ * Usage
+ * =====
+ * When activating a workspace, it should activate the screen-layout that was active in that
+ * workspace before *in this window*.
+ * More concretely:
+ * * There are two windows, win1 and win2.
+ * * Both show workspace ws1, but both also had workspace ws2 activated at some point before.
+ * * Last time ws2 was active in win1, screen-layout sl1 was activated.
+ * * Last time ws2 was active in win2, screen-layout sl2 was activated.
+ * * When changing from ws1 to ws2 in win1, screen-layout sl1 should be activated again.
+ * * When changing from ws1 to ws2 in win2, screen-layout sl2 should be activated again.
+ * So that means we have to store the active screen-layout in a per workspace, per window
+ * relation. This struct is used to store an active screen-layout for each window within the
+ * workspace.
+ * To find the screen-layout to activate for this window-workspace combination, simply lookup
+ * the WorkSpaceDataRelation with the workspace-hook of the window set as parent.
*/
typedef struct WorkSpaceDataRelation {
struct WorkSpaceDataRelation *next, *prev;
diff --git a/source/blender/makesrna/intern/rna_workspace.c b/source/blender/makesrna/intern/rna_workspace.c
index 02cc0d4f30c..78ffde5bbcf 100644
--- a/source/blender/makesrna/intern/rna_workspace.c
+++ b/source/blender/makesrna/intern/rna_workspace.c
@@ -22,12 +22,12 @@
* \ingroup RNA
*/
-#include "BKE_workspace.h"
-
#include "RNA_define.h"
#include "RNA_enum_types.h"
#include "RNA_types.h"
+#include "BKE_workspace.h"
+
#include "WM_api.h"
#include "WM_types.h"
More information about the Bf-blender-cvs
mailing list