Cleanup: Remove more struct keywords from C++ headers

This commit is contained in:
Hans Goudey
2023-08-04 22:47:22 -04:00
parent 7e06454663
commit 07019e7ef5
36 changed files with 341 additions and 393 deletions

View File

@@ -640,9 +640,7 @@ void *BKE_grease_pencil_add(Main *bmain, const char *name);
GreasePencil *BKE_grease_pencil_new_nomain();
GreasePencil *BKE_grease_pencil_copy_for_eval(const GreasePencil *grease_pencil_src);
BoundBox *BKE_grease_pencil_boundbox_get(Object *ob);
void BKE_grease_pencil_data_update(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *object);
void BKE_grease_pencil_data_update(Depsgraph *depsgraph, Scene *scene, Object *object);
int BKE_grease_pencil_object_material_index_get_by_name(Object *ob, const char *name);
Material *BKE_grease_pencil_object_material_new(Main *bmain,

View File

@@ -34,7 +34,7 @@ struct MeshPairRemap {
int items_num;
MeshPairRemapItem *items; /* Array, one item per destination element. */
struct MemArena *mem; /* memory arena, internal use only. */
MemArena *mem; /* memory arena, internal use only. */
};
/* Helpers! */

View File

@@ -111,7 +111,7 @@ class bNodeTreeRuntime : NonCopyable, NonMovable {
* Execution data is generated from the tree once at execution start and can then be used
* as long as necessary, even while the tree is being modified.
*/
struct bNodeTreeExec *execdata = nullptr;
bNodeTreeExec *execdata = nullptr;
/* Callbacks. */
void (*progress)(void *, float progress) = nullptr;
@@ -244,7 +244,7 @@ class bNodeRuntime : NonCopyable, NonMovable {
uint8_t need_exec = 0;
/** The original node in the tree (for localized tree). */
struct bNode *original = nullptr;
bNode *original = nullptr;
/**
* XXX TODO

View File

@@ -227,8 +227,8 @@ bool BKE_subdiv_settings_equal(const SubdivSettings *settings_a, const SubdivSet
/* Construct new subdivision surface descriptor, from scratch, using given
* settings and topology. */
Subdiv *BKE_subdiv_new_from_converter(const SubdivSettings *settings,
struct OpenSubdiv_Converter *converter);
Subdiv *BKE_subdiv_new_from_mesh(const SubdivSettings *settings, const struct Mesh *mesh);
OpenSubdiv_Converter *converter);
Subdiv *BKE_subdiv_new_from_mesh(const SubdivSettings *settings, const Mesh *mesh);
/* Similar to above, but will not re-create descriptor if it was created for the
* same settings and topology.
@@ -240,10 +240,10 @@ Subdiv *BKE_subdiv_new_from_mesh(const SubdivSettings *settings, const struct Me
*/
Subdiv *BKE_subdiv_update_from_converter(Subdiv *subdiv,
const SubdivSettings *settings,
struct OpenSubdiv_Converter *converter);
OpenSubdiv_Converter *converter);
Subdiv *BKE_subdiv_update_from_mesh(Subdiv *subdiv,
const SubdivSettings *settings,
const struct Mesh *mesh);
const Mesh *mesh);
void BKE_subdiv_free(Subdiv *subdiv);
@@ -252,8 +252,8 @@ void BKE_subdiv_free(Subdiv *subdiv);
*/
void BKE_subdiv_displacement_attach_from_multires(Subdiv *subdiv,
struct Mesh *mesh,
const struct MultiresModifierData *mmd);
Mesh *mesh,
const MultiresModifierData *mmd);
void BKE_subdiv_displacement_detach(Subdiv *subdiv);

View File

@@ -99,14 +99,14 @@ struct SubdivCCGAdjacentEdge {
int num_adjacent_faces;
/* Indexed by adjacent face index, then by point index on the edge.
* points to a coordinate into the grids. */
struct SubdivCCGCoord **boundary_coords;
SubdivCCGCoord **boundary_coords;
};
/* Definition of a vertex which is adjacent to at least one of the faces. */
struct SubdivCCGAdjacentVertex {
int num_adjacent_faces;
/* Indexed by adjacent face index, points to a coordinate in the grids. */
struct SubdivCCGCoord *corner_coords;
SubdivCCGCoord *corner_coords;
};
/* Representation of subdivision surface which uses CCG grids. */

View File

