diff options
Diffstat (limited to 'source/blender/editors/include')
-rw-r--r-- | source/blender/editors/include/ED_clip.h | 2 | ||||
-rw-r--r-- | source/blender/editors/include/ED_gpencil.h | 5 | ||||
-rw-r--r-- | source/blender/editors/include/ED_screen.h | 6 | ||||
-rw-r--r-- | source/blender/editors/include/ED_view3d.h | 10 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 46 | ||||
-rw-r--r-- | source/blender/editors/include/UI_tree_view.hh | 30 |
6 files changed, 53 insertions, 46 deletions
diff --git a/source/blender/editors/include/ED_clip.h b/source/blender/editors/include/ED_clip.h index 21d8a28e2c9..4fa78eddec4 100644 --- a/source/blender/editors/include/ED_clip.h +++ b/source/blender/editors/include/ED_clip.h @@ -65,7 +65,7 @@ struct ImBuf *ED_space_clip_get_stable_buffer(struct SpaceClip *sc, float *angle); bool ED_space_clip_get_position(struct SpaceClip *sc, - struct ARegion *ar, + struct ARegion *region, int mval[2], float fpos[2]); bool ED_space_clip_color_sample(struct SpaceClip *sc, diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index c760b661373..1cf15ce3a48 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -205,6 +205,11 @@ void ED_gpencil_select_frame(struct bGPDlayer *gpl, int selx, short select_mode) bool ED_gpencil_layer_frames_delete(struct bGPDlayer *gpl); void ED_gpencil_layer_frames_duplicate(struct bGPDlayer *gpl); +void ED_gpencil_layer_merge(struct bGPdata *gpd, + struct bGPDlayer *gpl_src, + struct bGPDlayer *gpl_dst, + const bool reverse); + void ED_gpencil_layer_frames_keytype_set(struct bGPDlayer *gpl, short type); void ED_gpencil_layer_snap_frames(struct bGPDlayer *gpl, struct Scene *scene, short mode); diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index ef3ff7874df..eee119c0712 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -31,6 +31,8 @@ #include "DNA_object_enums.h" +#include "WM_types.h" + #include "BLI_compiler_attrs.h" #ifdef __cplusplus @@ -380,7 +382,7 @@ struct bUserMenu *ED_screen_user_menu_ensure(struct bContext *C); struct bUserMenuItem_Op *ED_screen_user_menu_item_find_operator(struct ListBase *lb, const struct wmOperatorType *ot, struct IDProperty *prop, - short opcontext); + wmOperatorCallContext opcontext); struct bUserMenuItem_Menu *ED_screen_user_menu_item_find_menu(struct ListBase *lb, const struct MenuType *mt); struct bUserMenuItem_Prop *ED_screen_user_menu_item_find_prop(struct ListBase *lb, @@ -392,7 +394,7 @@ void ED_screen_user_menu_item_add_operator(struct ListBase *lb, const char *ui_name, const struct wmOperatorType *ot, const struct IDProperty *prop, - short opcontext); + wmOperatorCallContext opcontext); void ED_screen_user_menu_item_add_menu(struct ListBase *lb, const char *ui_name, const struct MenuType *mt); diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 8e19628ec87..008ad5b3203 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -588,8 +588,6 @@ float ED_view3d_radius_to_dist(const struct View3D *v3d, const bool use_aspect, const float radius); -void imm_drawcircball(const float cent[3], float rad, const float tmat[4][4], unsigned int pos); - /* Back-buffer select and draw support. */ void ED_view3d_backbuf_depth_validate(struct ViewContext *vc); int ED_view3d_backbuf_sample_size_clamp(struct ARegion *region, const float dist); @@ -609,12 +607,8 @@ bool ED_view3d_autodist_simple(struct ARegion *region, float mouse_worldloc[3], int margin, const float *force_depth); -bool ED_view3d_autodist_depth(struct ARegion *region, const int mval[2], int margin, float *depth); -bool ED_view3d_autodist_depth_seg(struct ARegion *region, - const int mval_sta[2], - const int mval_end[2], - int margin, - float *depth); +bool ED_view3d_depth_read_cached_seg( + const ViewDepths *vd, const int mval_sta[2], const int mval_end[2], int margin, float *depth); /* select */ #define MAXPICKELEMS 2500 diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 065b0a2d057..c587425c47f 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -27,6 +27,7 @@ #include "BLI_sys_types.h" /* size_t */ #include "BLI_utildefines.h" #include "UI_interface_icons.h" +#include "WM_types.h" #ifdef __cplusplus extern "C" { @@ -244,10 +245,10 @@ enum { }; /* Default font size for normal text. */ -#define UI_DEFAULT_TEXT_POINTS 11 +#define UI_DEFAULT_TEXT_POINTS 11.0f /* Larger size used for title text. */ -#define UI_DEFAULT_TITLE_POINTS 11 +#define UI_DEFAULT_TITLE_POINTS 11.0f #define UI_PANEL_WIDTH 340 #define UI_COMPACT_PANEL_WIDTH 160 @@ -399,9 +400,8 @@ typedef enum { /** Resize handle (resize uilist). */ UI_BTYPE_GRIP = 57 << 9, UI_BTYPE_DECORATOR = 58 << 9, - UI_BTYPE_DATASETROW = 59 << 9, /* An item in a tree view. Parent items may be collapsible. */ - UI_BTYPE_TREEROW = 60 << 9, + UI_BTYPE_TREEROW = 59 << 9, } eButType; #define BUTTYPE (63 << 9) @@ -691,7 +691,7 @@ void UI_popup_block_ex(struct bContext *C, void uiPupBlockOperator(struct bContext *C, uiBlockCreateFunc func, struct wmOperator *op, - int opcontext); + wmOperatorCallContext opcontext); #endif void UI_popup_block_close(struct bContext *C, struct wmWindow *win, uiBlock *block); @@ -731,8 +731,8 @@ bool UI_block_is_search_only(const uiBlock *block); void UI_block_set_search_only(uiBlock *block, bool search_only); void UI_block_free(const struct bContext *C, uiBlock *block); -void UI_blocklist_free(const struct bContext *C, struct ListBase *lb); -void UI_blocklist_free_inactive(const struct bContext *C, struct ListBase *lb); +void UI_blocklist_free(const struct bContext *C, struct ARegion *region); +void UI_blocklist_free_inactive(const struct bContext *C, struct ARegion *region); void UI_screen_free_active_but(const struct bContext *C, struct bScreen *screen); void UI_block_region_set(uiBlock *block, struct ARegion *region); @@ -1003,7 +1003,7 @@ uiBut *uiDefButR_prop(uiBlock *block, uiBut *uiDefButO(uiBlock *block, int type, const char *opname, - int opcontext, + wmOperatorCallContext opcontext, const char *str, int x, int y, @@ -1013,7 +1013,7 @@ uiBut *uiDefButO(uiBlock *block, uiBut *uiDefButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, - int opcontext, + wmOperatorCallContext opcontext, const char *str, int x, int y, @@ -1186,7 +1186,7 @@ uiBut *uiDefIconButR_prop(uiBlock *block, uiBut *uiDefIconButO(uiBlock *block, int type, const char *opname, - int opcontext, + wmOperatorCallContext opcontext, int icon, int x, int y, @@ -1196,7 +1196,7 @@ uiBut *uiDefIconButO(uiBlock *block, uiBut *uiDefIconButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, - int opcontext, + wmOperatorCallContext opcontext, int icon, int x, int y, @@ -1382,7 +1382,7 @@ uiBut *uiDefIconTextButR_prop(uiBlock *block, uiBut *uiDefIconTextButO(uiBlock *block, int type, const char *opname, - int opcontext, + wmOperatorCallContext opcontext, int icon, const char *str, int x, @@ -1393,7 +1393,7 @@ uiBut *uiDefIconTextButO(uiBlock *block, uiBut *uiDefIconTextButO_ptr(uiBlock *block, int type, struct wmOperatorType *ot, - int opcontext, + wmOperatorCallContext opcontext, int icon, const char *str, int x, @@ -1675,11 +1675,7 @@ int UI_searchbox_size_x(void); int UI_search_items_find_index(uiSearchItems *items, const char *name); void UI_but_hint_drawstr_set(uiBut *but, const char *string); -void UI_but_datasetrow_indentation_set(uiBut *but, int indentation); -void UI_but_datasetrow_component_set(uiBut *but, uint8_t geometry_component_type); -void UI_but_datasetrow_domain_set(uiBut *but, uint8_t attribute_domain); -uint8_t UI_but_datasetrow_component_get(uiBut *but); -uint8_t UI_but_datasetrow_domain_get(uiBut *but); + void UI_but_treerow_indentation_set(uiBut *but, int indentation); void UI_but_node_link_set(uiBut *but, struct bNodeSocket *socket, const float draw_color[4]); @@ -1724,7 +1720,7 @@ void UI_but_func_pushed_state_set(uiBut *but, uiButPushedStateFunc func, const v struct PointerRNA *UI_but_extra_operator_icon_add(uiBut *but, const char *opname, - short opcontext, + wmOperatorCallContext opcontext, int icon); struct wmOperatorType *UI_but_extra_operator_icon_optype_get(struct uiButExtraOpIcon *extra_icon); struct PointerRNA *UI_but_extra_operator_icon_opptr_get(struct uiButExtraOpIcon *extra_icon); @@ -1964,7 +1960,7 @@ void UI_paneltype_draw(struct bContext *C, struct PanelType *pt, struct uiLayout /* Only for convenience. */ void uiLayoutSetContextFromBut(uiLayout *layout, uiBut *but); -void uiLayoutSetOperatorContext(uiLayout *layout, int opcontext); +void uiLayoutSetOperatorContext(uiLayout *layout, wmOperatorCallContext opcontext); void uiLayoutSetActive(uiLayout *layout, bool active); void uiLayoutSetActiveDefault(uiLayout *layout, bool active_default); void uiLayoutSetActivateInit(uiLayout *layout, bool activate_init); @@ -2392,7 +2388,7 @@ void uiItemFullO_ptr(uiLayout *layout, const char *name, int icon, struct IDProperty *properties, - int context, + wmOperatorCallContext context, int flag, struct PointerRNA *r_opptr); void uiItemFullO(uiLayout *layout, @@ -2400,7 +2396,7 @@ void uiItemFullO(uiLayout *layout, const char *name, int icon, struct IDProperty *properties, - int context, + wmOperatorCallContext context, int flag, struct PointerRNA *r_opptr); void uiItemFullOMenuHold_ptr(uiLayout *layout, @@ -2408,7 +2404,7 @@ void uiItemFullOMenuHold_ptr(uiLayout *layout, const char *name, int icon, struct IDProperty *properties, - int context, + wmOperatorCallContext context, int flag, const char *menu_id, /* extra menu arg. */ struct PointerRNA *r_opptr); @@ -2488,14 +2484,14 @@ void uiItemsFullEnumO(uiLayout *layout, const char *opname, const char *propname, struct IDProperty *properties, - int context, + wmOperatorCallContext context, int flag); void uiItemsFullEnumO_items(uiLayout *layout, struct wmOperatorType *ot, struct PointerRNA ptr, struct PropertyRNA *prop, struct IDProperty *properties, - int context, + wmOperatorCallContext context, int flag, const struct EnumPropertyItem *item_array, int totitem); diff --git a/source/blender/editors/include/UI_tree_view.hh b/source/blender/editors/include/UI_tree_view.hh index 0d18eedeac9..8caf17741a7 100644 --- a/source/blender/editors/include/UI_tree_view.hh +++ b/source/blender/editors/include/UI_tree_view.hh @@ -217,15 +217,11 @@ class AbstractTreeViewItem : public TreeViewItemContainer { friend class TreeViewLayoutBuilder; public: - using IsActiveFn = std::function<bool()>; - private: bool is_open_ = false; bool is_active_ = false; bool is_renaming_ = false; - IsActiveFn is_active_fn_; - protected: /** This label is used for identifying an item (together with its parent's labels). */ std::string label_{}; @@ -239,11 +235,6 @@ class AbstractTreeViewItem : public TreeViewItemContainer { virtual void build_context_menu(bContext &C, uiLayout &column) const; virtual void on_activate(); - /** - * Set a custom callback to check if this item should be active. There's a version without - * arguments for checking if the item is currently in an active state. - */ - virtual void is_active(IsActiveFn is_active_fn); /** * Queries if the tree-view item supports renaming in principle. Renaming may still fail, e.g. if @@ -329,6 +320,17 @@ class AbstractTreeViewItem : public TreeViewItemContainer { */ void activate(); + /** + * If the result is not empty, it controls whether the item should be active or not, + * usually depending on the data that the view represents. + */ + virtual std::optional<bool> should_be_active() const; + + /** + * Return whether the item can be collapsed. Used to disable collapsing for items with children. + */ + virtual bool supports_collapsing() const; + private: static void rename_button_fn(bContext *, void *, char *); static AbstractTreeViewItem *find_tree_item_from_rename_button(const uiBut &but); @@ -416,6 +418,7 @@ class AbstractTreeViewItemDropController { */ class BasicTreeViewItem : public AbstractTreeViewItem { public: + using IsActiveFn = std::function<bool()>; using ActivateFn = std::function<void(BasicTreeViewItem &new_active)>; BIFIconID icon; @@ -423,7 +426,11 @@ class BasicTreeViewItem : public AbstractTreeViewItem { void build_row(uiLayout &row) override; void add_label(uiLayout &layout, StringRefNull label_override = ""); - void on_activate(ActivateFn fn); + void set_on_activate_fn(ActivateFn fn); + /** + * Set a custom callback to check if this item should be active. + */ + void set_is_active_fn(IsActiveFn fn); protected: /** @@ -433,9 +440,12 @@ class BasicTreeViewItem : public AbstractTreeViewItem { */ ActivateFn activate_fn_; + IsActiveFn is_active_fn_; + private: static void tree_row_click_fn(struct bContext *C, void *arg1, void *arg2); + std::optional<bool> should_be_active() const override; void on_activate() override; }; |