[Bf-blender-cvs] [5361f62] temp-ui-refactor: cleanup: style/alignment
Campbell Barton
noreply at git.blender.org
Sun Nov 9 23:15:42 CET 2014
Commit: 5361f62e52f934977f311db728632417d65b9ced
Author: Campbell Barton
Date: Sun Nov 9 23:17:48 2014 +0100
Branches: temp-ui-refactor
https://developer.blender.org/rB5361f62e52f934977f311db728632417d65b9ced
cleanup: style/alignment
===================================================================
M source/blender/editors/include/UI_interface.h
M source/blender/editors/interface/interface_intern.h
M source/blender/editors/interface/interface_regions.c
M source/blender/editors/interface/interface_widgets.c
===================================================================
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 9d2df1e..9ba769b 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -98,19 +98,24 @@ typedef struct uiLayout uiLayout;
#define UI_SCREEN_MARGIN 10
/* uiBlock->dt and uiBut->dt */
-#define UI_EMBOSS 0 /* use widget style for drawing */
-#define UI_EMBOSS_NONE 1 /* Nothing, only icon and/or text */
-#define UI_EMBOSS_PULLDOWN 2 /* Pulldown menu style */
-#define UI_EMBOSS_TABLE 3 /* Table */
-#define UI_EMBOSS_RADIAL 4 /* Pie Menu */
+enum {
+ UI_EMBOSS = 0, /* use widget style for drawing */
+ UI_EMBOSS_NONE = 1, /* Nothing, only icon and/or text */
+ UI_EMBOSS_PULLDOWN = 2, /* Pulldown menu style */
+ UI_EMBOSS_TABLE = 3, /* Table */
+ UI_EMBOSS_RADIAL = 4, /* Pie Menu */
+};
/* uiBlock->direction */
-#define UI_DIR_ALL (UI_DIR_UP | UI_DIR_DOWN | UI_DIR_LEFT | UI_DIR_RIGHT)
-#define UI_DIR_UP (1 << 0)
-#define UI_DIR_DOWN (1 << 1)
-#define UI_DIR_LEFT (1 << 2)
-#define UI_DIR_RIGHT (1 << 3)
-#define UI_DIR_CENTER_Y (1 << 4)
+enum {
+ UI_DIR_UP = (1 << 0),
+ UI_DIR_DOWN = (1 << 1),
+ UI_DIR_LEFT = (1 << 2),
+ UI_DIR_RIGHT = (1 << 3),
+ UI_DIR_CENTER_Y = (1 << 4),
+
+ UI_DIR_ALL = (UI_DIR_UP | UI_DIR_DOWN | UI_DIR_LEFT | UI_DIR_RIGHT),
+};
#if 0
/* uiBlock->autofill (not yet used) */
@@ -155,8 +160,8 @@ typedef struct uiLayout uiLayout;
/* but->flag - general state flags. */
enum {
/* warning, the first 6 flags are internal */
- UI_BUT_ICON_SUBMENU = (1 << 6),
- UI_BUT_ICON_PREVIEW = (1 << 7),
+ UI_BUT_ICON_SUBMENU = (1 << 6),
+ UI_BUT_ICON_PREVIEW = (1 << 7),
UI_BUT_NODE_LINK = (1 << 8),
UI_BUT_NODE_ACTIVE = (1 << 9),
@@ -233,51 +238,51 @@ typedef enum {
/* assigned to but->type, OR'd with the flags above when passing args */
typedef enum {
- UI_BTYPE_BUT = (1 << 9),
- UI_BTYPE_ROW = (2 << 9),
- UI_BTYPE_TOGGLE = (3 << 9),
- UI_BTYPE_NUM = (5 << 9),
- UI_BTYPE_TEXT = (6 << 9),
- UI_BTYPE_TOGGLE_N = (9 << 9),
- UI_BTYPE_LABEL = (10 << 9),
- UI_BTYPE_MENU = (11 << 9), /* Dropdown list, actually! */
- UI_BTYPE_ICON_TOGGLE = (13 << 9),
- UI_BTYPE_NUM_SLIDER = (14 << 9),
- UI_BTYPE_COLOR = (15 << 9),
- UI_BTYPE_SCROLL = (18 << 9),
- UI_BTYPE_BLOCK = (19 << 9),
- UI_BTYPE_BUT_MENU = (20 << 9),
- UI_BTYPE_SEPR = (21 << 9),
- UI_BTYPE_LINK = (22 << 9),
- UI_BTYPE_INLINK = (23 << 9),
- UI_BTYPE_KEY_EVENT = (24 << 9),
- UI_BTYPE_HSVCUBE = (26 << 9),
- UI_BTYPE_PULLDOWN = (27 << 9), /* Menu, actually! */
- UI_BTYPE_ROUNDBOX = (28 << 9),
- UI_BTYPE_COLORBAND = (30 << 9),
- UI_BTYPE_UNITVEC = (31 << 9),
- UI_BTYPE_CURVE = (32 << 9),
- UI_BTYPE_ICON_TOGGLE_N = (34 << 9),
- UI_BTYPE_LISTBOX = (35 << 9),
- UI_BTYPE_LISTROW = (36 << 9),
- UI_BTYPE_BUT_TOGGLE = (37 << 9),
- UI_BTYPE_CHECKBOX = (38 << 9),
- UI_BTYPE_CHECKBOX_N = (39 << 9),
- UI_BTYPE_TRACK_PREVIEW = (40 << 9),
+ UI_BTYPE_BUT = (1 << 9),
+ UI_BTYPE_ROW = (2 << 9),
+ UI_BTYPE_TOGGLE = (3 << 9),
+ UI_BTYPE_NUM = (5 << 9),
+ UI_BTYPE_TEXT = (6 << 9),
+ UI_BTYPE_TOGGLE_N = (9 << 9),
+ UI_BTYPE_LABEL = (10 << 9),
+ UI_BTYPE_MENU = (11 << 9), /* Dropdown list, actually! */
+ UI_BTYPE_ICON_TOGGLE = (13 << 9),
+ UI_BTYPE_NUM_SLIDER = (14 << 9),
+ UI_BTYPE_COLOR = (15 << 9),
+ UI_BTYPE_SCROLL = (18 << 9),
+ UI_BTYPE_BLOCK = (19 << 9),
+ UI_BTYPE_BUT_MENU = (20 << 9),
+ UI_BTYPE_SEPR = (21 << 9),
+ UI_BTYPE_LINK = (22 << 9),
+ UI_BTYPE_INLINK = (23 << 9),
+ UI_BTYPE_KEY_EVENT = (24 << 9),
+ UI_BTYPE_HSVCUBE = (26 << 9),
+ UI_BTYPE_PULLDOWN = (27 << 9), /* Menu, actually! */
+ UI_BTYPE_ROUNDBOX = (28 << 9),
+ UI_BTYPE_COLORBAND = (30 << 9),
+ UI_BTYPE_UNITVEC = (31 << 9),
+ UI_BTYPE_CURVE = (32 << 9),
+ UI_BTYPE_ICON_TOGGLE_N = (34 << 9),
+ UI_BTYPE_LISTBOX = (35 << 9),
+ UI_BTYPE_LISTROW = (36 << 9),
+ UI_BTYPE_BUT_TOGGLE = (37 << 9),
+ UI_BTYPE_CHECKBOX = (38 << 9),
+ UI_BTYPE_CHECKBOX_N = (39 << 9),
+ UI_BTYPE_TRACK_PREVIEW = (40 << 9),
/* buttons with value >= UI_BTYPE_SEARCH_MENU don't get undo pushes */
- UI_BTYPE_SEARCH_MENU = (41 << 9),
- UI_BTYPE_EXTRA = (42 << 9),
- UI_BTYPE_HSVCIRCLE = (43 << 9),
- UI_BTYPE_HOTKEY_EVENT = (46 << 9),
- UI_BTYPE_IMAGE = (47 << 9),
- UI_BTYPE_HISTOGRAM = (48 << 9),
- UI_BTYPE_WAVEFORM = (49 << 9),
- UI_BTYPE_VECTORSCOPE = (50 << 9),
- UI_BTYPE_PROGRESS_BAR = (51 << 9),
- UI_BTYPE_SEARCH_MENU_UNLINK = (52 << 9),
- UI_BTYPE_NODE_SOCKET = (53 << 9),
- UI_BTYPE_SEPR_LINE = (54 << 9),
- UI_BTYPE_GRIP = (55 << 9),
+ UI_BTYPE_SEARCH_MENU = (41 << 9),
+ UI_BTYPE_EXTRA = (42 << 9),
+ UI_BTYPE_HSVCIRCLE = (43 << 9),
+ UI_BTYPE_HOTKEY_EVENT = (46 << 9),
+ UI_BTYPE_IMAGE = (47 << 9),
+ UI_BTYPE_HISTOGRAM = (48 << 9),
+ UI_BTYPE_WAVEFORM = (49 << 9),
+ UI_BTYPE_VECTORSCOPE = (50 << 9),
+ UI_BTYPE_PROGRESS_BAR = (51 << 9),
+ UI_BTYPE_SEARCH_MENU_UNLINK = (52 << 9),
+ UI_BTYPE_NODE_SOCKET = (53 << 9),
+ UI_BTYPE_SEPR_LINE = (54 << 9),
+ UI_BTYPE_GRIP = (55 << 9),
} eButType;
#define BUTTYPE (63 << 9)
@@ -302,7 +307,7 @@ typedef enum {
void UI_draw_roundbox(float minx, float miny, float maxx, float maxy, float rad);
void UI_draw_roundbox_corner_set(int type);
-int UI_draw_roundbox_corner_get(void);
+int UI_draw_roundbox_corner_get(void);
void UI_draw_roundbox_unfilled(float minx, float miny, float maxx, float maxy, float rad);
void UI_draw_box_shadow(unsigned char alpha, float minx, float miny, float maxx, float maxy);
void UI_draw_roundbox_gl_mode(int mode, float minx, float miny, float maxx, float maxy, float rad);
@@ -364,11 +369,16 @@ int UI_popup_menu_invoke(struct bContext *C, const char *idname, struct ReportLi
typedef struct uiPieMenu uiPieMenu;
int UI_pie_menu_invoke(struct bContext *C, const char *idname, const struct wmEvent *event);
-int UI_pie_menu_invoke_from_operator_enum(struct bContext *C, const char *title, const char *opname,
- const char *propname, const struct wmEvent *event);
-int UI_pie_menu_invoke_from_rna_enum(struct bContext *C, const char *title, const char *path, const struct wmEvent *event);
-
-struct uiPieMenu *UI_pie_menu_begin(struct bContext *C, const char *title, int icon, const struct wmEvent *event) ATTR_NONNULL();
+int UI_pie_menu_invoke_from_operator_enum(
+ struct bContext *C, const char *title, const char *opname,
+ const char *propname, const struct wmEvent *event);
+int UI_pie_menu_invoke_from_rna_enum(
+ struct bContext *C, const char *title,
+ const char *path, const struct wmEvent *event);
+
+struct uiPieMenu *UI_pie_menu_begin(
+ struct bContext *C, const char *title, int icon,
+ const struct wmEvent *event) ATTR_NONNULL();
void UI_pie_menu_end(struct bContext *C, uiPieMenu *pie);
struct uiLayout *UI_pie_menu_layout(struct uiPieMenu *pie);
/* Popup Blocks
@@ -646,20 +656,21 @@ int UI_searchbox_size_x(void);
/* check if a string is in an existing search box */
int UI_search_items_find_index(uiSearchItems *items, const char *name);
-void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg);
-void UI_block_func_butmenu_set(uiBlock *block, uiMenuHandleFunc func, void *arg);
-void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2);
-void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2);
+void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg);
+void UI_block_func_butmenu_set(uiBlock *block, uiMenuHandleFunc func, void *arg);
+void UI_block_func_set(uiBlock *block, uiButHandleFunc func, void *arg1, void *arg2);
+void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2);
-void UI_but_func_rename_set(uiBut *but, uiButHandleRenameFunc func, void *arg1);
-void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2);
-void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2);
+void UI_but_func_rename_set(uiBut *but, uiButHandleRenameFunc func, void *arg1);
+void UI_but_func_set(uiBut *but, uiButHandleFunc func, void *arg1, void *arg2);
+void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2);
-void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg);
+void UI_but_func_complete_set(uiBut *but, uiButCompleteFunc func, void *arg);
-void UI_but_func_drawextra_set(uiBlock *block,
- void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect),
- void *arg1, void *arg2);
+void UI_but_func_drawextra_set(
+ uiBlock *block,
+ void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect),
+ void *arg1, void *arg2);
bool UI_textbutton_activate_rna(const struct bContext *C, struct ARegion *ar,
const void *rna_poin_data, const char *rna_prop_id);
@@ -695,7 +706,7 @@ void UI_panels_draw(const struct bContext *C, struct ARegion *ar);
struct Panel *UI_panel_find_by_type(struct ARegion *ar, struct Pan
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list