Skip to content

Commit

Permalink
Cleanup: Remove interface region files to C++
Browse files Browse the repository at this point in the history
Moves all `interface_region*` files to C++ except for the tooptip region
which is slightly more complicated. Also move a few other files as well.
This helps to simplify and speed up code, especially through the use
of better C++ data structures. This change builds on all platforms on
the buildbot.
  • Loading branch information
HansGoudey committed Apr 2, 2022
1 parent 351c00d commit 4537eb0
Show file tree
Hide file tree
Showing 13 changed files with 339 additions and 331 deletions.
6 changes: 4 additions & 2 deletions source/blender/editors/include/UI_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ uiPopupMenu *UI_popup_menu_begin_ex(struct bContext *C,
* Set the whole structure to work.
*/
void UI_popup_menu_end(struct bContext *C, struct uiPopupMenu *pup);
bool UI_popup_menu_end_or_cancel(struct bContext *C, struct uiPopupMenu *head);
bool UI_popup_menu_end_or_cancel(struct bContext *C, struct uiPopupMenu *pup);
struct uiLayout *UI_popup_menu_layout(uiPopupMenu *pup);

void UI_popup_menu_reports(struct bContext *C, struct ReportList *reports) ATTR_NONNULL();
Expand Down Expand Up @@ -1595,13 +1595,15 @@ typedef enum {
} eButLabelAlign;

/* Return info for uiDefAutoButsRNA */
typedef enum {
typedef enum eAutoPropButsReturn {
/* Returns when no buttons were added */
UI_PROP_BUTS_NONE_ADDED = 1 << 0,
/* Returned when any property failed the custom check callback (check_prop) */
UI_PROP_BUTS_ANY_FAILED_CHECK = 1 << 1,
} eAutoPropButsReturn;

ENUM_OPERATORS(eAutoPropButsReturn, UI_PROP_BUTS_ANY_FAILED_CHECK);

uiBut *uiDefAutoButR(uiBlock *block,
struct PointerRNA *ptr,
struct PropertyRNA *prop,
Expand Down
20 changes: 10 additions & 10 deletions source/blender/editors/interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,25 +46,25 @@ set(SRC
interface_layout.c
interface_ops.c
interface_panel.c
interface_query.c
interface_region_color_picker.c
interface_region_hud.c
interface_region_menu_pie.c
interface_region_menu_popup.c
interface_region_popover.c
interface_region_popup.c
interface_query.cc
interface_region_color_picker.cc
interface_region_hud.cc
interface_region_menu_pie.cc
interface_region_menu_popup.cc
interface_region_popover.cc
interface_region_popup.cc
interface_region_search.cc
interface_region_tooltip.c
interface_regions.c
interface_style.c
interface_regions.cc
interface_style.cc
interface_template_asset_view.cc
interface_template_attribute_search.cc
interface_template_list.cc
interface_template_search_menu.cc
interface_template_search_operator.c
interface_templates.c
interface_undo.c
interface_utils.c
interface_utils.cc
interface_view.cc
interface_widgets.c
resources.c
Expand Down
6 changes: 3 additions & 3 deletions source/blender/editors/interface/interface_intern.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ struct uiBut {
BIFIconID icon;
/** Copied from the #uiBlock.emboss */
eUIEmbossType emboss;
/** direction in a pie menu, used for collision detection (RadialDirection) */
signed char pie_dir;
/** direction in a pie menu, used for collision detection. */
RadialDirection pie_dir;
/** could be made into a single flag */
bool changed;
/** so buttons can support unit systems which are not RNA */
Expand Down Expand Up @@ -954,7 +954,7 @@ void ui_pie_menu_level_create(uiBlock *block,
const EnumPropertyItem *items,
int totitem,
wmOperatorCallContext context,
int flag);
wmOperatorCallContext flag);

/* interface_region_popup.c */

Expand Down
Loading

0 comments on commit 4537eb0

Please sign in to comment.