@@ -80,7 +80,7 @@ struct CCGDerivedMesh {
struct {
int startVert;
struct CCGVert *vert;
CCGVert *vert;
} * vertMap;
struct {
int startVert;

View File

@@ -39,10 +39,10 @@ struct OpenVDBMeshData {
}
};
struct Mesh *volume_to_mesh(const openvdb::GridBase &grid,
const VolumeToMeshResolution &resolution,
float threshold,
float adaptivity);
Mesh *volume_to_mesh(const openvdb::GridBase &grid,
const VolumeToMeshResolution &resolution,
float threshold,
float adaptivity);
/**
* Convert an OpenVDB volume grid to corresponding mesh data: vertex positions and quad and

View File

@@ -37,7 +37,7 @@ struct IrradianceGrid : public LightProbe, IrradianceGridData {
* already have been freed (along with its cache). It is only safe to dereference after the
* pruning have been done.
*/
const struct LightProbeObjectCache *cache = nullptr;
const LightProbeObjectCache *cache = nullptr;
/** List of associated atlas bricks that are used by this grid. */
Vector<IrradianceBrickPacked> bricks;
/** Index of the grid inside the grid UBO. */

View File

@@ -30,7 +30,7 @@ struct ImageUsage {
const void *last_image = nullptr;
ImageUsage() = default;
ImageUsage(const struct Image *image, const struct ImageUser *image_user, bool do_tile_drawing)
ImageUsage(const Image *image, const ImageUser *image_user, bool do_tile_drawing)
{
pass = image_user ? image_user->pass : 0;
layer = image_user ? image_user->layer : 0;

View File

@@ -33,7 +33,7 @@ void build_asset_view(uiLayout &layout,
const bContext &C,
ARegion &region);
void catalog_selector_panel_register(struct ARegionType *region_type);
void catalog_selector_panel_register(ARegionType *region_type);
AssetShelf *active_shelf_from_context(const bContext *C);
@@ -43,13 +43,11 @@ void send_redraw_notifier(const bContext &C);
* Deep-copies \a shelf_regiondata into newly allocated memory. Must be freed using
* #regiondata_free().
*/
struct RegionAssetShelf *regiondata_duplicate(const RegionAssetShelf *shelf_regiondata);
RegionAssetShelf *regiondata_duplicate(const RegionAssetShelf *shelf_regiondata);
/** Frees the contained data and \a shelf_regiondata itself. */
void regiondata_free(RegionAssetShelf **shelf_regiondata);
void regiondata_blend_write(struct BlendWriter *writer,
const struct RegionAssetShelf *shelf_regiondata);
void regiondata_blend_read_data(struct BlendDataReader *reader,
struct RegionAssetShelf **shelf_regiondata);
void regiondata_blend_write(BlendWriter *writer, const RegionAssetShelf *shelf_regiondata);
void regiondata_blend_read_data(BlendDataReader *reader, RegionAssetShelf **shelf_regiondata);
/**
* Frees the contained data, not \a shelf_settings itself.

View File

@@ -118,5 +118,5 @@ void ED_font_undosys_type(UndoType *ut);
#if 0
/* debug only */
void printknots(struct Object *obedit);
void printknots(Object *obedit);
#endif

View File

@@ -212,7 +212,7 @@ void ED_file_path_button(bScreen *screen,
/* FSMenuEntry's without paths indicate separators */
struct FSMenuEntry {
struct FSMenuEntry *next;
FSMenuEntry *next;
char *path;
char name[256]; /* FILE_MAXFILE */

View File

@@ -14,22 +14,23 @@
#include "DNA_scene_types.h"
/* initialize gizmos */
void ED_gizmotypes_arrow_3d(void);
void ED_gizmotypes_button_2d(void);
void ED_gizmotypes_cage_2d(void);
void ED_gizmotypes_cage_3d(void);
void ED_gizmotypes_dial_3d(void);
void ED_gizmotypes_move_3d(void);
void ED_gizmotypes_facemap_3d(void);
void ED_gizmotypes_preselect_3d(void);
void ED_gizmotypes_primitive_3d(void);
void ED_gizmotypes_blank_3d(void);
void ED_gizmotypes_snap_3d(void);
struct Object;
struct bContext;
struct wmGizmo;
struct SnapObjectContext;
/* initialize gizmos */
void ED_gizmotypes_arrow_3d();
void ED_gizmotypes_button_2d();
void ED_gizmotypes_cage_2d();
void ED_gizmotypes_cage_3d();
void ED_gizmotypes_dial_3d();
void ED_gizmotypes_move_3d();
void ED_gizmotypes_facemap_3d();
void ED_gizmotypes_preselect_3d();
void ED_gizmotypes_primitive_3d();
void ED_gizmotypes_blank_3d();
void ED_gizmotypes_snap_3d();
/* -------------------------------------------------------------------- */
/* Shape Presets
@@ -39,12 +40,9 @@ struct wmGizmo;
/* `gizmo_library_presets.cc` */
void ED_gizmo_draw_preset_box(const struct wmGizmo *gz, const float mat[4][4], int select_id);
void ED_gizmo_draw_preset_arrow(const struct wmGizmo *gz,
const float mat[4][4],
int axis,
int select_id);
void ED_gizmo_draw_preset_circle(const struct wmGizmo *gz,
void ED_gizmo_draw_preset_box(const wmGizmo *gz, const float mat[4][4], int select_id);
void ED_gizmo_draw_preset_arrow(const wmGizmo *gz, const float mat[4][4], int axis, int select_id);
void ED_gizmo_draw_preset_circle(const wmGizmo *gz,
const float mat[4][4],
int axis,
int select_id);
@@ -80,13 +78,13 @@ enum {
*
* \note Needs to be called before #WM_gizmo_target_property_def_rna!
*/
void ED_gizmo_arrow3d_set_ui_range(struct wmGizmo *gz, float min, float max);
void ED_gizmo_arrow3d_set_ui_range(wmGizmo *gz, float min, float max);
/**
* Define a custom factor for arrow min/max distance.
*
* \note Needs to be called before #WM_gizmo_target_property_def_rna!
*/
void ED_gizmo_arrow3d_set_range_fac(struct wmGizmo *gz, float range_fac);
void ED_gizmo_arrow3d_set_range_fac(wmGizmo *gz, float range_fac);
/* -------------------------------------------------------------------- */
/* Cage Gizmo */
@@ -237,15 +235,14 @@ enum {
/* `snap3d_gizmo.cc` */
struct SnapObjectContext *ED_gizmotypes_snap_3d_context_ensure(struct Scene *scene,
struct wmGizmo *gz);
SnapObjectContext *ED_gizmotypes_snap_3d_context_ensure(Scene *scene, wmGizmo *gz);
void ED_gizmotypes_snap_3d_flag_set(struct wmGizmo *gz, int flag);
void ED_gizmotypes_snap_3d_flag_set(wmGizmo *gz, int flag);
bool ED_gizmotypes_snap_3d_is_enabled(const struct wmGizmo *gz);
bool ED_gizmotypes_snap_3d_is_enabled(const wmGizmo *gz);
void ED_gizmotypes_snap_3d_data_get(const struct bContext *C,
struct wmGizmo *gz,
void ED_gizmotypes_snap_3d_data_get(const bContext *C,
wmGizmo *gz,
float r_loc[3],
float r_nor[3],
int r_elem_index[3],

View File

@@ -161,7 +161,7 @@ ENUM_OPERATORS(eKeyframeIterFlags, KEYFRAME_ITER_HANDLES_DEFAULT_INVISIBLE)
* Used for example by `columnselect_action_keys` to select all keyframes in a column.
*/
struct CfraElem {
struct CfraElem *next, *prev;
CfraElem *next, *prev;
float cfra;
int sel;
};
@@ -171,7 +171,7 @@ struct KeyframeEditData {
/** temp list for storing custom list of data to check */
ListBase list;
/** pointer to current scene - many tools need access to cfra/etc. */
struct Scene *scene;
Scene *scene;
/** pointer to custom data - usually 'Object' but also 'rectf', but could be other types too */
void *data;
/** storage of times/values as 'decimals' */
@@ -181,7 +181,7 @@ struct KeyframeEditData {
/* current iteration data */
/** F-Curve that is being iterated over */
struct FCurve *fcu;
FCurve *fcu;
/** index of current keyframe being iterated over */
int curIndex;
/** y-position of midpoint of the channel (for the dopesheet) */
@@ -201,9 +201,9 @@ struct KeyframeEditData {
* \{ */
/* callback function that refreshes the F-Curve after use */
using FcuEditFunc = void (*)(struct FCurve *fcu);
using FcuEditFunc = void (*)(FCurve *fcu);
/* callback function that operates on the given BezTriple */
using KeyframeEditFunc = short (*)(KeyframeEditData *ked, struct BezTriple *bezt);
using KeyframeEditFunc = short (*)(KeyframeEditData *ked, BezTriple *bezt);
/** \} */

View File

@@ -333,7 +333,7 @@ bool EDBM_selectmode_disable_multi(bContext *C,
/* `editmesh_preselect_edgering.cc` */
struct EditMesh_PreSelEdgeRing;
struct EditMesh_PreSelEdgeRing *EDBM_preselect_edgering_create();
EditMesh_PreSelEdgeRing *EDBM_preselect_edgering_create();
void EDBM_preselect_edgering_destroy(EditMesh_PreSelEdgeRing *psel);
void EDBM_preselect_edgering_clear(EditMesh_PreSelEdgeRing *psel);
void EDBM_preselect_edgering_draw(EditMesh_PreSelEdgeRing *psel, const float matrix[4][4]);

View File

@@ -21,6 +21,7 @@
#include "BLI_compiler_attrs.h"
struct ARegion;
struct AZone;
struct Depsgraph;
struct IDProperty;
struct Main;
@@ -47,143 +48,133 @@ struct wmWindowManager;
/* regions */
/** Only exported for WM. */
void ED_region_do_listen(struct wmRegionListenerParams *params);
void ED_region_do_listen(wmRegionListenerParams *params);
/** Only exported for WM. */
void ED_region_do_layout(struct bContext *C, struct ARegion *region);
void ED_region_do_layout(bContext *C, ARegion *region);
/** Only exported for WM. */
void ED_region_do_draw(struct bContext *C, struct ARegion *region);
void ED_region_exit(struct bContext *C, struct ARegion *region);
void ED_region_do_draw(bContext *C, ARegion *region);
void ED_region_exit(bContext *C, ARegion *region);
/**
* Utility to exit and free an area-region. Screen level regions (menus/popups) need to be treated
* slightly differently, see #ui_region_temp_remove().
*/
void ED_region_remove(struct bContext *C, struct ScrArea *area, struct ARegion *region);
void ED_region_pixelspace(const struct ARegion *region);
void ED_region_remove(bContext *C, ScrArea *area, ARegion *region);
void ED_region_pixelspace(const ARegion *region);
/**
* Call to move a popup window (keep OpenGL context free!)
*/
void ED_region_update_rect(struct ARegion *region);
void ED_region_update_rect(ARegion *region);
/**
* Externally called for floating regions like menus.
*/
void ED_region_floating_init(struct ARegion *region);
void ED_region_tag_redraw(struct ARegion *region);
void ED_region_tag_redraw_partial(struct ARegion *region, const struct rcti *rct, bool rebuild);
void ED_region_tag_redraw_cursor(struct ARegion *region);
void ED_region_tag_redraw_no_rebuild(struct ARegion *region);
void ED_region_tag_refresh_ui(struct ARegion *region);
void ED_region_floating_init(ARegion *region);
void ED_region_tag_redraw(ARegion *region);
void ED_region_tag_redraw_partial(ARegion *region, const rcti *rct, bool rebuild);
void ED_region_tag_redraw_cursor(ARegion *region);
void ED_region_tag_redraw_no_rebuild(ARegion *region);
void ED_region_tag_refresh_ui(ARegion *region);
/**
* Tag editor overlays to be redrawn. If in doubt about which parts need to be redrawn (partial
* clipping rectangle set), redraw everything.
*/
void ED_region_tag_redraw_editor_overlays(struct ARegion *region);
void ED_region_tag_redraw_editor_overlays(ARegion *region);
/**
* Set the temporary update flag for property search.
*/
void ED_region_search_filter_update(const struct ScrArea *area, struct ARegion *region);
void ED_region_search_filter_update(const ScrArea *area, ARegion *region);
/**
* Returns the search string if the space type and region type support property search.
*/
const char *ED_area_region_search_filter_get(const struct ScrArea *area,
const struct ARegion *region);
const char *ED_area_region_search_filter_get(const ScrArea *area, const ARegion *region);
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region);
void ED_region_panels_ex(const struct bContext *C, struct ARegion *region, const char *contexts[]);
void ED_region_panels(const struct bContext *C, struct ARegion *region);
void ED_region_panels_init(wmWindowManager *wm, ARegion *region);
void ED_region_panels_ex(const bContext *C, ARegion *region, const char *contexts[]);
void ED_region_panels(const bContext *C, ARegion *region);
/**
* \param contexts: A NULL terminated array of context strings to match against.
* Matching against any of these strings will draw the panel.
* Can be NULL to skip context checks.
*/
void ED_region_panels_layout_ex(const struct bContext *C,
struct ARegion *region,
struct ListBase *paneltypes,
void ED_region_panels_layout_ex(const bContext *C,
ARegion *region,
ListBase *paneltypes,
const char *contexts[],
const char *category_override);
/**
* Build the same panel list as #ED_region_panels_layout_ex and checks whether any
* of the panels contain a search result based on the area / region's search filter.
*/
bool ED_region_property_search(const struct bContext *C,
struct ARegion *region,
struct ListBase *paneltypes,
bool ED_region_property_search(const bContext *C,
ARegion *region,
ListBase *paneltypes,
const char *contexts[],
const char *category_override);
void ED_region_panels_layout(const struct bContext *C, struct ARegion *region);
void ED_region_panels_draw(const struct bContext *C, struct ARegion *region);
void ED_region_panels_layout(const bContext *C, ARegion *region);
void ED_region_panels_draw(const bContext *C, ARegion *region);
void ED_region_header_init(struct ARegion *region);
void ED_region_header(const struct bContext *C, struct ARegion *region);
void ED_region_header_layout(const struct bContext *C, struct ARegion *region);
void ED_region_header_draw(const struct bContext *C, struct ARegion *region);
void ED_region_header_init(ARegion *region);
void ED_region_header(const bContext *C, ARegion *region);
void ED_region_header_layout(const bContext *C, ARegion *region);
void ED_region_header_draw(const bContext *C, ARegion *region);
void ED_region_cursor_set(struct wmWindow *win, struct ScrArea *area, struct ARegion *region);
void ED_region_cursor_set(wmWindow *win, ScrArea *area, ARegion *region);
/**
* Exported to all editors, uses fading default.
*/
void ED_region_toggle_hidden(struct bContext *C, struct ARegion *region);
void ED_region_toggle_hidden(bContext *C, ARegion *region);
/**
* For use after changing visibility of regions.
*/
void ED_region_visibility_change_update(struct bContext *C,
struct ScrArea *area,
struct ARegion *region);
void ED_region_visibility_change_update(bContext *C, ScrArea *area, ARegion *region);
/* `screen_ops.cc` */
/**
* \note Assumes that \a region itself is not a split version from previous region.
*/
void ED_region_visibility_change_update_animated(struct bContext *C,
struct ScrArea *area,
struct ARegion *region);
void ED_region_visibility_change_update_animated(bContext *C, ScrArea *area, ARegion *region);
void ED_region_clear(const struct bContext *C,
const struct ARegion *region,
int /*ThemeColorID*/ colorid);
void ED_region_clear(const bContext *C, const ARegion *region, int /*ThemeColorID*/ colorid);
void ED_region_info_draw(struct ARegion *region,
const char *text,
float fill_color[4],
bool full_redraw);
void ED_region_info_draw(ARegion *region, const char *text, float fill_color[4], bool full_redraw);
void ED_region_info_draw_multiline(ARegion *region,
const char *text_array[],
float fill_color[4],
bool full_redraw);
void ED_region_image_metadata_panel_draw(struct ImBuf *ibuf, struct uiLayout *layout);
void ED_region_grid_draw(struct ARegion *region, float zoomx, float zoomy, float x0, float y0);
float ED_region_blend_alpha(struct ARegion *region);
void ED_region_visible_rect_calc(struct ARegion *region, struct rcti *rect);
void ED_region_image_metadata_panel_draw(ImBuf *ibuf, uiLayout *layout);
void ED_region_grid_draw(ARegion *region, float zoomx, float zoomy, float x0, float y0);
float ED_region_blend_alpha(ARegion *region);
void ED_region_visible_rect_calc(ARegion *region, rcti *rect);
const rcti *ED_region_visible_rect(ARegion *region);
/**
* Overlapping regions only in the following restricted cases.
*/
bool ED_region_is_overlap(int spacetype, int regiontype);
int ED_region_snap_size_test(const struct ARegion *region);
bool ED_region_snap_size_apply(struct ARegion *region, int snap_flag);
int ED_region_snap_size_test(const ARegion *region);
bool ED_region_snap_size_apply(ARegion *region, int snap_flag);
/* message_bus callbacks */
void ED_region_do_msg_notify_tag_redraw(struct bContext *C,
struct wmMsgSubscribeKey *msg_key,
struct wmMsgSubscribeValue *msg_val);
void ED_area_do_msg_notify_tag_refresh(struct bContext *C,
struct wmMsgSubscribeKey *msg_key,
struct wmMsgSubscribeValue *msg_val);
void ED_region_do_msg_notify_tag_redraw(bContext *C,
wmMsgSubscribeKey *msg_key,
wmMsgSubscribeValue *msg_val);
void ED_area_do_msg_notify_tag_refresh(bContext *C,
wmMsgSubscribeKey *msg_key,
wmMsgSubscribeValue *msg_val);
/**
* Follow #ARegionType.message_subscribe.
*/
void ED_area_do_mgs_subscribe_for_tool_header(const struct wmRegionMessageSubscribeParams *params);
void ED_area_do_mgs_subscribe_for_tool_ui(const struct wmRegionMessageSubscribeParams *params);
void ED_area_do_mgs_subscribe_for_tool_header(const wmRegionMessageSubscribeParams *params);
void ED_area_do_mgs_subscribe_for_tool_ui(const wmRegionMessageSubscribeParams *params);
/* message bus */
/**
* Generate subscriptions for this region.
*/
void ED_region_message_subscribe(struct wmRegionMessageSubscribeParams *params);
void ED_region_message_subscribe(wmRegionMessageSubscribeParams *params);
/* spaces */
@@ -191,23 +182,23 @@ void ED_region_message_subscribe(struct wmRegionMessageSubscribeParams *params);
* \note Keymap definitions are registered only once per WM initialize,
* usually on file read, using the keymap the actual areas/regions add the handlers.
* \note Called in `wm.cc`. */
void ED_spacetypes_keymap(struct wmKeyConfig *keyconf);
void ED_spacetypes_keymap(wmKeyConfig *keyconf);
/**
* Returns offset for next button in header.
*/
int ED_area_header_switchbutton(const struct bContext *C, struct uiBlock *block, int yco);
int ED_area_header_switchbutton(const bContext *C, uiBlock *block, int yco);
/* areas */
/**
* Called in screen_refresh, or screens_init, also area size changes.
*/
void ED_area_init(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area);
void ED_area_exit(struct bContext *C, struct ScrArea *area);
int ED_screen_area_active(const struct bContext *C);
void ED_screen_global_areas_refresh(struct wmWindow *win);
void ED_screen_global_areas_sync(struct wmWindow *win);
void ED_area_init(wmWindowManager *wm, wmWindow *win, ScrArea *area);
void ED_area_exit(bContext *C, ScrArea *area);
int ED_screen_area_active(const bContext *C);
void ED_screen_global_areas_refresh(wmWindow *win);
void ED_screen_global_areas_sync(wmWindow *win);
/** Only exported for WM. */
void ED_area_do_listen(struct wmSpaceTypeListenerParams *params);
void ED_area_do_listen(wmSpaceTypeListenerParams *params);
void ED_area_tag_redraw(ScrArea *area);
void ED_area_tag_redraw_no_rebuild(ScrArea *area);
void ED_area_tag_redraw_regiontype(ScrArea *area, int type);
@@ -220,8 +211,8 @@ void ED_area_tag_region_size_update(ScrArea *area, ARegion *changed_region);
/**
* Only exported for WM.
*/
void ED_area_do_refresh(struct bContext *C, ScrArea *area);
struct AZone *ED_area_azones_update(ScrArea *area, const int mouse_xy[2]);
void ED_area_do_refresh(bContext *C, ScrArea *area);
AZone *ED_area_azones_update(ScrArea *area, const int mouse_xy[2]);
/**
* Show the given text in the area's header, instead of its regular contents.
* Use NULL to disable this and show the regular header contents again.
@@ -230,9 +221,9 @@ void ED_area_status_text(ScrArea *area, const char *str);
/**
* \param skip_region_exit: Skip calling area exit callback. Set for opening temp spaces.
*/
void ED_area_newspace(struct bContext *C, ScrArea *area, int type, bool skip_region_exit);
void ED_area_prevspace(struct bContext *C, ScrArea *area);
void ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2);
void ED_area_newspace(bContext *C, ScrArea *area, int type, bool skip_region_exit);
void ED_area_prevspace(bContext *C, ScrArea *area);
void ED_area_swapspace(bContext *C, ScrArea *sa1, ScrArea *sa2);
int ED_area_headersize();
int ED_area_footersize();
/**
@@ -249,22 +240,18 @@ bool ED_area_is_global(const ScrArea *area);
* \return the DPI aware height of a single bar/region in global areas.
*/
int ED_region_global_size_y();
void ED_area_update_region_sizes(struct wmWindowManager *wm,
struct wmWindow *win,
struct ScrArea *area);
bool ED_area_has_shared_border(struct ScrArea *a, struct ScrArea *b);
ScrArea *ED_area_offscreen_create(struct wmWindow *win, eSpace_Type space_type);
void ED_area_offscreen_free(struct wmWindowManager *wm,
struct wmWindow *win,
struct ScrArea *area);
void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *area);
bool ED_area_has_shared_border(ScrArea *a, ScrArea *b);
ScrArea *ED_area_offscreen_create(wmWindow *win, eSpace_Type space_type);
void ED_area_offscreen_free(wmWindowManager *wm, wmWindow *win, ScrArea *area);
/**
* Search all screens, even non-active or overlapping (multiple windows), return the most-likely
* area of interest. xy is relative to active window, like all similar functions.
*/
ScrArea *ED_area_find_under_cursor(const struct bContext *C, int spacetype, const int xy[2]);
ScrArea *ED_area_find_under_cursor(const bContext *C, int spacetype, const int xy[2]);
ScrArea *ED_screen_areas_iter_first(const struct wmWindow *win, const bScreen *screen);
ScrArea *ED_screen_areas_iter_first(const wmWindow *win, const bScreen *screen);
ScrArea *ED_screen_areas_iter_next(const bScreen *screen, const ScrArea *area);
/**
* Iterate over all areas visible in the screen (screen as in everything
@@ -288,22 +275,19 @@ ScrArea *ED_screen_areas_iter_next(const bScreen *screen, const ScrArea *area);
/**
* File read, set all screens, ....
*/
void ED_screens_init(struct Main *bmain, struct wmWindowManager *wm);
void ED_screens_init(Main *bmain, wmWindowManager *wm);
/**
* Only for edge lines between areas.
*/
void ED_screen_draw_edges(struct wmWindow *win);
void ED_screen_draw_edges(wmWindow *win);
/**
* Make this screen usable.
* for file read and first use, for scaling window, area moves.
*/
void ED_screen_refresh(struct wmWindowManager *wm, struct wmWindow *win);
void ED_screen_ensure_updated(struct bContext *C,
struct wmWindowManager *wm,
struct wmWindow *win,
struct bScreen *screen);
void ED_screen_do_listen(struct bContext *C, const struct wmNotifier *note);
void ED_screen_refresh(wmWindowManager *wm, wmWindow *win);
void ED_screen_ensure_updated(bContext *C, wmWindowManager *wm, wmWindow *win, bScreen *screen);
void ED_screen_do_listen(bContext *C, const wmNotifier *note);
/**
* \brief Change the active screen.
*
@@ -312,33 +296,30 @@ void ED_screen_do_listen(struct bContext *C, const struct wmNotifier *note);
* \warning Do NOT call in area/region queues!
* \returns if screen changing was successful.
*/
bool ED_screen_change(struct bContext *C, struct bScreen *screen);
void ED_screen_scene_change(struct bContext *C,
struct wmWindow *win,
struct Scene *scene,
bool refresh_toolsystem);
bool ED_screen_change(bContext *C, bScreen *screen);
void ED_screen_scene_change(bContext *C, wmWindow *win, Scene *scene, bool refresh_toolsystem);
/**
* Called in `wm_event_system.cc`. sets state vars in screen, cursors.
* event type is mouse move.
*/
void ED_screen_set_active_region(struct bContext *C, struct wmWindow *win, const int xy[2]);
void ED_screen_exit(struct bContext *C, struct wmWindow *window, struct bScreen *screen);
void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]);
void ED_screen_exit(bContext *C, wmWindow *window, bScreen *screen);
/**
* redraws: uses defines from `stime->redraws`
* \param enable: 1 - forward on, -1 - backwards on, 0 - off.
*/
void ED_screen_animation_timer(struct bContext *C, int redraws, int sync, int enable);
void ED_screen_animation_timer_update(struct bScreen *screen, int redraws);
void ED_screen_restore_temp_type(struct bContext *C, ScrArea *area);
ScrArea *ED_screen_full_newspace(struct bContext *C, ScrArea *area, int type);
void ED_screen_animation_timer(bContext *C, int redraws, int sync, int enable);
void ED_screen_animation_timer_update(bScreen *screen, int redraws);
void ED_screen_restore_temp_type(bContext *C, ScrArea *area);
ScrArea *ED_screen_full_newspace(bContext *C, ScrArea *area, int type);
/**
* \a was_prev_temp for the case previous space was a temporary full-screen as well
*/
void ED_screen_full_prevspace(struct bContext *C, ScrArea *area);
void ED_screen_full_prevspace(bContext *C, ScrArea *area);
/**
* Restore a screen / area back to default operation, after temp full-screen modes.
*/
void ED_screen_full_restore(struct bContext *C, ScrArea *area);
void ED_screen_full_restore(bContext *C, ScrArea *area);
/**
* Create a new temporary screen with a maximized, empty area.
* This can be closed with #ED_screen_state_toggle().
@@ -346,7 +327,7 @@ void ED_screen_full_restore(struct bContext *C, ScrArea *area);
* Use this to just create a new maximized screen/area, rather than maximizing an existing one.
* Otherwise, maximize with #ED_screen_state_toggle().
*/
bScreen *ED_screen_state_maximized_create(struct bContext *C);
bScreen *ED_screen_state_maximized_create(bContext *C);
/**
* This function toggles: if area is maximized/full then the parent will be restored.
*
@@ -357,10 +338,7 @@ bScreen *ED_screen_state_maximized_create(struct bContext *C);
*
* \warning \a area may be freed.
*/
struct ScrArea *ED_screen_state_toggle(struct bContext *C,
struct wmWindow *win,
struct ScrArea *area,
short state);
ScrArea *ED_screen_state_toggle(bContext *C, wmWindow *win, ScrArea *area, short state);
/**
* Wrapper to open a temporary space either as full-screen space, or as separate window,
* as defined by \a display_type.
@@ -368,36 +346,35 @@ struct ScrArea *ED_screen_state_toggle(struct bContext *C,
* \param title: Title to set for the window, if a window is spawned.
* \param rect_unscaled: Position & size of the window, if a window is spawned.
*/
ScrArea *ED_screen_temp_space_open(struct bContext *C,
ScrArea *ED_screen_temp_space_open(bContext *C,
const char *title,
const struct rcti *rect_unscaled,
const rcti *rect_unscaled,
eSpace_Type space_type,
int display_type,
bool dialog) ATTR_NONNULL(1, 2, 3);
void ED_screens_header_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg);
void ED_screens_footer_tools_menu_create(struct bContext *C, struct uiLayout *layout, void *arg);
void ED_screens_region_flip_menu_create(struct bContext *C, struct uiLayout *layout, void *arg);
void ED_screens_header_tools_menu_create(bContext *C, uiLayout *layout, void *arg);
void ED_screens_footer_tools_menu_create(bContext *C, uiLayout *layout, void *arg);
void ED_screens_region_flip_menu_create(bContext *C, uiLayout *layout, void *arg);
/**
* \return true if any active area requires to see in 3D.
*/
bool ED_screen_stereo3d_required(const struct bScreen *screen, const struct Scene *scene);
Scene *ED_screen_scene_find(const struct bScreen *screen, const struct wmWindowManager *wm);
bool ED_screen_stereo3d_required(const bScreen *screen, const Scene *scene);
Scene *ED_screen_scene_find(const bScreen *screen, const wmWindowManager *wm);
/**
* Find the scene displayed in \a screen.
* \note Assumes \a screen to be visible/active!
*/
Scene *ED_screen_scene_find_with_window(const struct bScreen *screen,
const struct wmWindowManager *wm,
struct wmWindow **r_window);
Scene *ED_screen_scene_find_with_window(const bScreen *screen,
const wmWindowManager *wm,
wmWindow **r_window);
ScrArea *ED_screen_area_find_with_spacedata(const bScreen *screen,
const struct SpaceLink *sl,
const SpaceLink *sl,
bool only_visible);
struct wmWindow *ED_screen_window_find(const struct bScreen *screen,
const struct wmWindowManager *wm);
wmWindow *ED_screen_window_find(const bScreen *screen, const wmWindowManager *wm);
/* workspaces */
struct WorkSpace *ED_workspace_add(struct Main *bmain, const char *name) ATTR_NONNULL();
WorkSpace *ED_workspace_add(Main *bmain, const char *name) ATTR_NONNULL();
/**
* \brief Change the active workspace.
*
@@ -407,91 +384,83 @@ struct WorkSpace *ED_workspace_add(struct Main *bmain, const char *name) ATTR_NO
* \warning Do NOT call in area/region queues!
* \returns if workspace changing was successful.
*/
bool ED_workspace_change(struct WorkSpace *workspace_new,
struct bContext *C,
struct wmWindowManager *wm,
struct wmWindow *win) ATTR_NONNULL();
bool ED_workspace_change(WorkSpace *workspace_new, bContext *C, wmWindowManager *wm, wmWindow *win)
ATTR_NONNULL();
/**
* Duplicate a workspace including its layouts. Does not activate the workspace, but
* it stores the screen-layout to be activated (BKE_workspace_temp_layout_store)
*/
struct WorkSpace *ED_workspace_duplicate(struct WorkSpace *workspace_old,
struct Main *bmain,
struct wmWindow *win);
WorkSpace *ED_workspace_duplicate(WorkSpace *workspace_old, Main *bmain, wmWindow *win);
/**
* \return if succeeded.
*/
bool ED_workspace_delete(struct WorkSpace *workspace,
struct Main *bmain,
struct bContext *C,
struct wmWindowManager *wm) ATTR_NONNULL();
bool ED_workspace_delete(WorkSpace *workspace, Main *bmain, bContext *C, wmWindowManager *wm)
ATTR_NONNULL();
/**
* Some editor data may need to be synced with scene data (3D View camera and layers).
* This function ensures data is synced for editors in active layout of \a workspace.
*/
void ED_workspace_scene_data_sync(struct WorkSpaceInstanceHook *hook, Scene *scene) ATTR_NONNULL();
void ED_workspace_scene_data_sync(WorkSpaceInstanceHook *hook, Scene *scene) ATTR_NONNULL();
/**
* Make sure there is a non-full-screen layout to switch to that isn't used yet by an other window.
* Needed for workspace or screen switching to ensure valid screens.
*
* \param layout_fallback_base: As last resort, this layout is duplicated and returned.
*/
struct WorkSpaceLayout *ED_workspace_screen_change_ensure_unused_layout(
struct Main *bmain,
struct WorkSpace *workspace,
struct WorkSpaceLayout *layout_new,
const struct WorkSpaceLayout *layout_fallback_base,
struct wmWindow *win) ATTR_NONNULL();
WorkSpaceLayout *ED_workspace_screen_change_ensure_unused_layout(
Main *bmain,
WorkSpace *workspace,
WorkSpaceLayout *layout_new,
const WorkSpaceLayout *layout_fallback_base,
wmWindow *win) ATTR_NONNULL();
/**
* Empty screen, with 1 dummy area without space-data. Uses window size.
*/
struct WorkSpaceLayout *ED_workspace_layout_add(struct Main *bmain,
struct WorkSpace *workspace,
struct wmWindow *win,
const char *name) ATTR_NONNULL();
struct WorkSpaceLayout *ED_workspace_layout_duplicate(struct Main *bmain,
struct WorkSpace *workspace,
const struct WorkSpaceLayout *layout_old,
struct wmWindow *win) ATTR_NONNULL();
WorkSpaceLayout *ED_workspace_layout_add(Main *bmain,
WorkSpace *workspace,
wmWindow *win,
const char *name) ATTR_NONNULL();
WorkSpaceLayout *ED_workspace_layout_duplicate(Main *bmain,
WorkSpace *workspace,
const WorkSpaceLayout *layout_old,
wmWindow *win) ATTR_NONNULL();
/**
* \warning Only call outside of area/region loops!
* \return true if succeeded.
*/
bool ED_workspace_layout_delete(struct WorkSpace *workspace,
struct WorkSpaceLayout *layout_old,
struct bContext *C) ATTR_NONNULL();
bool ED_workspace_layout_cycle(struct WorkSpace *workspace, short direction, struct bContext *C)
bool ED_workspace_layout_delete(WorkSpace *workspace, WorkSpaceLayout *layout_old, bContext *C)
ATTR_NONNULL();
bool ED_workspace_layout_cycle(WorkSpace *workspace, short direction, bContext *C) ATTR_NONNULL();
void ED_workspace_status_text(struct bContext *C, const char *str);
void ED_workspace_status_text(bContext *C, const char *str);
void ED_workspace_do_listen(struct bContext *C, const struct wmNotifier *note);
void ED_workspace_do_listen(bContext *C, const wmNotifier *note);
/* anim */
/**
* Results in fully updated anim system.
*/
void ED_update_for_newframe(struct Main *bmain, struct Depsgraph *depsgraph);
void ED_update_for_newframe(Main *bmain, Depsgraph *depsgraph);
/**
* Update frame rate info for viewport drawing.
*/
void ED_refresh_viewport_fps(struct bContext *C);
void ED_refresh_viewport_fps(bContext *C);
/**
* Toggle operator.
*/
int ED_screen_animation_play(struct bContext *C, int sync, int mode);
int ED_screen_animation_play(bContext *C, int sync, int mode);
/**
* Find window that owns the animation timer.
*/
bScreen *ED_screen_animation_playing(const struct wmWindowManager *wm);
bScreen *ED_screen_animation_no_scrub(const struct wmWindowManager *wm);
bScreen *ED_screen_animation_playing(const wmWindowManager *wm);
bScreen *ED_screen_animation_no_scrub(const wmWindowManager *wm);
/* screen keymaps */
/* called in spacetypes.cc */
void ED_operatortypes_screen();
/* called in spacetypes.cc */
void ED_keymap_screen(struct wmKeyConfig *keyconf);
void ED_keymap_screen(wmKeyConfig *keyconf);
/**
* Workspace key-maps.
*/
@@ -499,109 +468,109 @@ void ED_operatortypes_workspace();
/* operators; context poll callbacks */
bool ED_operator_screenactive(struct bContext *C);
bool ED_operator_screenactive_nobackground(struct bContext *C);
bool ED_operator_screenactive(bContext *C);
bool ED_operator_screenactive_nobackground(bContext *C);
/**
* When mouse is over area-edge.
*/
bool ED_operator_screen_mainwinactive(struct bContext *C);
bool ED_operator_areaactive(struct bContext *C);
bool ED_operator_regionactive(struct bContext *C);
bool ED_operator_screen_mainwinactive(bContext *C);
bool ED_operator_areaactive(bContext *C);
bool ED_operator_regionactive(bContext *C);
bool ED_operator_scene(struct bContext *C);
bool ED_operator_scene_editable(struct bContext *C);
bool ED_operator_objectmode(struct bContext *C);
bool ED_operator_scene(bContext *C);
bool ED_operator_scene_editable(bContext *C);
bool ED_operator_objectmode(bContext *C);
/**
* Same as #ED_operator_objectmode() but additionally sets a "disabled hint". That is, a message
* to be displayed to the user explaining why the operator can't be used in current context.
*/
bool ED_operator_objectmode_poll_msg(struct bContext *C);
bool ED_operator_objectmode_with_view3d_poll_msg(struct bContext *C);
bool ED_operator_objectmode_poll_msg(bContext *C);
bool ED_operator_objectmode_with_view3d_poll_msg(bContext *C);
bool ED_operator_view3d_active(struct bContext *C);
bool ED_operator_region_view3d_active(struct bContext *C);
bool ED_operator_region_gizmo_active(struct bContext *C);
bool ED_operator_view3d_active(bContext *C);
bool ED_operator_region_view3d_active(bContext *C);
bool ED_operator_region_gizmo_active(bContext *C);
/**
* Generic for any view2d which uses anim_ops.
*/
bool ED_operator_animview_active(struct bContext *C);
bool ED_operator_outliner_active(struct bContext *C);
bool ED_operator_outliner_active_no_editobject(struct bContext *C);
bool ED_operator_animview_active(bContext *C);
bool ED_operator_outliner_active(bContext *C);
bool ED_operator_outliner_active_no_editobject(bContext *C);
/**
* \note Will return true for file spaces in either file or asset browsing mode! See
* #ED_operator_file_browsing_active() (file browsing only) and
* #ED_operator_asset_browsing_active() (asset browsing only).
*/
bool ED_operator_file_active(struct bContext *C);
bool ED_operator_file_active(bContext *C);
/**
* \note Will only return true if the file space is in file browsing mode, not asset browsing! See
* #ED_operator_file_active() (file or asset browsing) and
* #ED_operator_asset_browsing_active() (asset browsing only).
*/
bool ED_operator_file_browsing_active(struct bContext *C);
bool ED_operator_asset_browsing_active(struct bContext *C);
bool ED_operator_spreadsheet_active(struct bContext *C);
bool ED_operator_action_active(struct bContext *C);
bool ED_operator_buttons_active(struct bContext *C);
bool ED_operator_node_active(struct bContext *C);
bool ED_operator_node_editable(struct bContext *C);
bool ED_operator_graphedit_active(struct bContext *C);
bool ED_operator_sequencer_active(struct bContext *C);
bool ED_operator_sequencer_active_editable(struct bContext *C);
bool ED_operator_image_active(struct bContext *C);
bool ED_operator_nla_active(struct bContext *C);
bool ED_operator_info_active(struct bContext *C);
bool ED_operator_console_active(struct bContext *C);
bool ED_operator_file_browsing_active(bContext *C);
bool ED_operator_asset_browsing_active(bContext *C);
bool ED_operator_spreadsheet_active(bContext *C);
bool ED_operator_action_active(bContext *C);
bool ED_operator_buttons_active(bContext *C);
bool ED_operator_node_active(bContext *C);
bool ED_operator_node_editable(bContext *C);
bool ED_operator_graphedit_active(bContext *C);
bool ED_operator_sequencer_active(bContext *C);
bool ED_operator_sequencer_active_editable(bContext *C);
bool ED_operator_image_active(bContext *C);
bool ED_operator_nla_active(bContext *C);
bool ED_operator_info_active(bContext *C);
bool ED_operator_console_active(bContext *C);
bool ED_operator_object_active(struct bContext *C);
bool ED_operator_object_active_editable_ex(struct bContext *C, const Object *ob);
bool ED_operator_object_active_editable(struct bContext *C);
bool ED_operator_object_active(bContext *C);
bool ED_operator_object_active_editable_ex(bContext *C, const Object *ob);
bool ED_operator_object_active_editable(bContext *C);
/**
* Object must be editable and fully local (i.e. not an override).
*/
bool ED_operator_object_active_local_editable_ex(struct bContext *C, const Object *ob);
bool ED_operator_object_active_local_editable(struct bContext *C);
bool ED_operator_object_active_editable_mesh(struct bContext *C);
bool ED_operator_object_active_editable_font(struct bContext *C);
bool ED_operator_editable_mesh(struct bContext *C);
bool ED_operator_editmesh(struct bContext *C);
bool ED_operator_editmesh_view3d(struct bContext *C);
bool ED_operator_editmesh_region_view3d(struct bContext *C);
bool ED_operator_editmesh_auto_smooth(struct bContext *C);
bool ED_operator_editarmature(struct bContext *C);
bool ED_operator_editcurve(struct bContext *C);
bool ED_operator_editcurve_3d(struct bContext *C);
bool ED_operator_editsurf(struct bContext *C);
bool ED_operator_editsurfcurve(struct bContext *C);
bool ED_operator_editsurfcurve_region_view3d(struct bContext *C);
bool ED_operator_editfont(struct bContext *C);
bool ED_operator_editlattice(struct bContext *C);
bool ED_operator_editmball(struct bContext *C);
bool ED_operator_object_active_local_editable_ex(bContext *C, const Object *ob);
bool ED_operator_object_active_local_editable(bContext *C);
bool ED_operator_object_active_editable_mesh(bContext *C);
bool ED_operator_object_active_editable_font(bContext *C);
bool ED_operator_editable_mesh(bContext *C);
bool ED_operator_editmesh(bContext *C);
bool ED_operator_editmesh_view3d(bContext *C);
bool ED_operator_editmesh_region_view3d(bContext *C);
bool ED_operator_editmesh_auto_smooth(bContext *C);
bool ED_operator_editarmature(bContext *C);
bool ED_operator_editcurve(bContext *C);
bool ED_operator_editcurve_3d(bContext *C);
bool ED_operator_editsurf(bContext *C);
bool ED_operator_editsurfcurve(bContext *C);
bool ED_operator_editsurfcurve_region_view3d(bContext *C);
bool ED_operator_editfont(bContext *C);
bool ED_operator_editlattice(bContext *C);
bool ED_operator_editmball(bContext *C);
/**
* Wrapper for #ED_space_image_show_uvedit.
*/
bool ED_operator_uvedit(struct bContext *C);
bool ED_operator_uvedit_space_image(struct bContext *C);
bool ED_operator_uvmap(struct bContext *C);
bool ED_operator_posemode_exclusive(struct bContext *C);
bool ED_operator_uvedit(bContext *C);
bool ED_operator_uvedit_space_image(bContext *C);
bool ED_operator_uvmap(bContext *C);
bool ED_operator_posemode_exclusive(bContext *C);
/**
* Object must be editable, fully local (i.e. not an override), and exclusively in Pose mode.
*/
bool ED_operator_object_active_local_editable_posemode_exclusive(struct bContext *C);
bool ED_operator_object_active_local_editable_posemode_exclusive(bContext *C);
/**
* Allows for pinned pose objects to be used in the object buttons
* and the non-active pose object to be used in the 3D view.
*/
bool ED_operator_posemode_context(struct bContext *C);
bool ED_operator_posemode(struct bContext *C);
bool ED_operator_posemode_local(struct bContext *C);
bool ED_operator_camera_poll(struct bContext *C);
bool ED_operator_posemode_context(bContext *C);
bool ED_operator_posemode(bContext *C);
bool ED_operator_posemode_local(bContext *C);
bool ED_operator_camera_poll(bContext *C);
/* `screen_user_menu.cc` */
bUserMenu **ED_screen_user_menus_find(const struct bContext *C, uint *r_len);
struct bUserMenu *ED_screen_user_menu_ensure(struct bContext *C);
bUserMenu **ED_screen_user_menus_find(const bContext *C, uint *r_len);
bUserMenu *ED_screen_user_menu_ensure(bContext *C);
/**
* Finds a menu item associated with an operator in user menus (aka Quick Favorites)
@@ -609,42 +578,39 @@ struct bUserMenu *ED_screen_user_menu_ensure(struct bContext *C);
* \param op_prop_enum: name of an operator property when the operator is called with an enum (to
* be an empty string otherwise)
*/
struct bUserMenuItem_Op *ED_screen_user_menu_item_find_operator(struct ListBase *lb,
const struct wmOperatorType *ot,
struct IDProperty *prop,
const char *op_prop_enum,
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,
const char *context_data_path,
const char *prop_id,
int prop_index);
bUserMenuItem_Op *ED_screen_user_menu_item_find_operator(ListBase *lb,
const wmOperatorType *ot,
IDProperty *prop,
const char *op_prop_enum,
wmOperatorCallContext opcontext);
bUserMenuItem_Menu *ED_screen_user_menu_item_find_menu(ListBase *lb, const MenuType *mt);
bUserMenuItem_Prop *ED_screen_user_menu_item_find_prop(ListBase *lb,
const char *context_data_path,
const char *prop_id,
int prop_index);
void ED_screen_user_menu_item_add_operator(struct ListBase *lb,
void ED_screen_user_menu_item_add_operator(ListBase *lb,
const char *ui_name,
const struct wmOperatorType *ot,
const struct IDProperty *prop,
const wmOperatorType *ot,
const IDProperty *prop,
const char *op_prop_enum,
wmOperatorCallContext opcontext);
void ED_screen_user_menu_item_add_menu(struct ListBase *lb,
const char *ui_name,
const struct MenuType *mt);
void ED_screen_user_menu_item_add_menu(ListBase *lb, const char *ui_name, const MenuType *mt);
void ED_screen_user_menu_item_add_prop(ListBase *lb,
const char *ui_name,
const char *context_data_path,
const char *prop_id,
int prop_index);
void ED_screen_user_menu_item_remove(struct ListBase *lb, struct bUserMenuItem *umi);
void ED_screen_user_menu_item_remove(ListBase *lb, bUserMenuItem *umi);
void ED_screen_user_menu_register();
/* Cache display helpers */
void ED_region_cache_draw_background(struct ARegion *region);
void ED_region_cache_draw_background(ARegion *region);
void ED_region_cache_draw_curfra_label(int framenr, float x, float y);
void ED_region_cache_draw_cached_segments(
struct ARegion *region, int num_segments, const int *points, int sfra, int efra);
ARegion *region, int num_segments, const int *points, int sfra, int efra);
/* `area_utils.cc` */
@@ -652,11 +618,11 @@ void ED_region_cache_draw_cached_segments(
* Callback for #ARegionType.message_subscribe
*/
void ED_region_generic_tools_region_message_subscribe(
const struct wmRegionMessageSubscribeParams *params);
const wmRegionMessageSubscribeParams *params);
/**
* Callback for #ARegionType.snap_size
*/
int ED_region_generic_tools_region_snap_size(const struct ARegion *region, int size, int axis);
int ED_region_generic_tools_region_snap_size(const ARegion *region, int size, int axis);
/* `area_query.cc` */
@@ -677,7 +643,7 @@ bool ED_region_panel_category_gutter_isect_xy(const ARegion *region, const int e
* \note This may return true for multiple overlapping regions.
* If it matters, check overlapped regions first (#ARegion.overlap).
*/
bool ED_region_contains_xy(const struct ARegion *region, const int event_xy[2]);
bool ED_region_contains_xy(const ARegion *region, const int event_xy[2]);
/**
* Similar to #BKE_area_find_region_xy() but when \a event_xy intersects an overlapping region,
* this returns the region that is visually under the cursor. E.g. when over the
@@ -689,16 +655,15 @@ ARegion *ED_area_find_region_xy_visual(const ScrArea *area, int regiontype, cons
/* `interface_region_hud.cc` */
struct ARegionType *ED_area_type_hud(int space_type);
void ED_area_type_hud_clear(struct wmWindowManager *wm, ScrArea *area_keep);
void ED_area_type_hud_ensure(struct bContext *C, struct ScrArea *area);
ARegionType *ED_area_type_hud(int space_type);
void ED_area_type_hud_clear(wmWindowManager *wm, ScrArea *area_keep);
void ED_area_type_hud_ensure(bContext *C, ScrArea *area);
/**
* Lookup the region the operation was executed in, and which should be used to redo the
* operation. The lookup is based on the region type, so it can return a different region when the
* same region type is present multiple times.
*/
ARegion *ED_area_type_hud_redo_region_find(const struct ScrArea *area,
const struct ARegion *hud_region);
ARegion *ED_area_type_hud_redo_region_find(const ScrArea *area, const ARegion *hud_region);
/**
* Default key-maps, bit-flags (matches order of evaluation).
@@ -718,7 +683,7 @@ enum {
};
/** #SCREEN_OT_space_context_cycle direction. */
typedef enum eScreenCycle {
enum eScreenCycle {
SPACE_CONTEXT_CYCLE_PREV,
SPACE_CONTEXT_CYCLE_NEXT,
} eScreenCycle;
};

View File

@@ -80,7 +80,7 @@ enum AZScrollDirection {
/* for editing areas/regions */
struct AZone {
struct AZone *next, *prev;
AZone *next, *prev;
ARegion *region;
int type;

View File

@@ -77,7 +77,7 @@ enum eTfmMode {
bool calculateTransformCenter(bContext *C, int centerMode, float cent3d[3], float cent2d[2]);
/* UNUSED */
// int BIF_snappingSupported(struct Object *obedit);
// int BIF_snappingSupported(Object *obedit);
void BIF_clearTransformOrientation(bContext *C);
void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target);

View File

@@ -35,7 +35,7 @@ enum eSnapEditType {
/** used for storing multiple hits */
struct SnapObjectHitDepth {
struct SnapObjectHitDepth *next, *prev;
SnapObjectHitDepth *next, *prev;
float depth;
float co[3];

View File

@@ -17,37 +17,32 @@ struct bContext;
/* ed_util.cc */
void ED_editors_init_for_undo(struct Main *bmain);
void ED_editors_init(struct bContext *C);
void ED_editors_init_for_undo(Main *bmain);
void ED_editors_init(bContext *C);
/**
* Frees all edit-mode stuff.
*/
void ED_editors_exit(struct Main *bmain, bool do_undo_system);
void ED_editors_exit(Main *bmain, bool do_undo_system);
bool ED_editors_flush_edits_for_object_ex(struct Main *bmain,
struct Object *ob,
bool ED_editors_flush_edits_for_object_ex(Main *bmain,
Object *ob,
bool for_render,
bool check_needs_flush);
bool ED_editors_flush_edits_for_object(struct Main *bmain, struct Object *ob);
bool ED_editors_flush_edits_for_object(Main *bmain, Object *ob);
/**
* Flush any temp data from object editing to DNA before writing files, rendering, copying, etc.
*/
bool ED_editors_flush_edits_ex(struct Main *bmain, bool for_render, bool check_needs_flush);
bool ED_editors_flush_edits(struct Main *bmain);
bool ED_editors_flush_edits_ex(Main *bmain, bool for_render, bool check_needs_flush);
bool ED_editors_flush_edits(Main *bmain);
/**
* Use to free ID references within runtime data (stored outside of DNA)
*
* \param new_id: may be NULL to unlink \a old_id.
*/
void ED_spacedata_id_remap_single(struct ScrArea *area,
struct SpaceLink *sl,
struct ID *old_id,
struct ID *new_id);
void ED_spacedata_id_remap(struct ScrArea *area,
struct SpaceLink *sl,
const struct IDRemapper *mappings);
void ED_spacedata_id_remap_single(ScrArea *area, SpaceLink *sl, ID *old_id, ID *new_id);
void ED_spacedata_id_remap(ScrArea *area, SpaceLink *sl, const IDRemapper *mappings);
void ED_operatortypes_edutils();
@@ -56,55 +51,53 @@ void ED_operatortypes_edutils();
/**
* Callback that draws a line between the mouse and a position given as the initial argument.
*/
void ED_region_draw_mouse_line_cb(const struct bContext *C,
struct ARegion *region,
void *arg_info);
void ED_region_draw_mouse_line_cb(const bContext *C, ARegion *region, void *arg_info);
/**
* \note Keep in sync with #BKE_image_stamp_buf.
*/
void ED_region_image_metadata_draw(
int x, int y, struct ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy);
int x, int y, ImBuf *ibuf, const rctf *frame, float zoomx, float zoomy);
/* Slider */
struct tSlider;
typedef enum SliderMode { SLIDER_MODE_PERCENT = 0, SLIDER_MODE_FLOAT = 1 } SliderMode;
enum SliderMode { SLIDER_MODE_PERCENT = 0, SLIDER_MODE_FLOAT = 1 };
struct tSlider *ED_slider_create(struct bContext *C);
tSlider *ED_slider_create(bContext *C);
/**
* For modal operations so the percentage doesn't pop on the first mouse movement.
*/
void ED_slider_init(struct tSlider *slider, const struct wmEvent *event);
void ED_slider_init(tSlider *slider, const wmEvent *event);
/**
* Calculate slider factor based on mouse position.
*/
bool ED_slider_modal(struct tSlider *slider, const struct wmEvent *event);
void ED_slider_destroy(struct bContext *C, struct tSlider *slider);
bool ED_slider_modal(tSlider *slider, const wmEvent *event);
void ED_slider_destroy(bContext *C, tSlider *slider);
/**
* Return string based on the current state of the slider.
*/
void ED_slider_status_string_get(const struct tSlider *slider,
void ED_slider_status_string_get(const tSlider *slider,
char *status_string,
size_t size_of_status_string);
float ED_slider_factor_get(struct tSlider *slider);
void ED_slider_factor_set(struct tSlider *slider, float factor);
float ED_slider_factor_get(tSlider *slider);
void ED_slider_factor_set(tSlider *slider, float factor);
/* One bool value for each side of the slider. Allows to enable overshoot only on one side. */
void ED_slider_allow_overshoot_set(struct tSlider *slider, bool lower, bool upper);
void ED_slider_allow_overshoot_set(tSlider *slider, bool lower, bool upper);
/**
* Set the soft limits for the slider, which are applied until the user enables overshooting.
*/
void ED_slider_factor_bounds_set(struct tSlider *slider, float lower_bound, float upper_bound);
void ED_slider_factor_bounds_set(tSlider *slider, float lower_bound, float upper_bound);
bool ED_slider_allow_increments_get(struct tSlider *slider);
void ED_slider_allow_increments_set(struct tSlider *slider, bool value);
bool ED_slider_allow_increments_get(tSlider *slider);
void ED_slider_allow_increments_set(tSlider *slider, bool value);
void ED_slider_mode_set(struct tSlider *slider, SliderMode unit);
void ED_slider_unit_set(struct tSlider *slider, const char *unit);
void ED_slider_mode_set(tSlider *slider, SliderMode unit);
void ED_slider_unit_set(tSlider *slider, const char *unit);
/* ************** XXX OLD CRUFT WARNING ************* */
@@ -117,9 +110,9 @@ void apply_keyb_grid(
bool shift, bool ctrl, float *val, float fac1, float fac2, float fac3, int invert);
/* where else to go ? */
void unpack_menu(struct bContext *C,
void unpack_menu(bContext *C,
const char *opname,
const char *id_name,
const char *abs_name,
const char *folder,
struct PackedFile *pf);
PackedFile *pf);

View File

@@ -495,13 +495,13 @@ void VIEW2D_GGT_navigate_impl(wmGizmoGroupType *gzgt, const char *idname);
*/
struct View2DEdgePanData {
/** Screen where view pan was initiated. */
struct bScreen *screen;
bScreen *screen;
/** Area where view pan was initiated. */
struct ScrArea *area;
ScrArea *area;
/** Region where view pan was initiated. */
struct ARegion *region;
ARegion *region;
/** View2d we're operating in. */
struct View2D *v2d;
View2D *v2d;
/** Limit maximum pannable area. */
struct rctf limit;

View File

@@ -12,7 +12,7 @@
/* `interface_eyedropper.cc` */
void eyedropper_draw_cursor_text_window(const struct wmWindow *window, const char *name);
void eyedropper_draw_cursor_text_window(const wmWindow *window, const char *name);
void eyedropper_draw_cursor_text_region(const int xy[2], const char *name);
/**
* Utility to retrieve a button representing a RNA property that is currently under the cursor.
@@ -24,11 +24,8 @@ void eyedropper_draw_cursor_text_region(const int xy[2], const char *name);
* \return A button under the mouse which relates to some RNA Property, or NULL
*/
uiBut *eyedropper_get_property_button_under_mouse(bContext *C, const wmEvent *event);
void datadropper_win_area_find(const struct bContext *C,
const int mval[2],
int r_mval[2],
struct wmWindow **r_win,
struct ScrArea **r_area);
void datadropper_win_area_find(
const bContext *C, const int mval[2], int r_mval[2], wmWindow **r_win, ScrArea **r_area);
/* interface_eyedropper_color.c (expose for color-band picker) */

View File

@@ -369,12 +369,12 @@ struct uiButColorBand : public uiBut {
/** Derived struct for #UI_BTYPE_CURVEPROFILE. */
struct uiButCurveProfile : public uiBut {
struct CurveProfile *edit_profile = nullptr;
CurveProfile *edit_profile = nullptr;
};
/** Derived struct for #UI_BTYPE_CURVE. */
struct uiButCurveMapping : public uiBut {
struct CurveMapping *edit_cumap = nullptr;
CurveMapping *edit_cumap = nullptr;
eButGradientType gradient_type = UI_GRAD_SV;
};
@@ -397,7 +397,7 @@ struct uiButExtraOpIcon {
};
struct ColorPicker {
struct ColorPicker *next, *prev;
ColorPicker *next, *prev;
/** Color in HSV or HSL, in color picking color space. Used for HSV cube,
* circle and slider widgets. The color picking space is perceptually

View File

@@ -17,4 +17,4 @@ uint ui_popup_menu_hash(const char *str);
/* interface_regions.cc */
ARegion *ui_region_temp_add(bScreen *screen);
void ui_region_temp_remove(struct bContext *C, bScreen *screen, ARegion *region);
void ui_region_temp_remove(bContext *C, bScreen *screen, ARegion *region);

View File

@@ -34,6 +34,7 @@
struct AutomaskingCache;
struct AutomaskingNodeData;
struct BMLog;
struct Dial;
struct DistRayAABB_Precalc;
struct Image;
@@ -98,7 +99,7 @@ struct SculptVertexNeighborIter {
/* Sculpt Original Data */
struct SculptOrigVertData {
struct BMLog *bm_log;
BMLog *bm_log;
SculptUndoNode *unode;
float (*coords)[3];
@@ -115,7 +116,7 @@ struct SculptOrigVertData {
struct SculptOrigFaceData {
SculptUndoNode *unode;
struct BMLog *bm_log;
BMLog *bm_log;
const int *face_sets;
int face_set;
};

View File

@@ -104,7 +104,7 @@ struct SpaceNode_Runtime {
/* XXX hack for translate_attach op-macros to pass data from transform op to insert_offset op */
/** Temporary data for node insert offset (in UI called Auto-offset). */
struct NodeInsertOfsData *iofsd;
NodeInsertOfsData *iofsd;
/**
* Temporary data for node add menu in order to provide longer-term storage for context pointers.

View File

@@ -111,13 +111,13 @@ class AbstractTreeElement {
* noise, and can be expensive to add in big scenes. So prefer setting this to
* false.
*/
struct TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
ListBase *lb,
void *idv,
struct TreeElement *parent,
short type,
short index,
const bool expand = true);
TreeElement *outliner_add_element(SpaceOutliner *space_outliner,
ListBase *lb,
void *idv,
TreeElement *parent,
short type,
short index,
const bool expand = true);
void tree_element_expand(const AbstractTreeElement &tree_element, SpaceOutliner &space_outliner);

View File

@@ -143,7 +143,7 @@ struct ViewOpsData {
float mousevec[3];
/** Used for roll */
struct Dial *dial;
Dial *dial;
} init;
/** Previous state (previous modal event handled). */

View File

@@ -125,9 +125,9 @@ struct TransData {
float smtx[3][3];
/** Axis orientation matrix of the data. */
float axismtx[3][3];
struct Object *ob;
Object *ob;
/** For objects/bones, the first constraint in its constraint stack. */
struct bConstraint *con;
bConstraint *con;
/** For objects, poses. 1 single allocation per #TransInfo! */
TransDataExtension *ext;
/** for curves, stores handle flags for modification/cancel. */

View File

@@ -34,9 +34,7 @@ struct wmMsgBus;
#define GIZMO_AXIS_LINE_WIDTH 2.0f
void gizmo_prepare_mat(const bContext *C,
struct RegionView3D *rv3d,
const TransformBounds *tbounds);
void gizmo_prepare_mat(const bContext *C, RegionView3D *rv3d, const TransformBounds *tbounds);
void gizmo_xform_message_subscribe(wmGizmoGroup *gzgroup,
wmMsgBus *mbus,
Scene *scene,

View File

@@ -15,7 +15,7 @@
SCE_SNAP_TO_EDGE_PERPENDICULAR)
struct SnapObjectContext {
struct Scene *scene;
Scene *scene;
struct SnapCache {
virtual ~SnapCache(){};

View File

@@ -31,7 +31,7 @@ class MTLVertBuf : public VertBuf {
/** Metal buffer allocation. **/
gpu::MTLBuffer *vbo_ = nullptr;
/** Texture used if the buffer is bound as buffer texture. Init on first use. */
struct ::GPUTexture *buffer_texture_ = nullptr;
::GPUTexture *buffer_texture_ = nullptr;
/** Defines whether the buffer handle is wrapped by this MTLVertBuf, i.e. we do not own it and
* should not free it. */
bool is_wrapper_ = false;

View File

@@ -9,11 +9,12 @@
#pragma once
struct bNode;
struct bNodeInstanceHash;
struct bNodeTree;
/* data for initializing node execution */
struct bNodeExecContext {
struct bNodeInstanceHash *previews;
bNodeInstanceHash *previews;
};
struct bNodeExecData {

View File

@@ -1287,7 +1287,7 @@ struct wmTooltipState {
/* *************** migrated stuff, clean later? ************** */
struct RecentFile {
struct RecentFile *next, *prev;
RecentFile *next, *prev;
char *filepath;
};

View File

@@ -62,4 +62,4 @@ typedef enum WMCursorType {
} WMCursorType;
void wm_init_cursor_data();
bool wm_cursor_arrow_move(struct wmWindow *win, const struct wmEvent *event);
bool wm_cursor_arrow_move(wmWindow *win, const wmEvent *event);

View File

@@ -17,8 +17,8 @@ struct bContext;
struct wmWindow;
struct wmDrawBuffer {
struct GPUOffScreen *offscreen;
struct GPUViewport *viewport;
GPUOffScreen *offscreen;
GPUViewport *viewport;
bool stereo;
int bound_view;
};