Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/include/UI_interface.h
| Show All 19 Lines | |||||
| /** \file | /** \file | ||||
| * \ingroup editorui | * \ingroup editorui | ||||
| */ | */ | ||||
| #pragma once | #pragma once | ||||
| #include "BLI_compiler_attrs.h" | #include "BLI_compiler_attrs.h" | ||||
| #include "BLI_sys_types.h" /* size_t */ | #include "BLI_sys_types.h" /* size_t */ | ||||
| #include "BLI_utildefines.h" | |||||
| #include "UI_interface_icons.h" | #include "UI_interface_icons.h" | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||
| extern "C" { | extern "C" { | ||||
| #endif | #endif | ||||
| /* Struct Declarations */ | /* Struct Declarations */ | ||||
| struct ARegion; | struct ARegion; | ||||
| struct AssetHandle; | |||||
| struct AssetFilterSettings; | |||||
| struct AutoComplete; | struct AutoComplete; | ||||
| struct EnumPropertyItem; | struct EnumPropertyItem; | ||||
| struct FileDirEntry; | |||||
| struct FileSelectParams; | struct FileSelectParams; | ||||
| struct ID; | struct ID; | ||||
| struct IDProperty; | struct IDProperty; | ||||
| struct ImBuf; | struct ImBuf; | ||||
| struct Image; | struct Image; | ||||
| struct ImageUser; | struct ImageUser; | ||||
| struct ListBase; | struct ListBase; | ||||
| struct MTex; | struct MTex; | ||||
| ▲ Show 20 Lines • Show All 314 Lines • ▼ Show 20 Lines | typedef enum { | ||||
| UI_BTYPE_LISTBOX = 36 << 9, | UI_BTYPE_LISTBOX = 36 << 9, | ||||
| UI_BTYPE_LISTROW = 37 << 9, | UI_BTYPE_LISTROW = 37 << 9, | ||||
| UI_BTYPE_HSVCIRCLE = 38 << 9, | UI_BTYPE_HSVCIRCLE = 38 << 9, | ||||
| UI_BTYPE_TRACK_PREVIEW = 40 << 9, | UI_BTYPE_TRACK_PREVIEW = 40 << 9, | ||||
| /** Buttons with value >= #UI_BTYPE_SEARCH_MENU don't get undo pushes. */ | /** Buttons with value >= #UI_BTYPE_SEARCH_MENU don't get undo pushes. */ | ||||
| UI_BTYPE_SEARCH_MENU = 41 << 9, | UI_BTYPE_SEARCH_MENU = 41 << 9, | ||||
| UI_BTYPE_EXTRA = 42 << 9, | UI_BTYPE_EXTRA = 42 << 9, | ||||
| /** A preview image (#PreviewImage), with text under it. Typically bigger than normal buttons and | |||||
| * laid out in a grid, e.g. like the File Browser in thumbnail display mode. */ | |||||
| UI_BTYPE_PREVIEW_TILE = 43 << 9, | |||||
| UI_BTYPE_HOTKEY_EVENT = 46 << 9, | UI_BTYPE_HOTKEY_EVENT = 46 << 9, | ||||
| /** Non-interactive image, used for splash screen */ | /** Non-interactive image, used for splash screen */ | ||||
| UI_BTYPE_IMAGE = 47 << 9, | UI_BTYPE_IMAGE = 47 << 9, | ||||
| UI_BTYPE_HISTOGRAM = 48 << 9, | UI_BTYPE_HISTOGRAM = 48 << 9, | ||||
| UI_BTYPE_WAVEFORM = 49 << 9, | UI_BTYPE_WAVEFORM = 49 << 9, | ||||
| UI_BTYPE_VECTORSCOPE = 50 << 9, | UI_BTYPE_VECTORSCOPE = 50 << 9, | ||||
| UI_BTYPE_PROGRESS_BAR = 51 << 9, | UI_BTYPE_PROGRESS_BAR = 51 << 9, | ||||
| UI_BTYPE_NODE_SOCKET = 53 << 9, | UI_BTYPE_NODE_SOCKET = 53 << 9, | ||||
| ▲ Show 20 Lines • Show All 205 Lines • ▼ Show 20 Lines | |||||
| bool UI_but_is_tool(const uiBut *but); | bool UI_but_is_tool(const uiBut *but); | ||||
| bool UI_but_is_utf8(const uiBut *but); | bool UI_but_is_utf8(const uiBut *but); | ||||
| #define UI_but_is_decorator(but) ((but)->type == UI_BTYPE_DECORATOR) | #define UI_but_is_decorator(but) ((but)->type == UI_BTYPE_DECORATOR) | ||||
| bool UI_block_is_empty_ex(const uiBlock *block, const bool skip_title); | bool UI_block_is_empty_ex(const uiBlock *block, const bool skip_title); | ||||
| bool UI_block_is_empty(const uiBlock *block); | bool UI_block_is_empty(const uiBlock *block); | ||||
| bool UI_block_can_add_separator(const uiBlock *block); | bool UI_block_can_add_separator(const uiBlock *block); | ||||
| struct uiList *UI_list_find_mouse_over(const struct ARegion *region, const struct wmEvent *event); | |||||
| /* interface_region_menu_popup.c */ | /* interface_region_menu_popup.c */ | ||||
| /** | /** | ||||
| * Popup Menus | * Popup Menus | ||||
| * | * | ||||
| * Functions used to create popup menus. For more extended menus the | * Functions used to create popup menus. For more extended menus the | ||||
| * UI_popup_menu_begin/End functions can be used to define own items with | * UI_popup_menu_begin/End functions can be used to define own items with | ||||
| * the uiItem functions in between. If it is a simple confirmation menu | * the uiItem functions in between. If it is a simple confirmation menu | ||||
| * or similar, popups can be created with a single function call. | * or similar, popups can be created with a single function call. | ||||
| ▲ Show 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | |||||
| uiBlock *UI_block_begin(const struct bContext *C, | uiBlock *UI_block_begin(const struct bContext *C, | ||||
| struct ARegion *region, | struct ARegion *region, | ||||
| const char *name, | const char *name, | ||||
| eUIEmbossType emboss); | eUIEmbossType emboss); | ||||
| void UI_block_end_ex(const struct bContext *C, uiBlock *block, const int xy[2], int r_xy[2]); | void UI_block_end_ex(const struct bContext *C, uiBlock *block, const int xy[2], int r_xy[2]); | ||||
| void UI_block_end(const struct bContext *C, uiBlock *block); | void UI_block_end(const struct bContext *C, uiBlock *block); | ||||
| void UI_block_draw(const struct bContext *C, struct uiBlock *block); | void UI_block_draw(const struct bContext *C, struct uiBlock *block); | ||||
| void UI_blocklist_update_window_matrix(const struct bContext *C, const struct ListBase *lb); | void UI_blocklist_update_window_matrix(const struct bContext *C, const struct ListBase *lb); | ||||
| void UI_blocklist_update_view_for_buttons(const struct bContext *C, const struct ListBase *lb); | |||||
| void UI_blocklist_draw(const struct bContext *C, const struct ListBase *lb); | void UI_blocklist_draw(const struct bContext *C, const struct ListBase *lb); | ||||
| void UI_block_update_from_old(const struct bContext *C, struct uiBlock *block); | void UI_block_update_from_old(const struct bContext *C, struct uiBlock *block); | ||||
| enum { | enum { | ||||
| UI_BLOCK_THEME_STYLE_REGULAR = 0, | UI_BLOCK_THEME_STYLE_REGULAR = 0, | ||||
| UI_BLOCK_THEME_STYLE_POPUP = 1, | UI_BLOCK_THEME_STYLE_POPUP = 1, | ||||
| }; | }; | ||||
| void UI_block_theme_style_set(uiBlock *block, char theme_style); | void UI_block_theme_style_set(uiBlock *block, char theme_style); | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| void UI_block_flag_enable(uiBlock *block, int flag); | void UI_block_flag_enable(uiBlock *block, int flag); | ||||
| void UI_block_flag_disable(uiBlock *block, int flag); | void UI_block_flag_disable(uiBlock *block, int flag); | ||||
| void UI_block_translate(uiBlock *block, int x, int y); | void UI_block_translate(uiBlock *block, int x, int y); | ||||
| int UI_but_return_value_get(uiBut *but); | int UI_but_return_value_get(uiBut *but); | ||||
| void UI_but_drag_set_id(uiBut *but, struct ID *id); | void UI_but_drag_set_id(uiBut *but, struct ID *id); | ||||
| void UI_but_drag_set_asset(uiBut *but, | void UI_but_drag_set_asset(uiBut *but, | ||||
| const char *name, | const struct AssetHandle *asset, | ||||
| const char *path, | const char *path, | ||||
| int id_type, | |||||
| int import_type, /* eFileAssetImportType */ | int import_type, /* eFileAssetImportType */ | ||||
| int icon, | int icon, | ||||
| struct ImBuf *imb, | struct ImBuf *imb, | ||||
| float scale); | float scale); | ||||
| void UI_but_drag_set_rna(uiBut *but, struct PointerRNA *ptr); | void UI_but_drag_set_rna(uiBut *but, struct PointerRNA *ptr); | ||||
| void UI_but_drag_set_path(uiBut *but, const char *path, const bool use_free); | void UI_but_drag_set_path(uiBut *but, const char *path, const bool use_free); | ||||
| void UI_but_drag_set_name(uiBut *but, const char *name); | void UI_but_drag_set_name(uiBut *but, const char *name); | ||||
| void UI_but_drag_set_value(uiBut *but); | void UI_but_drag_set_value(uiBut *but); | ||||
| ▲ Show 20 Lines • Show All 1,414 Lines • ▼ Show 20 Lines | |||||
| void uiTemplateNodeSocket(uiLayout *layout, struct bContext *C, float color[4]); | void uiTemplateNodeSocket(uiLayout *layout, struct bContext *C, float color[4]); | ||||
| void uiTemplateCacheFile(uiLayout *layout, | void uiTemplateCacheFile(uiLayout *layout, | ||||
| const struct bContext *C, | const struct bContext *C, | ||||
| struct PointerRNA *ptr, | struct PointerRNA *ptr, | ||||
| const char *propname); | const char *propname); | ||||
| /* Default UIList class name, keep in sync with its declaration in bl_ui/__init__.py */ | /* Default UIList class name, keep in sync with its declaration in bl_ui/__init__.py */ | ||||
| #define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list" | #define UI_UL_DEFAULT_CLASS_NAME "UI_UL_list" | ||||
| enum uiTemplateListFlags { | |||||
| UI_TEMPLATE_LIST_FLAG_NONE = 0, | |||||
| UI_TEMPLATE_LIST_SORT_REVERSE = (1 << 0), | |||||
| UI_TEMPLATE_LIST_SORT_LOCK = (1 << 1), | |||||
| /* Don't allow resizing the list, i.e. don't add the grip button. */ | |||||
| UI_TEMPLATE_LIST_NO_GRIP = (1 << 2), | |||||
| UI_TEMPLATE_LIST_FLAGS_LAST | |||||
| }; | |||||
| ENUM_OPERATORS(enum uiTemplateListFlags, UI_TEMPLATE_LIST_FLAGS_LAST); | |||||
| void uiTemplateList(uiLayout *layout, | void uiTemplateList(uiLayout *layout, | ||||
| struct bContext *C, | struct bContext *C, | ||||
| const char *listtype_name, | const char *listtype_name, | ||||
| const char *list_id, | const char *list_id, | ||||
| struct PointerRNA *dataptr, | struct PointerRNA *dataptr, | ||||
| const char *propname, | const char *propname, | ||||
| struct PointerRNA *active_dataptr, | struct PointerRNA *active_dataptr, | ||||
| const char *active_propname, | const char *active_propname, | ||||
| const char *item_dyntip_propname, | const char *item_dyntip_propname, | ||||
| int rows, | int rows, | ||||
| int maxrows, | int maxrows, | ||||
| int layout_type, | int layout_type, | ||||
| int columns, | int columns, | ||||
| bool sort_reverse, | enum uiTemplateListFlags flags); | ||||
| bool sort_lock); | struct uiList *uiTemplateList_ex(uiLayout *layout, | ||||
| struct bContext *C, | |||||
| const char *listtype_name, | |||||
| const char *list_id, | |||||
| struct PointerRNA *dataptr, | |||||
| const char *propname, | |||||
| struct PointerRNA *active_dataptr, | |||||
| const char *active_propname, | |||||
| const char *item_dyntip_propname, | |||||
| int rows, | |||||
| int maxrows, | |||||
| int layout_type, | |||||
| int columns, | |||||
| enum uiTemplateListFlags flags, | |||||
| void *customdata); | |||||
| void uiTemplateNodeLink(uiLayout *layout, | void uiTemplateNodeLink(uiLayout *layout, | ||||
| struct bContext *C, | struct bContext *C, | ||||
| struct bNodeTree *ntree, | struct bNodeTree *ntree, | ||||
| struct bNode *node, | struct bNode *node, | ||||
| struct bNodeSocket *input); | struct bNodeSocket *input); | ||||
| void uiTemplateNodeView(uiLayout *layout, | void uiTemplateNodeView(uiLayout *layout, | ||||
| struct bContext *C, | struct bContext *C, | ||||
| struct bNodeTree *ntree, | struct bNodeTree *ntree, | ||||
| Show All 29 Lines | void uiTemplateColormanagedViewSettings(struct uiLayout *layout, | ||||
| struct bContext *C, | struct bContext *C, | ||||
| struct PointerRNA *ptr, | struct PointerRNA *ptr, | ||||
| const char *propname); | const char *propname); | ||||
| int uiTemplateRecentFiles(struct uiLayout *layout, int rows); | int uiTemplateRecentFiles(struct uiLayout *layout, int rows); | ||||
| void uiTemplateFileSelectPath(uiLayout *layout, | void uiTemplateFileSelectPath(uiLayout *layout, | ||||
| struct bContext *C, | struct bContext *C, | ||||
| struct FileSelectParams *params); | struct FileSelectParams *params); | ||||
| void uiTemplateAssetView(struct uiLayout *layout, | |||||
| struct bContext *C, | |||||
| const char *list_id, | |||||
| struct PointerRNA *asset_library_dataptr, | |||||
| const char *asset_library_propname, | |||||
| struct PointerRNA *assets_dataptr, | |||||
| const char *assets_propname, | |||||
| struct PointerRNA *active_dataptr, | |||||
| const char *active_propname, | |||||
| const struct AssetFilterSettings *filter_settings, | |||||
| const char *activate_opname, | |||||
| struct PointerRNA *r_activate_op_properties, | |||||
| const char *drag_opname, | |||||
| struct PointerRNA *r_drag_op_properties); | |||||
| struct PointerRNA *UI_list_custom_activate_operator_set(struct uiList *ui_list, | |||||
| const char *opname, | |||||
| bool create_properties); | |||||
| struct PointerRNA *UI_list_custom_drag_operator_set(struct uiList *ui_list, | |||||
| const char *opname, | |||||
| bool create_properties); | |||||
| /* items */ | /* items */ | ||||
| void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname); | void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname); | ||||
| void uiItemEnumO_ptr(uiLayout *layout, | void uiItemEnumO_ptr(uiLayout *layout, | ||||
| struct wmOperatorType *ot, | struct wmOperatorType *ot, | ||||
| const char *name, | const char *name, | ||||
| int icon, | int icon, | ||||
| const char *propname, | const char *propname, | ||||
| ▲ Show 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | |||||
| /* UI Operators */ | /* UI Operators */ | ||||
| typedef struct uiDragColorHandle { | typedef struct uiDragColorHandle { | ||||
| float color[3]; | float color[3]; | ||||
| bool gamma_corrected; | bool gamma_corrected; | ||||
| } uiDragColorHandle; | } uiDragColorHandle; | ||||
| void ED_operatortypes_ui(void); | void ED_operatortypes_ui(void); | ||||
| void ED_keymap_ui(struct wmKeyConfig *keyconf); | void ED_keymap_ui(struct wmKeyConfig *keyconf); | ||||
| void ED_uilisttypes_ui(void); | |||||
| void UI_drop_color_copy(struct wmDrag *drag, struct wmDropBox *drop); | void UI_drop_color_copy(struct wmDrag *drag, struct wmDropBox *drop); | ||||
| bool UI_drop_color_poll(struct bContext *C, | bool UI_drop_color_poll(struct bContext *C, | ||||
| struct wmDrag *drag, | struct wmDrag *drag, | ||||
| const struct wmEvent *event, | const struct wmEvent *event, | ||||
| const char **r_tooltip); | const char **r_tooltip); | ||||
| bool UI_context_copy_to_selected_list(struct bContext *C, | bool UI_context_copy_to_selected_list(struct bContext *C, | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | |||||
| /* linker workaround ack! */ | /* linker workaround ack! */ | ||||
| void UI_template_fix_linking(void); | void UI_template_fix_linking(void); | ||||
| /* UI_OT_editsource helpers */ | /* UI_OT_editsource helpers */ | ||||
| bool UI_editsource_enable_check(void); | bool UI_editsource_enable_check(void); | ||||
| void UI_editsource_active_but_test(uiBut *but); | void UI_editsource_active_but_test(uiBut *but); | ||||
| void UI_editsource_but_replace(const uiBut *old_but, uiBut *new_but); | void UI_editsource_but_replace(const uiBut *old_but, uiBut *new_but); | ||||
| void UI_but_ensure_in_view(const struct bContext *C, struct ARegion *region, const uiBut *but); | |||||
| /* UI_butstore_ helpers */ | /* UI_butstore_ helpers */ | ||||
| typedef struct uiButStore uiButStore; | typedef struct uiButStore uiButStore; | ||||
| typedef struct uiButStoreElem uiButStoreElem; | typedef struct uiButStoreElem uiButStoreElem; | ||||
| uiButStore *UI_butstore_create(uiBlock *block); | uiButStore *UI_butstore_create(uiBlock *block); | ||||
| void UI_butstore_clear(uiBlock *block); | void UI_butstore_clear(uiBlock *block); | ||||
| void UI_butstore_update(uiBlock *block); | void UI_butstore_update(uiBlock *block); | ||||
| void UI_butstore_free(uiBlock *block, uiButStore *bs); | void UI_butstore_free(uiBlock *block, uiButStore *bs); | ||||
| ▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines | |||||