Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-04-17 07:17:24 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-04-17 07:21:24 +0300
commite12c08e8d170b7ca40f204a5b0423c23a9fbc2c1 (patch)
tree8cf3453d12edb177a218ef8009357518ec6cab6a /source/blender/blenkernel/BKE_screen.h
parentb3dabc200a4b0399ec6b81f2ff2730d07b44fcaa (diff)
ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat
Diffstat (limited to 'source/blender/blenkernel/BKE_screen.h')
-rw-r--r--source/blender/blenkernel/BKE_screen.h385
1 files changed, 203 insertions, 182 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index d8881472d65..6a9711dd316 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -59,240 +59,254 @@ struct wmWindowManager;
* ED_spacetypes_init() in editors/space_api/spacetypes.c */
/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */
-#define BKE_ST_MAXNAME 64
+#define BKE_ST_MAXNAME 64
typedef struct SpaceType {
- struct SpaceType *next, *prev;
+ struct SpaceType *next, *prev;
- char name[BKE_ST_MAXNAME]; /* for menus */
- int spaceid; /* unique space identifier */
- int iconid; /* icon lookup for menus */
+ char name[BKE_ST_MAXNAME]; /* for menus */
+ int spaceid; /* unique space identifier */
+ int iconid; /* icon lookup for menus */
- /* Initial allocation, after this WM will call init() too. Some editors need
- * area and scene data (e.g. frame range) to set their initial scrolling. */
- struct SpaceLink *(*new)(const struct ScrArea *sa, const struct Scene *scene);
- /* not free spacelink itself */
- void (*free)(struct SpaceLink *sl);
+ /* Initial allocation, after this WM will call init() too. Some editors need
+ * area and scene data (e.g. frame range) to set their initial scrolling. */
+ struct SpaceLink *(*new)(const struct ScrArea *sa, const struct Scene *scene);
+ /* not free spacelink itself */
+ void (*free)(struct SpaceLink *sl);
- /* init is to cope with file load, screen (size) changes, check handlers */
- void (*init)(struct wmWindowManager *wm, struct ScrArea *sa);
- /* exit is called when the area is hidden or removed */
- void (*exit)(struct wmWindowManager *wm, struct ScrArea *sa);
- /* Listeners can react to bContext changes */
- void (*listener)(struct wmWindow *win, struct ScrArea *sa,
- struct wmNotifier *wmn, struct Scene *scene);
+ /* init is to cope with file load, screen (size) changes, check handlers */
+ void (*init)(struct wmWindowManager *wm, struct ScrArea *sa);
+ /* exit is called when the area is hidden or removed */
+ void (*exit)(struct wmWindowManager *wm, struct ScrArea *sa);
+ /* Listeners can react to bContext changes */
+ void (*listener)(struct wmWindow *win,
+ struct ScrArea *sa,
+ struct wmNotifier *wmn,
+ struct Scene *scene);
- /* refresh context, called after filereads, ED_area_tag_refresh() */
- void (*refresh)(const struct bContext *C, struct ScrArea *sa);
+ /* refresh context, called after filereads, ED_area_tag_refresh() */
+ void (*refresh)(const struct bContext *C, struct ScrArea *sa);
- /* after a spacedata copy, an init should result in exact same situation */
- struct SpaceLink *(*duplicate)(struct SpaceLink *sl);
+ /* after a spacedata copy, an init should result in exact same situation */
+ struct SpaceLink *(*duplicate)(struct SpaceLink *sl);
- /* register operator types on startup */
- void (*operatortypes)(void);
- /* add default items to WM keymap */
- void (*keymap)(struct wmKeyConfig *keyconf);
- /* on startup, define dropboxes for spacetype+regions */
- void (*dropboxes)(void);
+ /* register operator types on startup */
+ void (*operatortypes)(void);
+ /* add default items to WM keymap */
+ void (*keymap)(struct wmKeyConfig *keyconf);
+ /* on startup, define dropboxes for spacetype+regions */
+ void (*dropboxes)(void);
- /* initialize gizmo-map-types and gizmo-group-types with the region */
- void (*gizmos)(void);
+ /* initialize gizmo-map-types and gizmo-group-types with the region */
+ void (*gizmos)(void);
- /* return context data */
- int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
+ /* return context data */
+ int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
- /* Used when we want to replace an ID by another (or NULL). */
- void (*id_remap)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id);
+ /* Used when we want to replace an ID by another (or NULL). */
+ void (*id_remap)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id);
- int (*space_subtype_get)(struct ScrArea *sa);
- void (*space_subtype_set)(struct ScrArea *sa, int value);
- void (*space_subtype_item_extend)(struct bContext *C, EnumPropertyItem **item, int *totitem);
+ int (*space_subtype_get)(struct ScrArea *sa);
+ void (*space_subtype_set)(struct ScrArea *sa, int value);
+ void (*space_subtype_item_extend)(struct bContext *C, EnumPropertyItem **item, int *totitem);
- /* region type definitions */
- ListBase regiontypes;
+ /* region type definitions */
+ ListBase regiontypes;
- /* read and write... */
+ /* read and write... */
- /* default keymaps to add */
- int keymapflag;
+ /* default keymaps to add */
+ int keymapflag;
} SpaceType;
/* region types are also defined using spacetypes_init, via a callback */
typedef struct ARegionType {
- struct ARegionType *next, *prev;
-
- int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */
-
- /* add handlers, stuff you only do once or on area/region type/size changes */
- void (*init)(struct wmWindowManager *wm, struct ARegion *ar);
- /* exit is called when the region is hidden or removed */
- void (*exit)(struct wmWindowManager *wm, struct ARegion *ar);
- /* draw entirely, view changes should be handled here */
- void (*draw)(const struct bContext *C, struct ARegion *ar);
- /* optional, compute button layout before drawing for dynamic size */
- void (*layout)(const struct bContext *C, struct ARegion *ar);
- /* snap the size of the region (can be NULL for no snapping). */
- int (*snap_size)(const struct ARegion *ar, int size, int axis);
- /* contextual changes should be handled here */
- void (*listener)(struct wmWindow *win, struct ScrArea *sa, struct ARegion *ar,
- struct wmNotifier *wmn, const struct Scene *scene);
- /* Optional callback to generate subscriptions. */
- void (*message_subscribe)(
- const struct bContext *C,
- struct WorkSpace *workspace, struct Scene *scene,
- struct bScreen *sc, struct ScrArea *sa, struct ARegion *ar,
- struct wmMsgBus *mbus);
-
- void (*free)(struct ARegion *);
-
- /* split region, copy data optionally */
- void *(*duplicate)(void *poin);
-
-
- /* register operator types on startup */
- void (*operatortypes)(void);
- /* add own items to keymap */
- void (*keymap)(struct wmKeyConfig *keyconf);
- /* allows default cursor per region */
- void (*cursor)(struct wmWindow *win, struct ScrArea *sa, struct ARegion *ar);
-
- /* return context data */
- int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
-
- /* custom drawing callbacks */
- ListBase drawcalls;
-
- /* panels type definitions */
- ListBase paneltypes;
-
- /* header type definitions */
- ListBase headertypes;
-
- /* hardcoded constraints, smaller than these values region is not visible */
- int minsizex, minsizey;
- /* when new region opens (region prefsizex/y are zero then */
- int prefsizex, prefsizey;
- /* default keymaps to add */
- int keymapflag;
- /* return without drawing. lock is set by region definition, and copied to do_lock by render. can become flag */
- short do_lock, lock;
- /* call cursor function on each move event */
- short event_cursor;
+ struct ARegionType *next, *prev;
+
+ int regionid; /* unique identifier within this space, defines RGN_TYPE_xxxx */
+
+ /* add handlers, stuff you only do once or on area/region type/size changes */
+ void (*init)(struct wmWindowManager *wm, struct ARegion *ar);
+ /* exit is called when the region is hidden or removed */
+ void (*exit)(struct wmWindowManager *wm, struct ARegion *ar);
+ /* draw entirely, view changes should be handled here */
+ void (*draw)(const struct bContext *C, struct ARegion *ar);
+ /* optional, compute button layout before drawing for dynamic size */
+ void (*layout)(const struct bContext *C, struct ARegion *ar);
+ /* snap the size of the region (can be NULL for no snapping). */
+ int (*snap_size)(const struct ARegion *ar, int size, int axis);
+ /* contextual changes should be handled here */
+ void (*listener)(struct wmWindow *win,
+ struct ScrArea *sa,
+ struct ARegion *ar,
+ struct wmNotifier *wmn,
+ const struct Scene *scene);
+ /* Optional callback to generate subscriptions. */
+ void (*message_subscribe)(const struct bContext *C,
+ struct WorkSpace *workspace,
+ struct Scene *scene,
+ struct bScreen *sc,
+ struct ScrArea *sa,
+ struct ARegion *ar,
+ struct wmMsgBus *mbus);
+
+ void (*free)(struct ARegion *);
+
+ /* split region, copy data optionally */
+ void *(*duplicate)(void *poin);
+
+ /* register operator types on startup */
+ void (*operatortypes)(void);
+ /* add own items to keymap */
+ void (*keymap)(struct wmKeyConfig *keyconf);
+ /* allows default cursor per region */
+ void (*cursor)(struct wmWindow *win, struct ScrArea *sa, struct ARegion *ar);
+
+ /* return context data */
+ int (*context)(const struct bContext *C, const char *member, struct bContextDataResult *result);
+
+ /* custom drawing callbacks */
+ ListBase drawcalls;
+
+ /* panels type definitions */
+ ListBase paneltypes;
+
+ /* header type definitions */
+ ListBase headertypes;
+
+ /* hardcoded constraints, smaller than these values region is not visible */
+ int minsizex, minsizey;
+ /* when new region opens (region prefsizex/y are zero then */
+ int prefsizex, prefsizey;
+ /* default keymaps to add */
+ int keymapflag;
+ /* return without drawing. lock is set by region definition, and copied to do_lock by render. can become flag */
+ short do_lock, lock;
+ /* call cursor function on each move event */
+ short event_cursor;
} ARegionType;
/* panel types */
typedef struct PanelType {
- struct PanelType *next, *prev;
-
- char idname[BKE_ST_MAXNAME]; /* unique name */
- char label[BKE_ST_MAXNAME]; /* for panel header */
- char translation_context[BKE_ST_MAXNAME];
- char context[BKE_ST_MAXNAME]; /* for buttons window */
- char category[BKE_ST_MAXNAME]; /* for category tabs */
- char owner_id[BKE_ST_MAXNAME]; /* for work-spaces to selectively show. */
- char parent_id[BKE_ST_MAXNAME]; /* parent idname for subpanels */
- short space_type;
- short region_type;
- /* For popovers, 0 for default. */
- int ui_units_x;
-
- int flag;
-
- /* verify if the panel should draw or not */
- bool (*poll)(const struct bContext *C, struct PanelType *pt);
- /* draw header (optional) */
- void (*draw_header)(const struct bContext *C, struct Panel *pa);
- /* draw header preset (optional) */
- void (*draw_header_preset)(const struct bContext *C, struct Panel *pa);
- /* draw entirely, view changes should be handled here */
- void (*draw)(const struct bContext *C, struct Panel *pa);
-
- /* sub panels */
- struct PanelType *parent;
- ListBase children;
-
- /* RNA integration */
- ExtensionRNA ext;
+ struct PanelType *next, *prev;
+
+ char idname[BKE_ST_MAXNAME]; /* unique name */
+ char label[BKE_ST_MAXNAME]; /* for panel header */
+ char translation_context[BKE_ST_MAXNAME];
+ char context[BKE_ST_MAXNAME]; /* for buttons window */
+ char category[BKE_ST_MAXNAME]; /* for category tabs */
+ char owner_id[BKE_ST_MAXNAME]; /* for work-spaces to selectively show. */
+ char parent_id[BKE_ST_MAXNAME]; /* parent idname for subpanels */
+ short space_type;
+ short region_type;
+ /* For popovers, 0 for default. */
+ int ui_units_x;
+
+ int flag;
+
+ /* verify if the panel should draw or not */
+ bool (*poll)(const struct bContext *C, struct PanelType *pt);
+ /* draw header (optional) */
+ void (*draw_header)(const struct bContext *C, struct Panel *pa);
+ /* draw header preset (optional) */
+ void (*draw_header_preset)(const struct bContext *C, struct Panel *pa);
+ /* draw entirely, view changes should be handled here */
+ void (*draw)(const struct bContext *C, struct Panel *pa);
+
+ /* sub panels */
+ struct PanelType *parent;
+ ListBase children;
+
+ /* RNA integration */
+ ExtensionRNA ext;
} PanelType;
/* uilist types */
/* Draw an item in the uiList */
-typedef void (*uiListDrawItemFunc)(
- struct uiList *ui_list, struct bContext *C, struct uiLayout *layout, struct PointerRNA *dataptr,
- struct PointerRNA *itemptr, int icon, struct PointerRNA *active_dataptr, const char *active_propname,
- int index, int flt_flag);
+typedef void (*uiListDrawItemFunc)(struct uiList *ui_list,
+ struct bContext *C,
+ struct uiLayout *layout,
+ struct PointerRNA *dataptr,
+ struct PointerRNA *itemptr,
+ int icon,
+ struct PointerRNA *active_dataptr,
+ const char *active_propname,
+ int index,
+ int flt_flag);
/* Draw the filtering part of an uiList */
-typedef void (*uiListDrawFilterFunc)(
- struct uiList *ui_list, struct bContext *C, struct uiLayout *layout);
+typedef void (*uiListDrawFilterFunc)(struct uiList *ui_list,
+ struct bContext *C,
+ struct uiLayout *layout);
/* Filter items of an uiList */
-typedef void (*uiListFilterItemsFunc)(
- struct uiList *ui_list, struct bContext *C, struct PointerRNA *, const char *propname);
+typedef void (*uiListFilterItemsFunc)(struct uiList *ui_list,
+ struct bContext *C,
+ struct PointerRNA *,
+ const char *propname);
typedef struct uiListType {
- struct uiListType *next, *prev;
+ struct uiListType *next, *prev;
- char idname[BKE_ST_MAXNAME]; /* unique name */
+ char idname[BKE_ST_MAXNAME]; /* unique name */
- uiListDrawItemFunc draw_item;
- uiListDrawFilterFunc draw_filter;
- uiListFilterItemsFunc filter_items;
+ uiListDrawItemFunc draw_item;
+ uiListDrawFilterFunc draw_filter;
+ uiListFilterItemsFunc filter_items;
- /* RNA integration */
- ExtensionRNA ext;
+ /* RNA integration */
+ ExtensionRNA ext;
} uiListType;
/* header types */
typedef struct HeaderType {
- struct HeaderType *next, *prev;
+ struct HeaderType *next, *prev;
- char idname[BKE_ST_MAXNAME]; /* unique name */
- int space_type;
- int region_type;
+ char idname[BKE_ST_MAXNAME]; /* unique name */
+ int space_type;
+ int region_type;
- bool (*poll)(const struct bContext *C, struct HeaderType *ht);
- /* draw entirely, view changes should be handled here */
- void (*draw)(const struct bContext *C, struct Header *header);
+ bool (*poll)(const struct bContext *C, struct HeaderType *ht);
+ /* draw entirely, view changes should be handled here */
+ void (*draw)(const struct bContext *C, struct Header *header);
- /* RNA integration */
- ExtensionRNA ext;
+ /* RNA integration */
+ ExtensionRNA ext;
} HeaderType;
typedef struct Header {
- struct HeaderType *type; /* runtime */
- struct uiLayout *layout; /* runtime for drawing */
+ struct HeaderType *type; /* runtime */
+ struct uiLayout *layout; /* runtime for drawing */
} Header;
-
/* menu types */
typedef struct MenuType {
- struct MenuType *next, *prev;
+ struct MenuType *next, *prev;
- char idname[BKE_ST_MAXNAME]; /* unique name */
- char label[BKE_ST_MAXNAME]; /* for button text */
- char translation_context[BKE_ST_MAXNAME];
- char owner_id[BKE_ST_MAXNAME]; /* optional, see: #wmOwnerID */
- const char *description;
+ char idname[BKE_ST_MAXNAME]; /* unique name */
+ char label[BKE_ST_MAXNAME]; /* for button text */
+ char translation_context[BKE_ST_MAXNAME];
+ char owner_id[BKE_ST_MAXNAME]; /* optional, see: #wmOwnerID */
+ const char *description;
- /* verify if the menu should draw or not */
- bool (*poll)(const struct bContext *C, struct MenuType *mt);
- /* draw entirely, view changes should be handled here */
- void (*draw)(const struct bContext *C, struct Menu *menu);
+ /* verify if the menu should draw or not */
+ bool (*poll)(const struct bContext *C, struct MenuType *mt);
+ /* draw entirely, view changes should be handled here */
+ void (*draw)(const struct bContext *C, struct Menu *menu);
- /* RNA integration */
- ExtensionRNA ext;
+ /* RNA integration */
+ ExtensionRNA ext;
} MenuType;
typedef struct Menu {
- struct MenuType *type; /* runtime */
- struct uiLayout *layout; /* runtime for drawing */
+ struct MenuType *type; /* runtime */
+ struct uiLayout *layout; /* runtime for drawing */
} Menu;
/* spacetypes */
@@ -309,19 +323,20 @@ void BKE_spacedata_freelist(ListBase *lb);
void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2);
void BKE_spacedata_draw_locks(int set);
-struct ARegion *BKE_spacedata_find_region_type(
- const struct SpaceLink *slink, const struct ScrArea *sa,
- int region_type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+struct ARegion *BKE_spacedata_find_region_type(const struct SpaceLink *slink,
+ const struct ScrArea *sa,
+ int region_type) ATTR_WARN_UNUSED_RESULT
+ ATTR_NONNULL();
void BKE_spacedata_callback_id_remap_set(
- void (*func)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id));
+ void (*func)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id));
void BKE_spacedata_id_unref(struct ScrArea *sa, struct SpaceLink *sl, struct ID *id);
/* area/regions */
struct ARegion *BKE_area_region_copy(struct SpaceType *st, struct ARegion *ar);
-void BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
-void BKE_area_region_panels_free(struct ListBase *panels);
-void BKE_screen_area_free(struct ScrArea *sa);
+void BKE_area_region_free(struct SpaceType *st, struct ARegion *ar);
+void BKE_area_region_panels_free(struct ListBase *panels);
+void BKE_screen_area_free(struct ScrArea *sa);
/* Gizmo-maps of a region need to be freed with the region. Uses callback to avoid low-level call. */
void BKE_region_callback_free_gizmomap_set(void (*callback)(struct wmGizmoMap *));
void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizmoMap *));
@@ -329,16 +344,22 @@ void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizm
struct ARegion *BKE_area_find_region_type(const struct ScrArea *sa, int type);
struct ARegion *BKE_area_find_region_active_win(struct ScrArea *sa);
struct ARegion *BKE_area_find_region_xy(struct ScrArea *sa, const int regiontype, int x, int y);
-struct ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc, struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2);
+struct ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc,
+ struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT
+ ATTR_NONNULL(1, 2);
struct ScrArea *BKE_screen_find_big_area(struct bScreen *sc, const int spacetype, const short min);
-struct ScrArea *BKE_screen_area_map_find_area_xy(const struct ScrAreaMap *areamap, const int spacetype, int x, int y);
+struct ScrArea *BKE_screen_area_map_find_area_xy(const struct ScrAreaMap *areamap,
+ const int spacetype,
+ int x,
+ int y);
struct ScrArea *BKE_screen_find_area_xy(struct bScreen *sc, const int spacetype, int x, int y);
void BKE_screen_gizmo_tag_refresh(struct bScreen *sc);
void BKE_screen_view3d_sync(struct View3D *v3d, struct Scene *scene);
void BKE_screen_view3d_scene_sync(struct bScreen *sc, struct Scene *scene);
-bool BKE_screen_is_fullscreen_area(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+bool BKE_screen_is_fullscreen_area(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT
+ ATTR_NONNULL();
bool BKE_screen_is_used(const struct bScreen *screen) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
/* zoom factor conversion */