diff --git a/source/blender/blenkernel/BKE_lib_override.hh b/source/blender/blenkernel/BKE_lib_override.hh index 244363a4c68..7c22df3e5d9 100644 --- a/source/blender/blenkernel/BKE_lib_override.hh +++ b/source/blender/blenkernel/BKE_lib_override.hh @@ -528,7 +528,7 @@ using OverrideLibraryStorage = Main; /** * Initialize an override storage. */ -OverrideLibraryStorage *BKE_lib_override_library_operations_store_init(void); +OverrideLibraryStorage *BKE_lib_override_library_operations_store_init(); /** * Generate suitable 'write' data (this only affects differential override operations). * diff --git a/source/blender/blenkernel/BKE_paint.hh b/source/blender/blenkernel/BKE_paint.hh index 28c4ee29599..60985c543cf 100644 --- a/source/blender/blenkernel/BKE_paint.hh +++ b/source/blender/blenkernel/BKE_paint.hh @@ -134,8 +134,8 @@ ENUM_OPERATORS(ePaintSymmetryAreas, PAINT_SYMM_AREA_Z); void BKE_paint_invalidate_overlay_tex(Scene *scene, ViewLayer *view_layer, const Tex *tex); void BKE_paint_invalidate_cursor_overlay(Scene *scene, ViewLayer *view_layer, CurveMapping *curve); -void BKE_paint_invalidate_overlay_all(void); -ePaintOverlayControlFlags BKE_paint_get_overlay_flags(void); +void BKE_paint_invalidate_overlay_all(); +ePaintOverlayControlFlags BKE_paint_get_overlay_flags(); void BKE_paint_reset_overlay_invalid(ePaintOverlayControlFlags flag); void BKE_paint_set_overlay_override(enum eOverlayFlags flag); @@ -930,4 +930,4 @@ bool BKE_paint_canvas_image_get(PaintModeSettings *settings, ImageUser **r_image_user); int BKE_paint_canvas_uvmap_layer_index_get(const PaintModeSettings *settings, Object *ob); void BKE_sculpt_check_cavity_curves(Sculpt *sd); -CurveMapping *BKE_sculpt_default_cavity_curve(void); +CurveMapping *BKE_sculpt_default_cavity_curve(); diff --git a/source/blender/blenloader/tests/blendfile_loading_base_test.cc b/source/blender/blenloader/tests/blendfile_loading_base_test.cc index 2d367b7df4d..c4d070e3057 100644 --- a/source/blender/blenloader/tests/blendfile_loading_base_test.cc +++ b/source/blender/blenloader/tests/blendfile_loading_base_test.cc @@ -38,7 +38,7 @@ #include "RNA_define.h" #include "WM_api.hh" -#include "wm.h" +#include "wm.hh" #include "GHOST_Path-api.hh" diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.cc b/source/blender/draw/engines/eevee/eevee_lightcache.cc index 2a0c2eea895..09bb4e5268b 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.cc +++ b/source/blender/draw/engines/eevee/eevee_lightcache.cc @@ -36,7 +36,7 @@ #include "BLO_read_write.h" -#include "wm_window.h" +#include "wm_window.hh" /* Rounded to nearest PowerOfTwo */ #if defined(IRRADIANCE_SH_L2) diff --git a/source/blender/draw/engines/eevee_next/eevee_lightcache.cc b/source/blender/draw/engines/eevee_next/eevee_lightcache.cc index dd2c1506660..42ec900c357 100644 --- a/source/blender/draw/engines/eevee_next/eevee_lightcache.cc +++ b/source/blender/draw/engines/eevee_next/eevee_lightcache.cc @@ -30,7 +30,7 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "eevee_engine.h" #include "eevee_instance.hh" diff --git a/source/blender/draw/engines/overlay/overlay_private.hh b/source/blender/draw/engines/overlay/overlay_private.hh index 2468e4ceac0..8d3c87bfac9 100644 --- a/source/blender/draw/engines/overlay/overlay_private.hh +++ b/source/blender/draw/engines/overlay/overlay_private.hh @@ -723,88 +723,88 @@ void OVERLAY_edit_curves_cache_init(OVERLAY_Data *vedata); void OVERLAY_edit_curves_cache_populate(OVERLAY_Data *vedata, Object *ob); void OVERLAY_edit_curves_draw(OVERLAY_Data *vedata); -GPUShader *OVERLAY_shader_antialiasing(void); -GPUShader *OVERLAY_shader_armature_degrees_of_freedom_wire(void); -GPUShader *OVERLAY_shader_armature_degrees_of_freedom_solid(void); +GPUShader *OVERLAY_shader_antialiasing(); +GPUShader *OVERLAY_shader_armature_degrees_of_freedom_wire(); +GPUShader *OVERLAY_shader_armature_degrees_of_freedom_solid(); GPUShader *OVERLAY_shader_armature_envelope(bool use_outline); GPUShader *OVERLAY_shader_armature_shape(bool use_outline); -GPUShader *OVERLAY_shader_armature_shape_wire(void); +GPUShader *OVERLAY_shader_armature_shape_wire(); GPUShader *OVERLAY_shader_armature_sphere(bool use_outline); -GPUShader *OVERLAY_shader_armature_stick(void); -GPUShader *OVERLAY_shader_armature_wire(void); -GPUShader *OVERLAY_shader_background(void); -GPUShader *OVERLAY_shader_clipbound(void); -GPUShader *OVERLAY_shader_depth_only(void); -GPUShader *OVERLAY_shader_edit_curve_handle(void); -GPUShader *OVERLAY_shader_edit_curve_point(void); -GPUShader *OVERLAY_shader_edit_curve_wire(void); -GPUShader *OVERLAY_shader_edit_gpencil_guide_point(void); -GPUShader *OVERLAY_shader_edit_gpencil_point(void); -GPUShader *OVERLAY_shader_edit_gpencil_wire(void); -GPUShader *OVERLAY_shader_edit_lattice_point(void); -GPUShader *OVERLAY_shader_edit_lattice_wire(void); -GPUShader *OVERLAY_shader_edit_mesh_analysis(void); -GPUShader *OVERLAY_shader_edit_mesh_depth(void); +GPUShader *OVERLAY_shader_armature_stick(); +GPUShader *OVERLAY_shader_armature_wire(); +GPUShader *OVERLAY_shader_background(); +GPUShader *OVERLAY_shader_clipbound(); +GPUShader *OVERLAY_shader_depth_only(); +GPUShader *OVERLAY_shader_edit_curve_handle(); +GPUShader *OVERLAY_shader_edit_curve_point(); +GPUShader *OVERLAY_shader_edit_curve_wire(); +GPUShader *OVERLAY_shader_edit_gpencil_guide_point(); +GPUShader *OVERLAY_shader_edit_gpencil_point(); +GPUShader *OVERLAY_shader_edit_gpencil_wire(); +GPUShader *OVERLAY_shader_edit_lattice_point(); +GPUShader *OVERLAY_shader_edit_lattice_wire(); +GPUShader *OVERLAY_shader_edit_mesh_analysis(); +GPUShader *OVERLAY_shader_edit_mesh_depth(); GPUShader *OVERLAY_shader_edit_mesh_edge(bool use_flat_interp); -GPUShader *OVERLAY_shader_edit_mesh_face(void); -GPUShader *OVERLAY_shader_edit_mesh_facedot(void); -GPUShader *OVERLAY_shader_edit_mesh_normal(void); -GPUShader *OVERLAY_shader_edit_mesh_skin_root(void); -GPUShader *OVERLAY_shader_edit_mesh_vert(void); -GPUShader *OVERLAY_shader_edit_particle_strand(void); -GPUShader *OVERLAY_shader_edit_particle_point(void); -GPUShader *OVERLAY_shader_edit_uv_edges_get(void); -GPUShader *OVERLAY_shader_edit_uv_edges_for_edge_select_get(void); -GPUShader *OVERLAY_shader_edit_uv_face_get(void); -GPUShader *OVERLAY_shader_edit_uv_face_dots_get(void); -GPUShader *OVERLAY_shader_edit_uv_verts_get(void); -GPUShader *OVERLAY_shader_edit_uv_stretching_area_get(void); -GPUShader *OVERLAY_shader_edit_uv_stretching_angle_get(void); -GPUShader *OVERLAY_shader_edit_uv_tiled_image_borders_get(void); -GPUShader *OVERLAY_shader_edit_uv_stencil_image(void); -GPUShader *OVERLAY_shader_edit_uv_mask_image(void); +GPUShader *OVERLAY_shader_edit_mesh_face(); +GPUShader *OVERLAY_shader_edit_mesh_facedot(); +GPUShader *OVERLAY_shader_edit_mesh_normal(); +GPUShader *OVERLAY_shader_edit_mesh_skin_root(); +GPUShader *OVERLAY_shader_edit_mesh_vert(); +GPUShader *OVERLAY_shader_edit_particle_strand(); +GPUShader *OVERLAY_shader_edit_particle_point(); +GPUShader *OVERLAY_shader_edit_uv_edges_get(); +GPUShader *OVERLAY_shader_edit_uv_edges_for_edge_select_get(); +GPUShader *OVERLAY_shader_edit_uv_face_get(); +GPUShader *OVERLAY_shader_edit_uv_face_dots_get(); +GPUShader *OVERLAY_shader_edit_uv_verts_get(); +GPUShader *OVERLAY_shader_edit_uv_stretching_area_get(); +GPUShader *OVERLAY_shader_edit_uv_stretching_angle_get(); +GPUShader *OVERLAY_shader_edit_uv_tiled_image_borders_get(); +GPUShader *OVERLAY_shader_edit_uv_stencil_image(); +GPUShader *OVERLAY_shader_edit_uv_mask_image(); GPUShader *OVERLAY_shader_extra(bool is_select); -GPUShader *OVERLAY_shader_extra_groundline(void); +GPUShader *OVERLAY_shader_extra_groundline(); GPUShader *OVERLAY_shader_extra_wire(bool use_object, bool is_select); -GPUShader *OVERLAY_shader_extra_loose_point(void); -GPUShader *OVERLAY_shader_extra_point(void); -GPUShader *OVERLAY_shader_facing(void); -GPUShader *OVERLAY_shader_gpencil_canvas(void); -GPUShader *OVERLAY_shader_grid(void); -GPUShader *OVERLAY_shader_grid_background(void); -GPUShader *OVERLAY_shader_grid_image(void); -GPUShader *OVERLAY_shader_image(void); -GPUShader *OVERLAY_shader_motion_path_line(void); -GPUShader *OVERLAY_shader_motion_path_vert(void); -GPUShader *OVERLAY_shader_uniform_color(void); -GPUShader *OVERLAY_shader_uniform_color_pointcloud(void); +GPUShader *OVERLAY_shader_extra_loose_point(); +GPUShader *OVERLAY_shader_extra_point(); +GPUShader *OVERLAY_shader_facing(); +GPUShader *OVERLAY_shader_gpencil_canvas(); +GPUShader *OVERLAY_shader_grid(); +GPUShader *OVERLAY_shader_grid_background(); +GPUShader *OVERLAY_shader_grid_image(); +GPUShader *OVERLAY_shader_image(); +GPUShader *OVERLAY_shader_motion_path_line(); +GPUShader *OVERLAY_shader_motion_path_vert(); +GPUShader *OVERLAY_shader_uniform_color(); +GPUShader *OVERLAY_shader_uniform_color_pointcloud(); GPUShader *OVERLAY_shader_outline_prepass(bool use_wire); -GPUShader *OVERLAY_shader_outline_prepass_curves(void); -GPUShader *OVERLAY_shader_outline_prepass_gpencil(void); -GPUShader *OVERLAY_shader_outline_prepass_pointcloud(void); -GPUShader *OVERLAY_shader_extra_grid(void); -GPUShader *OVERLAY_shader_outline_detect(void); -GPUShader *OVERLAY_shader_paint_face(void); -GPUShader *OVERLAY_shader_paint_point(void); -GPUShader *OVERLAY_shader_paint_texture(void); -GPUShader *OVERLAY_shader_paint_vertcol(void); +GPUShader *OVERLAY_shader_outline_prepass_curves(); +GPUShader *OVERLAY_shader_outline_prepass_gpencil(); +GPUShader *OVERLAY_shader_outline_prepass_pointcloud(); +GPUShader *OVERLAY_shader_extra_grid(); +GPUShader *OVERLAY_shader_outline_detect(); +GPUShader *OVERLAY_shader_paint_face(); +GPUShader *OVERLAY_shader_paint_point(); +GPUShader *OVERLAY_shader_paint_texture(); +GPUShader *OVERLAY_shader_paint_vertcol(); GPUShader *OVERLAY_shader_paint_weight(bool shading); -GPUShader *OVERLAY_shader_paint_wire(void); -GPUShader *OVERLAY_shader_particle_dot(void); -GPUShader *OVERLAY_shader_particle_shape(void); -GPUShader *OVERLAY_shader_sculpt_mask(void); -GPUShader *OVERLAY_shader_sculpt_curves_selection(void); -GPUShader *OVERLAY_shader_sculpt_curves_cage(void); -GPUShader *OVERLAY_shader_viewer_attribute_curve(void); -GPUShader *OVERLAY_shader_viewer_attribute_curves(void); -GPUShader *OVERLAY_shader_viewer_attribute_mesh(void); -GPUShader *OVERLAY_shader_viewer_attribute_pointcloud(void); +GPUShader *OVERLAY_shader_paint_wire(); +GPUShader *OVERLAY_shader_particle_dot(); +GPUShader *OVERLAY_shader_particle_shape(); +GPUShader *OVERLAY_shader_sculpt_mask(); +GPUShader *OVERLAY_shader_sculpt_curves_selection(); +GPUShader *OVERLAY_shader_sculpt_curves_cage(); +GPUShader *OVERLAY_shader_viewer_attribute_curve(); +GPUShader *OVERLAY_shader_viewer_attribute_curves(); +GPUShader *OVERLAY_shader_viewer_attribute_mesh(); +GPUShader *OVERLAY_shader_viewer_attribute_pointcloud(); GPUShader *OVERLAY_shader_volume_velocity(bool use_needle, bool use_mac); GPUShader *OVERLAY_shader_volume_gridlines(bool color_with_flags, bool color_range); GPUShader *OVERLAY_shader_wireframe(bool custom_bias); -GPUShader *OVERLAY_shader_wireframe_select(void); -GPUShader *OVERLAY_shader_xray_fade(void); +GPUShader *OVERLAY_shader_wireframe_select(); +GPUShader *OVERLAY_shader_xray_fade(); -OVERLAY_InstanceFormats *OVERLAY_shader_instance_formats_get(void); +OVERLAY_InstanceFormats *OVERLAY_shader_instance_formats_get(); -void OVERLAY_shader_free(void); +void OVERLAY_shader_free(); diff --git a/source/blender/draw/intern/draw_manager_c.cc b/source/blender/draw/intern/draw_manager_c.cc index d3aef2f5524..6c50b797a8f 100644 --- a/source/blender/draw/intern/draw_manager_c.cc +++ b/source/blender/draw/intern/draw_manager_c.cc @@ -73,7 +73,7 @@ #include "UI_view2d.h" #include "WM_api.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "draw_color_management.h" #include "draw_manager.h" diff --git a/source/blender/draw/intern/draw_manager_data.cc b/source/blender/draw/intern/draw_manager_data.cc index c69ccd4ce95..6b49b9ad169 100644 --- a/source/blender/draw/intern/draw_manager_data.cc +++ b/source/blender/draw/intern/draw_manager_data.cc @@ -24,7 +24,7 @@ /* For debug cursor position. */ #include "WM_api.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "DNA_curve_types.h" #include "DNA_mesh_types.h" diff --git a/source/blender/draw/intern/draw_manager_profiling.hh b/source/blender/draw/intern/draw_manager_profiling.hh index ec2c5f77057..85c56cf94fa 100644 --- a/source/blender/draw/intern/draw_manager_profiling.hh +++ b/source/blender/draw/intern/draw_manager_profiling.hh @@ -8,31 +8,23 @@ #pragma once -#ifdef __cplusplus -extern "C" { -#endif - struct rcti; -void DRW_stats_free(void); -void DRW_stats_begin(void); -void DRW_stats_reset(void); +void DRW_stats_free(); +void DRW_stats_begin(); +void DRW_stats_reset(); /** * Use this to group the queries. It does NOT keep track * of the time, it only sum what the queries inside it. */ void DRW_stats_group_start(const char *name); -void DRW_stats_group_end(void); +void DRW_stats_group_end(); /** * \note Only call this when no sub timer will be called. */ void DRW_stats_query_start(const char *name); -void DRW_stats_query_end(void); +void DRW_stats_query_end(); void DRW_stats_draw(const rcti *rect); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/draw/intern/draw_manager_shader.cc b/source/blender/draw/intern/draw_manager_shader.cc index e6425fc4b6f..077f362e8d0 100644 --- a/source/blender/draw/intern/draw_manager_shader.cc +++ b/source/blender/draw/intern/draw_manager_shader.cc @@ -30,7 +30,7 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "draw_manager.h" diff --git a/source/blender/editors/gizmo_library/gizmo_draw_utils.cc b/source/blender/editors/gizmo_library/gizmo_draw_utils.cc index 1ee4d796d50..79bdf3aa698 100644 --- a/source/blender/editors/gizmo_library/gizmo_draw_utils.cc +++ b/source/blender/editors/gizmo_library/gizmo_draw_utils.cc @@ -24,7 +24,7 @@ #include "WM_types.hh" /* only for own init/exit calls (wm_gizmotype_init/wm_gizmotype_free) */ -#include "wm.h" +#include "wm.hh" /* own includes */ #include "gizmo_library_intern.h" diff --git a/source/blender/editors/include/ED_screen.hh b/source/blender/editors/include/ED_screen.hh index cc058ca8809..b6987d0e202 100644 --- a/source/blender/editors/include/ED_screen.hh +++ b/source/blender/editors/include/ED_screen.hh @@ -233,8 +233,8 @@ void ED_area_status_text(ScrArea *area, const char *str); 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); -int ED_area_headersize(void); -int ED_area_footersize(void); +int ED_area_headersize(); +int ED_area_footersize(); /** * \return the final height of a global \a area, accounting for DPI. */ @@ -248,7 +248,7 @@ 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); +int ED_region_global_size_y(); void ED_area_update_region_sizes(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area); @@ -489,13 +489,13 @@ bScreen *ED_screen_animation_no_scrub(const struct wmWindowManager *wm); /* screen keymaps */ /* called in spacetypes.cc */ -void ED_operatortypes_screen(void); +void ED_operatortypes_screen(); /* called in spacetypes.cc */ void ED_keymap_screen(struct wmKeyConfig *keyconf); /** * Workspace key-maps. */ -void ED_operatortypes_workspace(void); +void ED_operatortypes_workspace(); /* operators; context poll callbacks */ @@ -637,7 +637,7 @@ void ED_screen_user_menu_item_add_prop(ListBase *lb, int prop_index); void ED_screen_user_menu_item_remove(struct ListBase *lb, struct bUserMenuItem *umi); -void ED_screen_user_menu_register(void); +void ED_screen_user_menu_register(); /* Cache display helpers */ diff --git a/source/blender/editors/include/ED_util.hh b/source/blender/editors/include/ED_util.hh index 11db90c9d62..7969f1f48cd 100644 --- a/source/blender/editors/include/ED_util.hh +++ b/source/blender/editors/include/ED_util.hh @@ -49,7 +49,7 @@ void ED_spacedata_id_remap(struct ScrArea *area, struct SpaceLink *sl, const struct IDRemapper *mappings); -void ED_operatortypes_edutils(void); +void ED_operatortypes_edutils(); /* Drawing */ diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index 03253dfc604..ed47b440d6b 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -72,7 +72,7 @@ #ifdef WITH_INPUT_IME # include "BLT_lang.h" # include "BLT_translation.h" -# include "wm_window.h" +# include "wm_window.hh" #endif /* -------------------------------------------------------------------- */ diff --git a/source/blender/editors/interface/interface_regions.cc b/source/blender/editors/interface/interface_regions.cc index 240652d61ac..003ba5fe4f7 100644 --- a/source/blender/editors/interface/interface_regions.cc +++ b/source/blender/editors/interface/interface_regions.cc @@ -18,7 +18,7 @@ #include "BKE_screen.h" #include "WM_api.hh" -#include "wm_draw.h" +#include "wm_draw.hh" #include "ED_screen.hh" diff --git a/source/blender/editors/render/render_view.cc b/source/blender/editors/render/render_view.cc index e3ad8570749..ce687d4384e 100644 --- a/source/blender/editors/render/render_view.cc +++ b/source/blender/editors/render/render_view.cc @@ -31,7 +31,7 @@ #include "ED_screen.hh" #include "UI_interface.h" -#include "wm_window.h" +#include "wm_window.hh" #include "render_intern.hh" diff --git a/source/blender/editors/sculpt_paint/paint_intern.hh b/source/blender/editors/sculpt_paint/paint_intern.hh index cc548c8d380..85be1248e90 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.hh +++ b/source/blender/editors/sculpt_paint/paint_intern.hh @@ -105,7 +105,7 @@ bool PAINT_brush_tool_poll(bContext *C); /** * Delete overlay cursor textures to preserve memory and invalidate all overlay flags. */ -void paint_cursor_delete_textures(void); +void paint_cursor_delete_textures(); /* `paint_vertex.cc` */ @@ -209,7 +209,7 @@ struct ImagePaintPartialRedraw { bool image_texture_paint_poll(bContext *C); void imapaint_image_update( SpaceImage *sima, Image *image, ImBuf *ibuf, ImageUser *iuser, short texpaint); -ImagePaintPartialRedraw *get_imapaintpartial(void); +ImagePaintPartialRedraw *get_imapaintpartial(); void set_imapaintpartial(ImagePaintPartialRedraw *ippr); void imapaint_region_tiles( ImBuf *ibuf, int x, int y, int w, int h, int *tx, int *ty, int *tw, int *th); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.hh b/source/blender/editors/sculpt_paint/sculpt_intern.hh index a7b9d363db8..e4ffa9f5e17 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.hh +++ b/source/blender/editors/sculpt_paint/sculpt_intern.hh @@ -1618,7 +1618,7 @@ void SCULPT_cache_free(StrokeCache *cache); SculptUndoNode *SCULPT_undo_push_node(Object *ob, PBVHNode *node, SculptUndoType type); SculptUndoNode *SCULPT_undo_get_node(PBVHNode *node, SculptUndoType type); -SculptUndoNode *SCULPT_undo_get_first_node(void); +SculptUndoNode *SCULPT_undo_get_first_node(); /** * Pushes an undo step using the operator name. This is necessary for diff --git a/source/blender/editors/space_action/action_intern.hh b/source/blender/editors/space_action/action_intern.hh index 115e9800e3e..3036f03605f 100644 --- a/source/blender/editors/space_action/action_intern.hh +++ b/source/blender/editors/space_action/action_intern.hh @@ -130,5 +130,5 @@ enum eActKeys_Mirror_Mode { /* ***************************************** */ /* `action_ops.cc` */ -void action_operatortypes(void); +void action_operatortypes(); void action_keymap(wmKeyConfig *keyconf); diff --git a/source/blender/editors/space_file/file_intern.hh b/source/blender/editors/space_file/file_intern.hh index 4c26fbcceee..ea15384139b 100644 --- a/source/blender/editors/space_file/file_intern.hh +++ b/source/blender/editors/space_file/file_intern.hh @@ -76,7 +76,7 @@ void FILE_OT_hidedot(wmOperatorType *ot); void FILE_OT_execute(wmOperatorType *ot); void FILE_OT_external_operation(wmOperatorType *ot); -void file_external_operations_menu_register(void); +void file_external_operations_menu_register(); /** * Variation of #FILE_OT_execute that accounts for some mouse specific handling. @@ -142,7 +142,7 @@ FileAttributeColumnType file_attribute_column_type_find_isect(const View2D *v2d, int x); float file_string_width(const char *str); -float file_font_pointsize(void); +float file_font_pointsize(); void file_select_deselect_all(SpaceFile *sfile, eDirEntry_SelectFlag flag); int file_select_match(SpaceFile *sfile, const char *pattern, char *matched_file); int autocomplete_directory(bContext *C, char *str, void *arg_v); @@ -235,7 +235,7 @@ namespace blender::asset_system { class AssetLibrary; } -FileAssetCatalogFilterSettingsHandle *file_create_asset_catalog_filter_settings(void); +FileAssetCatalogFilterSettingsHandle *file_create_asset_catalog_filter_settings(); void file_delete_asset_catalog_filter_settings( FileAssetCatalogFilterSettingsHandle **filter_settings_handle); /** diff --git a/source/blender/editors/space_file/filelist.hh b/source/blender/editors/space_file/filelist.hh index 0bb86591164..369048ae53f 100644 --- a/source/blender/editors/space_file/filelist.hh +++ b/source/blender/editors/space_file/filelist.hh @@ -69,8 +69,8 @@ void filelist_filter(FileList *filelist); */ void filelist_setlibrary(FileList *filelist, const AssetLibraryReference *asset_library_ref); -void filelist_init_icons(void); -void filelist_free_icons(void); +void filelist_init_icons(); +void filelist_free_icons(); void filelist_file_get_full_path(const FileList *filelist, const FileDirEntry *file, char r_filepath[/*FILE_MAX_LIBEXTRA*/]); diff --git a/source/blender/editors/space_nla/nla_intern.hh b/source/blender/editors/space_nla/nla_intern.hh index 7b91a03199c..fdcf681b281 100644 --- a/source/blender/editors/space_nla/nla_intern.hh +++ b/source/blender/editors/space_nla/nla_intern.hh @@ -149,5 +149,5 @@ bool nlaedit_is_tweakmode_on(bAnimContext *ac); /* --- */ -void nla_operatortypes(void); +void nla_operatortypes(); void nla_keymap(wmKeyConfig *keyconf); diff --git a/source/blender/editors/space_outliner/outliner_intern.hh b/source/blender/editors/space_outliner/outliner_intern.hh index 67c9a594865..309f710f7b9 100644 --- a/source/blender/editors/space_outliner/outliner_intern.hh +++ b/source/blender/editors/space_outliner/outliner_intern.hh @@ -491,7 +491,7 @@ void outliner_item_openclose(TreeElement *te, bool open, bool toggle_all); /** * Region drop-box definition. */ -void outliner_dropboxes(void); +void outliner_dropboxes(); void OUTLINER_OT_item_drag_drop(wmOperatorType *ot); void OUTLINER_OT_parent_drop(wmOperatorType *ot); @@ -565,7 +565,7 @@ void OUTLINER_OT_delete(wmOperatorType *ot); /* `outliner_ops.cc` */ -void outliner_operatortypes(void); +void outliner_operatortypes(); void outliner_keymap(wmKeyConfig *keyconf); /* `outliner_collections.cc` */ diff --git a/source/blender/editors/space_text/text_intern.hh b/source/blender/editors/space_text/text_intern.hh index 16a847c7453..65459b6139b 100644 --- a/source/blender/editors/space_text/text_intern.hh +++ b/source/blender/editors/space_text/text_intern.hh @@ -81,7 +81,7 @@ void text_drawcache_tag_update(SpaceText *st, bool full); void text_free_caches(SpaceText *st); bool text_do_suggest_select(SpaceText *st, ARegion *region, const int mval[2]); -void text_pop_suggest_list(void); +void text_pop_suggest_list(); int text_get_visible_lines(const SpaceText *st, ARegion *region, const char *str); int text_get_span_wrap(const SpaceText *st, ARegion *region, TextLine *from, TextLine *to); diff --git a/source/blender/gpu/intern/gpu_shader_create_info_private.hh b/source/blender/gpu/intern/gpu_shader_create_info_private.hh index 3b809d9b82f..f7b37b0ec25 100644 --- a/source/blender/gpu/intern/gpu_shader_create_info_private.hh +++ b/source/blender/gpu/intern/gpu_shader_create_info_private.hh @@ -19,10 +19,10 @@ extern "C" { #endif -void gpu_shader_create_info_init(void); -void gpu_shader_create_info_exit(void); +void gpu_shader_create_info_init(); +void gpu_shader_create_info_exit(); -bool gpu_shader_create_info_compile_all(void); +bool gpu_shader_create_info_compile_all(); /** Runtime create infos are not registered in the dictionary and cannot be searched. */ const GPUShaderCreateInfo *gpu_shader_create_info_get(const char *info_name); diff --git a/source/blender/render/intern/pipeline.cc b/source/blender/render/intern/pipeline.cc index 67c67a2871a..1bc6f0efaa9 100644 --- a/source/blender/render/intern/pipeline.cc +++ b/source/blender/render/intern/pipeline.cc @@ -87,7 +87,7 @@ #include "GPU_context.h" #include "WM_api.hh" -#include "wm_window.h" +#include "wm_window.hh" #ifdef WITH_FREESTYLE # include "FRS_freestyle.h" diff --git a/source/blender/windowmanager/CMakeLists.txt b/source/blender/windowmanager/CMakeLists.txt index a8b9c174b5b..c3c52bcf18a 100644 --- a/source/blender/windowmanager/CMakeLists.txt +++ b/source/blender/windowmanager/CMakeLists.txt @@ -79,14 +79,14 @@ set(SRC WM_message.hh WM_toolsystem.h WM_types.hh - wm.h + wm.hh wm_cursors.hh - wm_draw.h + wm_draw.hh wm_event_system.h wm_event_types.hh wm_files.hh wm_surface.hh - wm_window.h + wm_window.hh intern/wm_platform_support.h intern/wm_window_private.h gizmo/WM_gizmo_api.h diff --git a/source/blender/windowmanager/WM_api.hh b/source/blender/windowmanager/WM_api.hh index 41013ad5dd5..1c53cc59417 100644 --- a/source/blender/windowmanager/WM_api.hh +++ b/source/blender/windowmanager/WM_api.hh @@ -37,13 +37,20 @@ struct View3D; struct ViewLayer; struct bContext; struct rcti; +struct WorkSpace; +struct WorkSpaceLayout; struct wmDrag; struct wmDropBox; struct wmEvent; +struct wmEventHandler_Dropbox; struct wmEventHandler_Keymap; +struct wmEventHandler_Op; struct wmEventHandler_UI; struct wmGenericUserData; struct wmGesture; +struct wmGizmo; +struct wmGizmoMap; +struct wmGizmoMapType; struct wmJob; struct wmOperator; struct wmOperatorType; @@ -56,18 +63,12 @@ struct wmNDOFMotionData; #ifdef WITH_XR_OPENXR struct wmXrRuntimeData; +struct wmXrSessionState; #endif -typedef struct wmGizmo wmGizmo; -typedef struct wmGizmoMap wmGizmoMap; -typedef struct wmGizmoMapType wmGizmoMapType; -typedef struct wmJob wmJob; - -#ifdef __cplusplus namespace blender::asset_system { class AssetRepresentation; } -#endif /* General API. */ @@ -78,7 +79,7 @@ class AssetRepresentation; * - NULL: clears override. */ void WM_init_state_app_template_set(const char *app_template); -const char *WM_init_state_app_template_get(void); +const char *WM_init_state_app_template_get(); /** * Called when no ghost system was initialized. @@ -87,19 +88,19 @@ void WM_init_state_size_set(int stax, int stay, int sizx, int sizy); /** * For border-less and border windows set from command-line. */ -void WM_init_state_fullscreen_set(void); -void WM_init_state_normal_set(void); -void WM_init_state_maximized_set(void); +void WM_init_state_fullscreen_set(); +void WM_init_state_normal_set(); +void WM_init_state_maximized_set(); void WM_init_state_start_with_console_set(bool value); void WM_init_window_focus_set(bool do_it); void WM_init_native_pixels(bool do_it); -void WM_init_input_devices(void); +void WM_init_input_devices(); /** * Initialize Blender and load the startup file & preferences * (only called once). */ -void WM_init(struct bContext *C, int argc, const char **argv); +void WM_init(bContext *C, int argc, const char **argv); /** * Main exit function (implementation). * @@ -116,7 +117,7 @@ void WM_init(struct bContext *C, int argc, const char **argv); * Set to false in background mode or when exiting because of failed command line argument parsing. * In general automated actions where the user isn't making changes should pass in false too. */ -void WM_exit_ex(struct bContext *C, bool do_python, bool do_user_exit_actions); +void WM_exit_ex(bContext *C, bool do_python, bool do_user_exit_actions); /** * Main exit function to close Blender ordinarily. @@ -129,31 +130,31 @@ void WM_exit_ex(struct bContext *C, bool do_python, bool do_user_exit_actions); * Note that any exit-code besides #EXIT_SUCCESS calls #WM_exit_ex with its `do_user_exit_actions` * argument set to false. */ -void WM_exit(struct bContext *C, int exit_code) ATTR_NORETURN; +void WM_exit(bContext *C, int exit_code) ATTR_NORETURN; -void WM_main(struct bContext *C) ATTR_NORETURN; +void WM_main(bContext *C) ATTR_NORETURN; /** * Show the splash screen as needed on startup. * * The splash may not show depending on a file being loaded and user preferences. */ -void WM_init_splash_on_startup(struct bContext *C); +void WM_init_splash_on_startup(bContext *C); /** * Show the splash screen. */ -void WM_init_splash(struct bContext *C); +void WM_init_splash(bContext *C); -void WM_init_gpu(void); +void WM_init_gpu(); /** * Return an identifier for the underlying GHOST implementation. * \warning Use of this function should be limited & never for compatibility checks. * see: #GHOST_ISystem::getSystemBackend for details. */ -const char *WM_ghost_backend(void); +const char *WM_ghost_backend(); -typedef enum eWM_CapabilitiesFlag { +enum eWM_CapabilitiesFlag { /** Ability to warp the cursor (set its location). */ WM_CAPABILITY_CURSOR_WARP = (1 << 0), /** Ability to access window positions & move them. */ @@ -171,19 +172,19 @@ typedef enum eWM_CapabilitiesFlag { WM_CAPABILITY_CLIPBOARD_IMAGES = (1 << 4), /** The initial value, indicates the value needs to be set by inspecting GHOST. */ WM_CAPABILITY_INITIALIZED = (1 << 31), -} eWM_CapabilitiesFlag; +}; ENUM_OPERATORS(eWM_CapabilitiesFlag, WM_CAPABILITY_CLIPBOARD_IMAGES) -eWM_CapabilitiesFlag WM_capabilities_flag(void); +eWM_CapabilitiesFlag WM_capabilities_flag(); -void WM_check(struct bContext *C); -void WM_reinit_gizmomap_all(struct Main *bmain); +void WM_check(bContext *C); +void WM_reinit_gizmomap_all(Main *bmain); /** * Needed for cases when operators are re-registered * (when operator type pointers are stored). */ -void WM_script_tag_reload(void); +void WM_script_tag_reload(); wmWindow *WM_window_find_under_cursor(wmWindow *win, const int mval[2], int r_mval[2]); @@ -191,7 +192,7 @@ wmWindow *WM_window_find_under_cursor(wmWindow *win, const int mval[2], int r_mv * Knowing the area, return its screen. * \note This should typically be avoided, only use when the context is not available. */ -wmWindow *WM_window_find_by_area(wmWindowManager *wm, const struct ScrArea *area); +wmWindow *WM_window_find_by_area(wmWindowManager *wm, const ScrArea *area); /** * Read pixels from the front-buffer (fast). @@ -204,12 +205,12 @@ wmWindow *WM_window_find_by_area(wmWindowManager *wm, const struct ScrArea *area * \warning Drawing (swap-buffers) immediately before calling this function causes * the front-buffer state to be invalid under some EGL configurations. */ -uint8_t *WM_window_pixels_read_from_frontbuffer(const struct wmWindowManager *wm, - const struct wmWindow *win, +uint8_t *WM_window_pixels_read_from_frontbuffer(const wmWindowManager *wm, + const wmWindow *win, int r_size[2]); /** A version of #WM_window_pixels_read_from_frontbuffer that samples a pixel at `pos`. */ void WM_window_pixels_read_sample_from_frontbuffer(const wmWindowManager *wm, - const struct wmWindow *win, + const wmWindow *win, const int pos[2], float r_col[3]); @@ -220,12 +221,10 @@ void WM_window_pixels_read_sample_from_frontbuffer(const wmWindowManager *wm, * \note This is needed because the state of the front-buffer may be damaged * (see in-line code comments for details). */ -uint8_t *WM_window_pixels_read_from_offscreen(struct bContext *C, - struct wmWindow *win, - int r_size[2]); +uint8_t *WM_window_pixels_read_from_offscreen(bContext *C, wmWindow *win, int r_size[2]); /** A version of #WM_window_pixels_read_from_offscreen that samples a pixel at `pos`. */ -bool WM_window_pixels_read_sample_from_offscreen(struct bContext *C, - struct wmWindow *win, +bool WM_window_pixels_read_sample_from_offscreen(bContext *C, + wmWindow *win, const int pos[2], float r_col[3]); @@ -234,99 +233,85 @@ bool WM_window_pixels_read_sample_from_offscreen(struct bContext *C, * * \note Use off-screen drawing when front-buffer reading is not supported. */ -uint8_t *WM_window_pixels_read(struct bContext *C, struct wmWindow *win, int r_size[2]); +uint8_t *WM_window_pixels_read(bContext *C, wmWindow *win, int r_size[2]); /** * Read a single pixel from the screen. * * \note Use off-screen drawing when front-buffer reading is not supported. */ -bool WM_window_pixels_read_sample(struct bContext *C, - struct wmWindow *win, - const int pos[2], - float r_col[3]); +bool WM_window_pixels_read_sample(bContext *C, wmWindow *win, const int pos[2], float r_col[3]); /** * Support for native pixel size * * \note macOS retina opens window in size X, but it has up to 2 x more pixels. */ -int WM_window_pixels_x(const struct wmWindow *win); -int WM_window_pixels_y(const struct wmWindow *win); +int WM_window_pixels_x(const wmWindow *win); +int WM_window_pixels_y(const wmWindow *win); /** * Get boundaries usable by all window contents, including global areas. */ -void WM_window_rect_calc(const struct wmWindow *win, struct rcti *r_rect); +void WM_window_rect_calc(const wmWindow *win, rcti *r_rect); /** * Get boundaries usable by screen-layouts, excluding global areas. * \note Depends on #UI_SCALE_FAC. Should that be outdated, call #WM_window_set_dpi first. */ -void WM_window_screen_rect_calc(const struct wmWindow *win, struct rcti *r_rect); -bool WM_window_is_fullscreen(const struct wmWindow *win); -bool WM_window_is_maximized(const struct wmWindow *win); +void WM_window_screen_rect_calc(const wmWindow *win, rcti *r_rect); +bool WM_window_is_fullscreen(const wmWindow *win); +bool WM_window_is_maximized(const wmWindow *win); /** * 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 visible work-spaces and their visible layouts. */ -void WM_windows_scene_data_sync(const ListBase *win_lb, struct Scene *scene) ATTR_NONNULL(); -struct Scene *WM_windows_scene_get_from_screen(const struct wmWindowManager *wm, - const struct bScreen *screen) +void WM_windows_scene_data_sync(const ListBase *win_lb, Scene *scene) ATTR_NONNULL(); +Scene *WM_windows_scene_get_from_screen(const wmWindowManager *wm, const bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; -struct ViewLayer *WM_windows_view_layer_get_from_screen(const struct wmWindowManager *wm, - const struct bScreen *screen) +ViewLayer *WM_windows_view_layer_get_from_screen(const wmWindowManager *wm, const bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; -struct WorkSpace *WM_windows_workspace_get_from_screen(const wmWindowManager *wm, - const struct bScreen *screen) +WorkSpace *WM_windows_workspace_get_from_screen(const wmWindowManager *wm, const bScreen *screen) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; -struct Scene *WM_window_get_active_scene(const struct wmWindow *win) - ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; +Scene *WM_window_get_active_scene(const wmWindow *win) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; /** * \warning Only call outside of area/region loops. */ -void WM_window_set_active_scene(struct Main *bmain, - struct bContext *C, - struct wmWindow *win, - struct Scene *scene_new) ATTR_NONNULL(); -struct WorkSpace *WM_window_get_active_workspace(const struct wmWindow *win) +void WM_window_set_active_scene(Main *bmain, bContext *C, wmWindow *win, Scene *scene_new) + ATTR_NONNULL(); +WorkSpace *WM_window_get_active_workspace(const wmWindow *win) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; -void WM_window_set_active_workspace(struct bContext *C, - struct wmWindow *win, - struct WorkSpace *workspace) ATTR_NONNULL(1); -struct WorkSpaceLayout *WM_window_get_active_layout(const struct wmWindow *win) +void WM_window_set_active_workspace(bContext *C, wmWindow *win, WorkSpace *workspace) + ATTR_NONNULL(1); +WorkSpaceLayout *WM_window_get_active_layout(const wmWindow *win) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; -void WM_window_set_active_layout(struct wmWindow *win, - struct WorkSpace *workspace, - struct WorkSpaceLayout *layout) ATTR_NONNULL(1); +void WM_window_set_active_layout(wmWindow *win, WorkSpace *workspace, WorkSpaceLayout *layout) + ATTR_NONNULL(1); /** * Get the active screen of the active workspace in \a win. */ -struct bScreen *WM_window_get_active_screen(const struct wmWindow *win) - ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; -void WM_window_set_active_screen(struct wmWindow *win, - struct WorkSpace *workspace, - struct bScreen *screen) ATTR_NONNULL(1); - -struct ViewLayer *WM_window_get_active_view_layer(const struct wmWindow *win) - ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; -void WM_window_set_active_view_layer(struct wmWindow *win, struct ViewLayer *view_layer) +bScreen *WM_window_get_active_screen(const wmWindow *win) ATTR_NONNULL() ATTR_WARN_UNUSED_RESULT; +void WM_window_set_active_screen(wmWindow *win, WorkSpace *workspace, bScreen *screen) ATTR_NONNULL(1); -void WM_window_ensure_active_view_layer(struct wmWindow *win) ATTR_NONNULL(1); -bool WM_window_is_temp_screen(const struct wmWindow *win) ATTR_WARN_UNUSED_RESULT; +ViewLayer *WM_window_get_active_view_layer(const wmWindow *win) + ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +void WM_window_set_active_view_layer(wmWindow *win, ViewLayer *view_layer) ATTR_NONNULL(1); +void WM_window_ensure_active_view_layer(wmWindow *win) ATTR_NONNULL(1); -void *WM_system_gpu_context_create(void); +bool WM_window_is_temp_screen(const wmWindow *win) ATTR_WARN_UNUSED_RESULT; + +void *WM_system_gpu_context_create(); void WM_system_gpu_context_dispose(void *context); void WM_system_gpu_context_activate(void *context); void WM_system_gpu_context_release(void *context); /* #WM_window_open alignment */ -typedef enum eWindowAlignment { +enum eWindowAlignment { WIN_ALIGN_ABSOLUTE = 0, WIN_ALIGN_LOCATION_CENTER, WIN_ALIGN_PARENT_CENTER, -} eWindowAlignment; +}; /** * \param rect: Position & size of the window. @@ -341,63 +326,61 @@ typedef enum eWindowAlignment { * \param area_setup_user_data: User data argument passed to `area_setup_fn`. * \return the window or NULL in case of failure. */ -struct wmWindow *WM_window_open(struct bContext *C, - const char *title, - const struct rcti *rect_unscaled, - int space_type, - bool toplevel, - bool dialog, - bool temp, - eWindowAlignment alignment, - void (*area_setup_fn)(bScreen *screen, - ScrArea *area, - void *user_data), - void *area_setup_user_data) ATTR_NONNULL(1, 2, 3); +wmWindow *WM_window_open(bContext *C, + const char *title, + const rcti *rect_unscaled, + int space_type, + bool toplevel, + bool dialog, + bool temp, + eWindowAlignment alignment, + void (*area_setup_fn)(bScreen *screen, ScrArea *area, void *user_data), + void *area_setup_user_data) ATTR_NONNULL(1, 2, 3); void WM_window_set_dpi(const wmWindow *win); -bool WM_stereo3d_enabled(struct wmWindow *win, bool only_fullscreen_test); +bool WM_stereo3d_enabled(wmWindow *win, bool only_fullscreen_test); /* wm_files.cc */ void WM_file_autoexec_init(const char *filepath); -bool WM_file_read(struct bContext *C, const char *filepath, struct ReportList *reports); -void WM_file_autosave_init(struct wmWindowManager *wm); -bool WM_file_recover_last_session(struct bContext *C, struct ReportList *reports); -void WM_file_tag_modified(void); +bool WM_file_read(bContext *C, const char *filepath, ReportList *reports); +void WM_file_autosave_init(wmWindowManager *wm); +bool WM_file_recover_last_session(bContext *C, ReportList *reports); +void WM_file_tag_modified(); /** * \note `scene` (and related `view_layer` and `v3d`) pointers may be NULL, * in which case no instantiation of linked objects, collections etc. will be performed. */ -struct ID *WM_file_link_datablock(struct Main *bmain, - struct Scene *scene, - struct ViewLayer *view_layer, - struct View3D *v3d, - const char *filepath, - short id_code, - const char *id_name, - int flag); +ID *WM_file_link_datablock(Main *bmain, + Scene *scene, + ViewLayer *view_layer, + View3D *v3d, + const char *filepath, + short id_code, + const char *id_name, + int flag); /** * \note `scene` (and related `view_layer` and `v3d`) pointers may be NULL, * in which case no instantiation of appended objects, collections etc. will be performed. */ -struct ID *WM_file_append_datablock(struct Main *bmain, - struct Scene *scene, - struct ViewLayer *view_layer, - struct View3D *v3d, - const char *filepath, - short id_code, - const char *id_name, - int flag); -void WM_lib_reload(struct Library *lib, struct bContext *C, struct ReportList *reports); +ID *WM_file_append_datablock(Main *bmain, + Scene *scene, + ViewLayer *view_layer, + View3D *v3d, + const char *filepath, + short id_code, + const char *id_name, + int flag); +void WM_lib_reload(Library *lib, bContext *C, ReportList *reports); /* Mouse cursors. */ -void WM_cursor_set(struct wmWindow *win, int curs); -bool WM_cursor_set_from_tool(struct wmWindow *win, const ScrArea *area, const ARegion *region); -void WM_cursor_modal_set(struct wmWindow *win, int val); -void WM_cursor_modal_restore(struct wmWindow *win); +void WM_cursor_set(wmWindow *win, int curs); +bool WM_cursor_set_from_tool(wmWindow *win, const ScrArea *area, const ARegion *region); +void WM_cursor_modal_set(wmWindow *win, int val); +void WM_cursor_modal_restore(wmWindow *win); /** * To allow usage all over, we do entire WM. */ @@ -412,28 +395,25 @@ void WM_cursor_wait(bool val); * * \note The current grab state can be accessed by #wmWindowManager.grabcursor although. */ -void WM_cursor_grab_enable(struct wmWindow *win, +void WM_cursor_grab_enable(wmWindow *win, eWM_CursorWrapAxis wrap, - const struct rcti *wrap_region, + const rcti *wrap_region, bool hide); -void WM_cursor_grab_disable(struct wmWindow *win, const int mouse_ungrab_xy[2]); +void WM_cursor_grab_disable(wmWindow *win, const int mouse_ungrab_xy[2]); /** * After this you can call restore too. */ -void WM_cursor_time(struct wmWindow *win, int nr); +void WM_cursor_time(wmWindow *win, int nr); -struct wmPaintCursor *WM_paint_cursor_activate( - short space_type, - short region_type, - bool (*poll)(struct bContext *C), - void (*draw)(struct bContext *C, int, int, void *customdata), - void *customdata); +wmPaintCursor *WM_paint_cursor_activate(short space_type, + short region_type, + bool (*poll)(bContext *C), + void (*draw)(bContext *C, int, int, void *customdata), + void *customdata); -bool WM_paint_cursor_end(struct wmPaintCursor *handle); -void WM_paint_cursor_remove_by_type(struct wmWindowManager *wm, - void *draw_fn, - void (*free)(void *)); -void WM_paint_cursor_tag_redraw(struct wmWindow *win, struct ARegion *region); +bool WM_paint_cursor_end(wmPaintCursor *handle); +void WM_paint_cursor_remove_by_type(wmWindowManager *wm, void *draw_fn, void (*free)(void *)); +void WM_paint_cursor_tag_redraw(wmWindow *win, ARegion *region); /** * Set the cursor location in window coordinates (compatible with #wmEvent.xy). @@ -441,11 +421,11 @@ void WM_paint_cursor_tag_redraw(struct wmWindow *win, struct ARegion *region); * \note Some platforms don't support this, check: #WM_CAPABILITY_WINDOW_POSITION * before relying on this functionality. */ -void WM_cursor_warp(struct wmWindow *win, int x, int y); +void WM_cursor_warp(wmWindow *win, int x, int y); /* Handlers. */ -typedef enum eWM_EventHandlerFlag { +enum eWM_EventHandlerFlag { /** After this handler all others are ignored. */ WM_HANDLER_BLOCKING = (1 << 0), /** Handler accepts double key press events. */ @@ -454,78 +434,72 @@ typedef enum eWM_EventHandlerFlag { /* Internal. */ /** Handler tagged to be freed in #wm_handlers_do(). */ WM_HANDLER_DO_FREE = (1 << 7), -} eWM_EventHandlerFlag; +}; ENUM_OPERATORS(eWM_EventHandlerFlag, WM_HANDLER_DO_FREE) -typedef bool (*EventHandlerPoll)(const ARegion *region, const struct wmEvent *event); -struct wmEventHandler_Keymap *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap); -struct wmEventHandler_Keymap *WM_event_add_keymap_handler_poll(ListBase *handlers, - wmKeyMap *keymap, - EventHandlerPoll poll); -struct wmEventHandler_Keymap *WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, - wmKeyMap *keymap); +using EventHandlerPoll = bool (*)(const ARegion *region, const wmEvent *event); +wmEventHandler_Keymap *WM_event_add_keymap_handler(ListBase *handlers, wmKeyMap *keymap); +wmEventHandler_Keymap *WM_event_add_keymap_handler_poll(ListBase *handlers, + wmKeyMap *keymap, + EventHandlerPoll poll); +wmEventHandler_Keymap *WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap); /** * \note Priorities not implemented yet, for time being just insert in begin of list. */ -struct wmEventHandler_Keymap *WM_event_add_keymap_handler_priority(ListBase *handlers, - wmKeyMap *keymap, - int priority); +wmEventHandler_Keymap *WM_event_add_keymap_handler_priority(ListBase *handlers, + wmKeyMap *keymap, + int priority); -typedef struct wmEventHandler_KeymapResult { +struct wmEventHandler_KeymapResult { wmKeyMap *keymaps[3]; int keymaps_len; -} wmEventHandler_KeymapResult; +}; -typedef void(wmEventHandler_KeymapDynamicFn)(wmWindowManager *wm, - struct wmWindow *win, - struct wmEventHandler_Keymap *handler, - struct wmEventHandler_KeymapResult *km_result); +using wmEventHandler_KeymapDynamicFn = void (*)(wmWindowManager *wm, + wmWindow *win, + wmEventHandler_Keymap *handler, + wmEventHandler_KeymapResult *km_result); -void WM_event_get_keymap_from_toolsystem_with_gizmos(struct wmWindowManager *wm, - struct wmWindow *win, - struct wmEventHandler_Keymap *handler, +void WM_event_get_keymap_from_toolsystem_with_gizmos(wmWindowManager *wm, + wmWindow *win, + wmEventHandler_Keymap *handler, wmEventHandler_KeymapResult *km_result); -void WM_event_get_keymap_from_toolsystem(struct wmWindowManager *wm, - struct wmWindow *win, - struct wmEventHandler_Keymap *handler, +void WM_event_get_keymap_from_toolsystem(wmWindowManager *wm, + wmWindow *win, + wmEventHandler_Keymap *handler, wmEventHandler_KeymapResult *km_result); -struct wmEventHandler_Keymap *WM_event_add_keymap_handler_dynamic( - ListBase *handlers, wmEventHandler_KeymapDynamicFn *keymap_fn, void *user_data); +wmEventHandler_Keymap *WM_event_add_keymap_handler_dynamic( + ListBase *handlers, wmEventHandler_KeymapDynamicFn keymap_fn, void *user_data); void WM_event_remove_keymap_handler(ListBase *handlers, wmKeyMap *keymap); -void WM_event_set_keymap_handler_post_callback(struct wmEventHandler_Keymap *handler, +void WM_event_set_keymap_handler_post_callback(wmEventHandler_Keymap *handler, void(keymap_tag)(wmKeyMap *keymap, wmKeyMapItem *kmi, void *user_data), void *user_data); void WM_event_get_keymaps_from_handler(wmWindowManager *wm, - struct wmWindow *win, - struct wmEventHandler_Keymap *handler, - struct wmEventHandler_KeymapResult *km_result); + wmWindow *win, + wmEventHandler_Keymap *handler, + wmEventHandler_KeymapResult *km_result); -wmKeyMapItem *WM_event_match_keymap_item(struct bContext *C, - wmKeyMap *keymap, - const struct wmEvent *event); +wmKeyMapItem *WM_event_match_keymap_item(bContext *C, wmKeyMap *keymap, const wmEvent *event); -wmKeyMapItem *WM_event_match_keymap_item_from_handlers(struct bContext *C, - struct wmWindowManager *wm, - struct wmWindow *win, - struct ListBase *handlers, - const struct wmEvent *event); +wmKeyMapItem *WM_event_match_keymap_item_from_handlers( + bContext *C, wmWindowManager *wm, wmWindow *win, ListBase *handlers, const wmEvent *event); -bool WM_event_match(const struct wmEvent *winevent, const struct wmKeyMapItem *kmi); +bool WM_event_match(const wmEvent *winevent, const wmKeyMapItem *kmi); -typedef int (*wmUIHandlerFunc)(struct bContext *C, const struct wmEvent *event, void *userdata); -typedef void (*wmUIHandlerRemoveFunc)(struct bContext *C, void *userdata); +using wmUIHandlerFunc = int (*)(bContext *C, const wmEvent *event, void *userdata); +using wmUIHandlerRemoveFunc = void (*)(bContext *C, void *userdata); -struct wmEventHandler_UI *WM_event_add_ui_handler(const struct bContext *C, - ListBase *handlers, - wmUIHandlerFunc handle_fn, - wmUIHandlerRemoveFunc remove_fn, - void *user_data, - eWM_EventHandlerFlag flag); +wmEventHandler_UI *WM_event_add_ui_handler(const bContext *C, + ListBase *handlers, + wmUIHandlerFunc handle_fn, + wmUIHandlerRemoveFunc remove_fn, + void *user_data, + eWM_EventHandlerFlag flag); /** * Return the first modal operator of type \a ot or NULL. @@ -541,8 +515,8 @@ void WM_event_remove_ui_handler(ListBase *handlers, wmUIHandlerRemoveFunc remove_fn, void *user_data, bool postpone); -void WM_event_remove_area_handler(struct ListBase *handlers, void *area); -void WM_event_free_ui_handler_all(struct bContext *C, +void WM_event_remove_area_handler(ListBase *handlers, void *area); +void WM_event_free_ui_handler_all(bContext *C, ListBase *handlers, wmUIHandlerFunc handle_fn, wmUIHandlerRemoveFunc remove_fn); @@ -550,34 +524,32 @@ void WM_event_free_ui_handler_all(struct bContext *C, /** * Add a modal handler to `win`, `area` and `region` may optionally be NULL. */ -struct wmEventHandler_Op *WM_event_add_modal_handler_ex(struct wmWindow *win, - struct ScrArea *area, - struct ARegion *region, - wmOperator *op) ATTR_NONNULL(1, 4); -struct wmEventHandler_Op *WM_event_add_modal_handler(struct bContext *C, struct wmOperator *op) - ATTR_NONNULL(1, 2); +wmEventHandler_Op *WM_event_add_modal_handler_ex(wmWindow *win, + ScrArea *area, + ARegion *region, + wmOperator *op) ATTR_NONNULL(1, 4); +wmEventHandler_Op *WM_event_add_modal_handler(bContext *C, wmOperator *op) ATTR_NONNULL(1, 2); /** * Modal handlers store a pointer to an area which might be freed while the handler runs. * Use this function to NULL all handler pointers to \a old_area. */ void WM_event_modal_handler_area_replace(wmWindow *win, - const struct ScrArea *old_area, - struct ScrArea *new_area); + const ScrArea *old_area, + ScrArea *new_area); /** * Modal handlers store a pointer to a region which might be freed while the handler runs. * Use this function to NULL all handler pointers to \a old_region. */ void WM_event_modal_handler_region_replace(wmWindow *win, - const struct ARegion *old_region, - struct ARegion *new_region); + const ARegion *old_region, + ARegion *new_region); /** * Called on exit or remove area, only here call cancel callback. */ -void WM_event_remove_handlers(struct bContext *C, ListBase *handlers); +void WM_event_remove_handlers(bContext *C, ListBase *handlers); -struct wmEventHandler_Dropbox *WM_event_add_dropbox_handler(ListBase *handlers, - ListBase *dropboxes); +wmEventHandler_Dropbox *WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes); /* mouse */ void WM_event_add_mousemove(wmWindow *win); @@ -587,50 +559,46 @@ void WM_event_add_mousemove(wmWindow *win); void WM_ndof_deadzone_set(float deadzone); #endif /* notifiers */ -void WM_event_add_notifier_ex(struct wmWindowManager *wm, - const struct wmWindow *win, +void WM_event_add_notifier_ex(wmWindowManager *wm, + const wmWindow *win, unsigned int type, void *reference); -void WM_event_add_notifier(const struct bContext *C, unsigned int type, void *reference); +void WM_event_add_notifier(const bContext *C, unsigned int type, void *reference); void WM_main_add_notifier(unsigned int type, void *reference); /** * Clear notifiers by reference, Used so listeners don't act on freed data. */ void WM_main_remove_notifier_reference(const void *reference); -void WM_main_remap_editor_id_reference(const struct IDRemapper *mappings); +void WM_main_remap_editor_id_reference(const IDRemapper *mappings); /* reports */ /** * Show the report in the info header. * \param win: When NULL, a best-guess is used. */ -void WM_report_banner_show(struct wmWindowManager *wm, struct wmWindow *win) ATTR_NONNULL(1); +void WM_report_banner_show(wmWindowManager *wm, wmWindow *win) ATTR_NONNULL(1); /** * Hide all currently displayed banners and abort their timer. */ -void WM_report_banners_cancel(struct Main *bmain); +void WM_report_banners_cancel(Main *bmain); void WM_report(eReportType type, const char *message); void WM_reportf(eReportType type, const char *format, ...) ATTR_PRINTF_FORMAT(2, 3); -struct wmEvent *wm_event_add_ex(struct wmWindow *win, - const struct wmEvent *event_to_add, - const struct wmEvent *event_to_add_after) ATTR_NONNULL(1, 2); -struct wmEvent *wm_event_add(struct wmWindow *win, const struct wmEvent *event_to_add) - ATTR_NONNULL(1, 2); +wmEvent *wm_event_add_ex(wmWindow *win, + const wmEvent *event_to_add, + const wmEvent *event_to_add_after) ATTR_NONNULL(1, 2); +wmEvent *wm_event_add(wmWindow *win, const wmEvent *event_to_add) ATTR_NONNULL(1, 2); -void wm_event_init_from_window(struct wmWindow *win, struct wmEvent *event); +void wm_event_init_from_window(wmWindow *win, wmEvent *event); /* at maximum, every timestep seconds it triggers event_type events */ -struct wmTimer *WM_event_timer_add(struct wmWindowManager *wm, - struct wmWindow *win, - int event_type, - double timestep); -struct wmTimer *WM_event_timer_add_notifier(struct wmWindowManager *wm, - struct wmWindow *win, - unsigned int type, - double timestep); +wmTimer *WM_event_timer_add(wmWindowManager *wm, wmWindow *win, int event_type, double timestep); +wmTimer *WM_event_timer_add_notifier(wmWindowManager *wm, + wmWindow *win, + unsigned int type, + double timestep); -void WM_event_timer_free_data(struct wmTimer *timer); +void WM_event_timer_free_data(wmTimer *timer); /** * Free all timers immediately. * @@ -641,19 +609,12 @@ void WM_event_timers_free_all(wmWindowManager *wm); /** Mark the given `timer` to be removed, actual removal and deletion is deferred and handled * internally by the window manager code. */ -void WM_event_timer_remove(struct wmWindowManager *wm, - struct wmWindow *win, - struct wmTimer *timer); -void WM_event_timer_remove_notifier(struct wmWindowManager *wm, - struct wmWindow *win, - struct wmTimer *timer); +void WM_event_timer_remove(wmWindowManager *wm, wmWindow *win, wmTimer *timer); +void WM_event_timer_remove_notifier(wmWindowManager *wm, wmWindow *win, wmTimer *timer); /** * To (de)activate running timers temporary. */ -void WM_event_timer_sleep(struct wmWindowManager *wm, - struct wmWindow *win, - struct wmTimer *timer, - bool do_sleep); +void WM_event_timer_sleep(wmWindowManager *wm, wmWindow *win, wmTimer *timer, bool do_sleep); /* Operator API, default callbacks. */ @@ -664,9 +625,7 @@ void WM_event_timer_sleep(struct wmWindowManager *wm, * To be used together with #WM_generic_select_invoke() and * #WM_operator_properties_generic_select(). */ -int WM_generic_select_modal(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); +int WM_generic_select_modal(bContext *C, wmOperator *op, const wmEvent *event); /** * Helper to get select and tweak-transform to work conflict free and as desired. See * #WM_operator_properties_generic_select() for details. @@ -674,85 +633,71 @@ int WM_generic_select_modal(struct bContext *C, * To be used together with #WM_generic_select_modal() and * #WM_operator_properties_generic_select(). */ -int WM_generic_select_invoke(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -void WM_operator_view3d_unit_defaults(struct bContext *C, struct wmOperator *op); -int WM_operator_smooth_viewtx_get(const struct wmOperator *op); +int WM_generic_select_invoke(bContext *C, wmOperator *op, const wmEvent *event); +void WM_operator_view3d_unit_defaults(bContext *C, wmOperator *op); +int WM_operator_smooth_viewtx_get(const wmOperator *op); /** * Invoke callback, uses enum property named "type". */ -int WM_menu_invoke_ex(struct bContext *C, struct wmOperator *op, wmOperatorCallContext opcontext); -int WM_menu_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_menu_invoke_ex(bContext *C, wmOperator *op, wmOperatorCallContext opcontext); +int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *event); /** * Call an existent menu. The menu can be created in C or Python. */ -void WM_menu_name_call(struct bContext *C, const char *menu_name, short context); +void WM_menu_name_call(bContext *C, const char *menu_name, short context); /** * Similar to #WM_enum_search_invoke, but draws previews. Also, this can't * be used as invoke callback directly since it needs additional info. */ -int WM_enum_search_invoke_previews(struct bContext *C, - struct wmOperator *op, - short prv_cols, - short prv_rows); -int WM_enum_search_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); +int WM_enum_search_invoke_previews(bContext *C, wmOperator *op, short prv_cols, short prv_rows); +int WM_enum_search_invoke(bContext *C, wmOperator *op, const wmEvent *event); /** * Invoke callback, confirm menu + exec. */ -int WM_operator_confirm(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); -int WM_operator_confirm_or_exec(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); +int WM_operator_confirm(bContext *C, wmOperator *op, const wmEvent *event); +int WM_operator_confirm_or_exec(bContext *C, wmOperator *op, const wmEvent *event); /** * Invoke callback, file selector "filepath" unset + exec. * * #wmOperatorType.invoke, opens file-select if path property not set, otherwise executes. */ -int WM_operator_filesel(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); -bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, - const struct ImageFormatData *im_format); +int WM_operator_filesel(bContext *C, wmOperator *op, const wmEvent *event); +bool WM_operator_filesel_ensure_ext_imtype(wmOperator *op, const ImageFormatData *im_format); /** Callback for #wmOperatorType.poll */ -bool WM_operator_winactive(struct bContext *C); +bool WM_operator_winactive(bContext *C); /** * Invoke callback, exec + redo popup. * * Same as #WM_operator_props_popup but don't use operator redo. * just wraps #WM_operator_props_dialog_popup. */ -int WM_operator_props_popup_confirm(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); +int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent *event); /** * Same as #WM_operator_props_popup but call the operator first, * This way - the button values correspond to the result of the operator. * Without this, first access to a button will make the result jump, see #32452. */ -int WM_operator_props_popup_call(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -int WM_operator_props_popup(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -int WM_operator_props_dialog_popup(struct bContext *C, struct wmOperator *op, int width); -int WM_operator_redo_popup(struct bContext *C, struct wmOperator *op); -int WM_operator_ui_popup(struct bContext *C, struct wmOperator *op, int width); +int WM_operator_props_popup_call(bContext *C, wmOperator *op, const wmEvent *event); +int WM_operator_props_popup(bContext *C, wmOperator *op, const wmEvent *event); +int WM_operator_props_dialog_popup(bContext *C, wmOperator *op, int width); +int WM_operator_redo_popup(bContext *C, wmOperator *op); +int WM_operator_ui_popup(bContext *C, wmOperator *op, int width); /** * Can't be used as an invoke directly, needs message arg (can be NULL). */ -int WM_operator_confirm_message_ex(struct bContext *C, - struct wmOperator *op, +int WM_operator_confirm_message_ex(bContext *C, + wmOperator *op, const char *title, int icon, const char *message, wmOperatorCallContext opcontext); -int WM_operator_confirm_message(struct bContext *C, struct wmOperator *op, const char *message); +int WM_operator_confirm_message(bContext *C, wmOperator *op, const char *message); /* Operator API. */ -void WM_operator_free(struct wmOperator *op); -void WM_operator_free_all_after(wmWindowManager *wm, struct wmOperator *op); +void WM_operator_free(wmOperator *op); +void WM_operator_free_all_after(wmWindowManager *wm, wmOperator *op); /** * Use with extreme care! * Properties, custom-data etc - must be compatible. @@ -760,16 +705,16 @@ void WM_operator_free_all_after(wmWindowManager *wm, struct wmOperator *op); * \param op: Operator to assign the type to. * \param ot: Operator type to assign. */ -void WM_operator_type_set(struct wmOperator *op, struct wmOperatorType *ot); -void WM_operator_stack_clear(struct wmWindowManager *wm); +void WM_operator_type_set(wmOperator *op, wmOperatorType *ot); +void WM_operator_stack_clear(wmWindowManager *wm); /** * This function is needed in the case when an addon id disabled * while a modal operator it defined is running. */ -void WM_operator_handlers_clear(wmWindowManager *wm, struct wmOperatorType *ot); +void WM_operator_handlers_clear(wmWindowManager *wm, wmOperatorType *ot); -bool WM_operator_poll(struct bContext *C, struct wmOperatorType *ot); -bool WM_operator_poll_context(struct bContext *C, struct wmOperatorType *ot, short context); +bool WM_operator_poll(bContext *C, wmOperatorType *ot); +bool WM_operator_poll_context(bContext *C, wmOperatorType *ot, short context); /** * For running operators with frozen context (modal handlers, menus). * @@ -778,29 +723,29 @@ bool WM_operator_poll_context(struct bContext *C, struct wmOperatorType *ot, sho * * \warning do not use this within an operator to call itself! #29537. */ -int WM_operator_call_ex(struct bContext *C, struct wmOperator *op, bool store); -int WM_operator_call(struct bContext *C, struct wmOperator *op); +int WM_operator_call_ex(bContext *C, wmOperator *op, bool store); +int WM_operator_call(bContext *C, wmOperator *op); /** * This is intended to be used when an invoke operator wants to call exec on itself * and is basically like running op->type->exec() directly, no poll checks no freeing, * since we assume whoever called invoke will take care of that */ -int WM_operator_call_notest(struct bContext *C, struct wmOperator *op); +int WM_operator_call_notest(bContext *C, wmOperator *op); /** * Execute this operator again, put here so it can share above code */ -int WM_operator_repeat(struct bContext *C, struct wmOperator *op); -int WM_operator_repeat_last(struct bContext *C, struct wmOperator *op); +int WM_operator_repeat(bContext *C, wmOperator *op); +int WM_operator_repeat_last(bContext *C, wmOperator *op); /** * \return true if #WM_operator_repeat can run. * Simple check for now but may become more involved. * To be sure the operator can run call `WM_operator_poll(C, op->type)` also, since this call * checks if #WM_operator_repeat() can run at all, not that it WILL run at any time. */ -bool WM_operator_repeat_check(const struct bContext *C, struct wmOperator *op); -bool WM_operator_is_repeat(const struct bContext *C, const struct wmOperator *op); +bool WM_operator_repeat_check(const bContext *C, wmOperator *op); +bool WM_operator_is_repeat(const bContext *C, const wmOperator *op); -bool WM_operator_name_poll(struct bContext *C, const char *opstring); +bool WM_operator_name_poll(bContext *C, const char *opstring); /** * Invokes operator in context. * @@ -810,21 +755,21 @@ bool WM_operator_name_poll(struct bContext *C, const char *opstring); * storing the key that was pressed so as to be able to detect its release. * In these cases it's necessary to forward the current event being handled. */ -int WM_operator_name_call_ptr(struct bContext *C, - struct wmOperatorType *ot, +int WM_operator_name_call_ptr(bContext *C, + wmOperatorType *ot, wmOperatorCallContext context, - struct PointerRNA *properties, + PointerRNA *properties, const wmEvent *event); /** See #WM_operator_name_call_ptr */ -int WM_operator_name_call(struct bContext *C, +int WM_operator_name_call(bContext *C, const char *opstring, wmOperatorCallContext context, - struct PointerRNA *properties, + PointerRNA *properties, const wmEvent *event); -int WM_operator_name_call_with_properties(struct bContext *C, +int WM_operator_name_call_with_properties(bContext *C, const char *opstring, wmOperatorCallContext context, - struct IDProperty *properties, + IDProperty *properties, const wmEvent *event); /** * Similar to #WM_operator_name_call called with #WM_OP_EXEC_DEFAULT context. @@ -833,14 +778,14 @@ int WM_operator_name_call_with_properties(struct bContext *C, * - `poll()` must be called by python before this runs. * - reports can be passed to this function (so python can report them as exceptions). */ -int WM_operator_call_py(struct bContext *C, - struct wmOperatorType *ot, +int WM_operator_call_py(bContext *C, + wmOperatorType *ot, wmOperatorCallContext context, - struct PointerRNA *properties, - struct ReportList *reports, + PointerRNA *properties, + ReportList *reports, bool is_undo); -void WM_operator_name_call_ptr_with_depends_on_cursor(struct bContext *C, +void WM_operator_name_call_ptr_with_depends_on_cursor(bContext *C, wmOperatorType *ot, wmOperatorCallContext opcontext, PointerRNA *properties, @@ -850,14 +795,12 @@ void WM_operator_name_call_ptr_with_depends_on_cursor(struct bContext *C, /** * Similar to the function above except its uses ID properties used for key-maps and macros. */ -void WM_operator_properties_alloc(struct PointerRNA **ptr, - struct IDProperty **properties, - const char *opstring); +void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring); /** * Make props context sensitive or not. */ -void WM_operator_properties_sanitize(struct PointerRNA *ptr, bool no_context); +void WM_operator_properties_sanitize(PointerRNA *ptr, bool no_context); /** * Set all props to their default. @@ -867,40 +810,40 @@ void WM_operator_properties_sanitize(struct PointerRNA *ptr, bool no_context); * \note There's nothing specific to operators here. * This could be made a general function. */ -bool WM_operator_properties_default(struct PointerRNA *ptr, bool do_update); +bool WM_operator_properties_default(PointerRNA *ptr, bool do_update); /** * Remove all props without #PROP_SKIP_SAVE. */ -void WM_operator_properties_reset(struct wmOperator *op); -void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring); -void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot); -void WM_operator_properties_clear(struct PointerRNA *ptr); -void WM_operator_properties_free(struct PointerRNA *ptr); +void WM_operator_properties_reset(wmOperator *op); +void WM_operator_properties_create(PointerRNA *ptr, const char *opstring); +void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot); +void WM_operator_properties_clear(PointerRNA *ptr); +void WM_operator_properties_free(PointerRNA *ptr); -bool WM_operator_check_ui_empty(struct wmOperatorType *ot); +bool WM_operator_check_ui_empty(wmOperatorType *ot); /** * Return false, if the UI should be disabled. */ -bool WM_operator_check_ui_enabled(const struct bContext *C, const char *idname); +bool WM_operator_check_ui_enabled(const bContext *C, const char *idname); -IDProperty *WM_operator_last_properties_ensure_idprops(struct wmOperatorType *ot); -void WM_operator_last_properties_ensure(struct wmOperatorType *ot, struct PointerRNA *ptr); -wmOperator *WM_operator_last_redo(const struct bContext *C); +IDProperty *WM_operator_last_properties_ensure_idprops(wmOperatorType *ot); +void WM_operator_last_properties_ensure(wmOperatorType *ot, PointerRNA *ptr); +wmOperator *WM_operator_last_redo(const bContext *C); /** * Use for drag & drop a path or name with operators invoke() function. * Returns null if no operator property is set to identify the file or ID to use. */ -ID *WM_operator_drop_load_path(struct bContext *C, struct wmOperator *op, short idcode); +ID *WM_operator_drop_load_path(bContext *C, wmOperator *op, short idcode); -bool WM_operator_last_properties_init(struct wmOperator *op); -bool WM_operator_last_properties_store(struct wmOperator *op); +bool WM_operator_last_properties_init(wmOperator *op); +bool WM_operator_last_properties_store(wmOperator *op); /* `wm_operator_props.cc` */ -void WM_operator_properties_confirm_or_exec(struct wmOperatorType *ot); +void WM_operator_properties_confirm_or_exec(wmOperatorType *ot); /** Flags for #WM_operator_properties_filesel. */ -typedef enum eFileSel_Flag { +enum eFileSel_Flag { WM_FILESEL_RELPATH = 1 << 0, WM_FILESEL_DIRECTORY = 1 << 1, WM_FILESEL_FILENAME = 1 << 2, @@ -908,19 +851,19 @@ typedef enum eFileSel_Flag { WM_FILESEL_FILES = 1 << 4, /** Show the properties sidebar by default. */ WM_FILESEL_SHOW_PROPS = 1 << 5, -} eFileSel_Flag; +}; ENUM_OPERATORS(eFileSel_Flag, WM_FILESEL_SHOW_PROPS) /** Action for #WM_operator_properties_filesel. */ -typedef enum eFileSel_Action { +enum eFileSel_Action { FILE_OPENFILE = 0, FILE_SAVE = 1, -} eFileSel_Action; +}; /** * Default properties for file-select. */ -void WM_operator_properties_filesel(struct wmOperatorType *ot, +void WM_operator_properties_filesel(wmOperatorType *ot, int filter, short type, eFileSel_Action action, @@ -942,9 +885,9 @@ void WM_operator_properties_id_lookup_set_from_id(PointerRNA *ptr, const ID *id) * property defined and set. The former has priority. See #WM_operator_properties_id_lookup() for a * helper to add the properties. */ -struct ID *WM_operator_properties_id_lookup_from_name_or_session_uuid(struct Main *bmain, - PointerRNA *ptr, - enum ID_Type type); +ID *WM_operator_properties_id_lookup_from_name_or_session_uuid(Main *bmain, + PointerRNA *ptr, + enum ID_Type type); /** * Check if either the "session_uuid" or "name" property is set inside \a ptr. If this is the case * the ID can be looked up by #WM_operator_properties_id_lookup_from_name_or_session_uuid(). @@ -966,55 +909,53 @@ void WM_operator_properties_id_lookup(wmOperatorType *ot, const bool add_name_pr * Disable using cursor position, * use when view operators are initialized from buttons. */ -void WM_operator_properties_use_cursor_init(struct wmOperatorType *ot); -void WM_operator_properties_border(struct wmOperatorType *ot); -void WM_operator_properties_border_to_rcti(struct wmOperator *op, struct rcti *rect); -void WM_operator_properties_border_to_rctf(struct wmOperator *op, rctf *rect); +void WM_operator_properties_use_cursor_init(wmOperatorType *ot); +void WM_operator_properties_border(wmOperatorType *ot); +void WM_operator_properties_border_to_rcti(wmOperator *op, rcti *rect); +void WM_operator_properties_border_to_rctf(wmOperator *op, rctf *rect); /** * Use with #WM_gesture_box_invoke */ -void WM_operator_properties_gesture_box_ex(struct wmOperatorType *ot, bool deselect, bool extend); -void WM_operator_properties_gesture_box(struct wmOperatorType *ot); -void WM_operator_properties_gesture_box_select(struct wmOperatorType *ot); -void WM_operator_properties_gesture_box_zoom(struct wmOperatorType *ot); +void WM_operator_properties_gesture_box_ex(wmOperatorType *ot, bool deselect, bool extend); +void WM_operator_properties_gesture_box(wmOperatorType *ot); +void WM_operator_properties_gesture_box_select(wmOperatorType *ot); +void WM_operator_properties_gesture_box_zoom(wmOperatorType *ot); /** * Use with #WM_gesture_lasso_invoke */ -void WM_operator_properties_gesture_lasso(struct wmOperatorType *ot); +void WM_operator_properties_gesture_lasso(wmOperatorType *ot); /** * Use with #WM_gesture_straightline_invoke */ -void WM_operator_properties_gesture_straightline(struct wmOperatorType *ot, int cursor); +void WM_operator_properties_gesture_straightline(wmOperatorType *ot, int cursor); /** * Use with #WM_gesture_circle_invoke */ -void WM_operator_properties_gesture_circle(struct wmOperatorType *ot); +void WM_operator_properties_gesture_circle(wmOperatorType *ot); /** * See #ED_select_pick_params_from_operator to initialize parameters defined here. */ -void WM_operator_properties_mouse_select(struct wmOperatorType *ot); -void WM_operator_properties_select_all(struct wmOperatorType *ot); -void WM_operator_properties_select_action(struct wmOperatorType *ot, - int default_action, - bool hide_gui); +void WM_operator_properties_mouse_select(wmOperatorType *ot); +void WM_operator_properties_select_all(wmOperatorType *ot); +void WM_operator_properties_select_action(wmOperatorType *ot, int default_action, bool hide_gui); /** * Only for select/de-select. */ -void WM_operator_properties_select_action_simple(struct wmOperatorType *ot, +void WM_operator_properties_select_action_simple(wmOperatorType *ot, int default_action, bool hide_gui); /** * Use for all select random operators. * Adds properties: percent, seed, action. */ -void WM_operator_properties_select_random(struct wmOperatorType *ot); +void WM_operator_properties_select_random(wmOperatorType *ot); int WM_operator_properties_select_random_seed_increment_get(wmOperator *op); -void WM_operator_properties_select_operation(struct wmOperatorType *ot); +void WM_operator_properties_select_operation(wmOperatorType *ot); /** * \note Some tools don't support XOR/AND. */ -void WM_operator_properties_select_operation_simple(struct wmOperatorType *ot); -void WM_operator_properties_select_walk_direction(struct wmOperatorType *ot); +void WM_operator_properties_select_operation_simple(wmOperatorType *ot); +void WM_operator_properties_select_walk_direction(wmOperatorType *ot); /** * Selecting and tweaking items are overlapping operations. Getting both to work without conflicts * requires special care. See @@ -1040,7 +981,7 @@ void WM_operator_properties_select_walk_direction(struct wmOperatorType *ot); * Every select operator has slightly different requirements, e.g. sequencer strip selection * also needs to account for handle selection. This should be the baseline behavior though. */ -void WM_operator_properties_generic_select(struct wmOperatorType *ot); +void WM_operator_properties_generic_select(wmOperatorType *ot); struct CheckerIntervalParams { int nth; /* bypass when set to zero */ @@ -1050,10 +991,10 @@ struct CheckerIntervalParams { /** * \param nth_can_disable: Enable if we want to be able to select no interval at all. */ -void WM_operator_properties_checker_interval(struct wmOperatorType *ot, bool nth_can_disable); -void WM_operator_properties_checker_interval_from_op(struct wmOperator *op, - struct CheckerIntervalParams *op_params); -bool WM_operator_properties_checker_interval_test(const struct CheckerIntervalParams *op_params, +void WM_operator_properties_checker_interval(wmOperatorType *ot, bool nth_can_disable); +void WM_operator_properties_checker_interval_from_op(wmOperator *op, + CheckerIntervalParams *op_params); +bool WM_operator_properties_checker_interval_test(const CheckerIntervalParams *op_params, int depth); /** @@ -1067,24 +1008,18 @@ bool WM_operator_properties_checker_interval_test(const struct CheckerIntervalPa * * \note Both \a op and \a opptr may be `NULL` (\a op is only used for macro operators). */ -char *WM_operator_pystring_ex(struct bContext *C, - struct wmOperator *op, +char *WM_operator_pystring_ex(bContext *C, + wmOperator *op, bool all_args, bool macro_args, - struct wmOperatorType *ot, - struct PointerRNA *opptr); -char *WM_operator_pystring(struct bContext *C, - struct wmOperator *op, - bool all_args, - bool macro_args); + wmOperatorType *ot, + PointerRNA *opptr); +char *WM_operator_pystring(bContext *C, wmOperator *op, bool all_args, bool macro_args); /** * \return true if the string was shortened. */ bool WM_operator_pystring_abbreviate(char *str, int str_len_max); -char *WM_prop_pystring_assign(struct bContext *C, - struct PointerRNA *ptr, - struct PropertyRNA *prop, - int index); +char *WM_prop_pystring_assign(bContext *C, PointerRNA *ptr, PropertyRNA *prop, int index); /** * Convert: `some.op` -> `SOME_OT_op` or leave as-is. * \return the length of `dst`. @@ -1099,40 +1034,39 @@ size_t WM_operator_py_idname(char *dst, const char *src) ATTR_NONNULL(1, 2); * Sanity check to ensure #WM_operator_bl_idname won't fail. * \returns true when there are no problems with \a idname, otherwise report an error. */ -bool WM_operator_py_idname_ok_or_report(struct ReportList *reports, +bool WM_operator_py_idname_ok_or_report(ReportList *reports, const char *classname, const char *idname); /** * Calculate the path to `ptr` from context `C`, or return NULL if it can't be calculated. */ -char *WM_context_path_resolve_property_full(const struct bContext *C, +char *WM_context_path_resolve_property_full(const bContext *C, const PointerRNA *ptr, PropertyRNA *prop, int index); -char *WM_context_path_resolve_full(struct bContext *C, const PointerRNA *ptr); +char *WM_context_path_resolve_full(bContext *C, const PointerRNA *ptr); /* `wm_operator_type.cc` */ -struct wmOperatorType *WM_operatortype_find(const char *idname, bool quiet); +wmOperatorType *WM_operatortype_find(const char *idname, bool quiet); /** * \note Caller must free. */ -void WM_operatortype_iter(struct GHashIterator *ghi); -void WM_operatortype_append(void (*opfunc)(struct wmOperatorType *)); -void WM_operatortype_append_ptr(void (*opfunc)(struct wmOperatorType *, void *), void *userdata); -void WM_operatortype_append_macro_ptr(void (*opfunc)(struct wmOperatorType *, void *), - void *userdata); +void WM_operatortype_iter(GHashIterator *ghi); +void WM_operatortype_append(void (*opfunc)(wmOperatorType *)); +void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata); +void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata); /** * Called on initialize WM_exit(). */ -void WM_operatortype_remove_ptr(struct wmOperatorType *ot); +void WM_operatortype_remove_ptr(wmOperatorType *ot); bool WM_operatortype_remove(const char *idname); /** * Remove memory of all previously executed tools. */ -void WM_operatortype_last_properties_clear_all(void); +void WM_operatortype_last_properties_clear_all(); -void WM_operatortype_idname_visit_for_search(const struct bContext *C, +void WM_operatortype_idname_visit_for_search(const bContext *C, PointerRNA *ptr, PropertyRNA *prop, const char *edit_text, @@ -1151,7 +1085,7 @@ void WM_operatortype_idname_visit_for_search(const struct bContext *C, * This doesn't do the actual tagging, #WM_operatortype_props_advanced_end does which is * called for all operators during registration (see #wm_operatortype_append__end). */ -void WM_operatortype_props_advanced_begin(struct wmOperatorType *ot); +void WM_operatortype_props_advanced_begin(wmOperatorType *ot); /** * Tags all operator-properties of \a ot defined since the first * #WM_operatortype_props_advanced_begin call, @@ -1160,7 +1094,7 @@ void WM_operatortype_props_advanced_begin(struct wmOperatorType *ot); * \note This is called for all operators during registration (see #wm_operatortype_append__end). * So it does not need to be explicitly called in operator-type definition. */ -void WM_operatortype_props_advanced_end(struct wmOperatorType *ot); +void WM_operatortype_props_advanced_end(wmOperatorType *ot); #define WM_operatortype_prop_tag(property, tags) \ { \ @@ -1172,23 +1106,18 @@ void WM_operatortype_props_advanced_end(struct wmOperatorType *ot); /** * \note Names have to be static for now. */ -struct wmOperatorType *WM_operatortype_append_macro(const char *idname, - const char *name, - const char *description, - int flag); -struct wmOperatorTypeMacro *WM_operatortype_macro_define(struct wmOperatorType *ot, - const char *idname); +wmOperatorType *WM_operatortype_append_macro(const char *idname, + const char *name, + const char *description, + int flag); +wmOperatorTypeMacro *WM_operatortype_macro_define(wmOperatorType *ot, const char *idname); -const char *WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties); -char *WM_operatortype_description(struct bContext *C, - struct wmOperatorType *ot, - struct PointerRNA *properties); +const char *WM_operatortype_name(wmOperatorType *ot, PointerRNA *properties); +char *WM_operatortype_description(bContext *C, wmOperatorType *ot, PointerRNA *properties); /** * Use when we want a label, preferring the description. */ -char *WM_operatortype_description_or_name(struct bContext *C, - struct wmOperatorType *ot, - struct PointerRNA *properties); +char *WM_operatortype_description_or_name(bContext *C, wmOperatorType *ot, PointerRNA *properties); /* `wm_operator_utils.cc` */ @@ -1196,18 +1125,18 @@ char *WM_operatortype_description_or_name(struct bContext *C, * Allow an operator with only and execute function to run modally, * re-doing the action, using vertex coordinate store/restore instead of operator undo. */ -void WM_operator_type_modal_from_exec_for_object_edit_coords(struct wmOperatorType *ot); +void WM_operator_type_modal_from_exec_for_object_edit_coords(wmOperatorType *ot); /* `wm_uilist_type.cc` */ /** * Called on initialize #WM_init() */ -void WM_uilisttype_init(void); -struct uiListType *WM_uilisttype_find(const char *idname, bool quiet); -bool WM_uilisttype_add(struct uiListType *ult); -void WM_uilisttype_remove_ptr(struct Main *bmain, struct uiListType *ult); -void WM_uilisttype_free(void); +void WM_uilisttype_init(); +uiListType *WM_uilisttype_find(const char *idname, bool quiet); +bool WM_uilisttype_add(uiListType *ult); +void WM_uilisttype_remove_ptr(Main *bmain, uiListType *ult); +void WM_uilisttype_free(); /** * The "full" list-ID is an internal name used for storing and identifying a list. It is built like @@ -1219,7 +1148,7 @@ void WM_uilisttype_free(void); * passed to `UILayout.template_list()`. C code can query that through * #WM_uilisttype_list_id_get(). */ -void WM_uilisttype_to_full_list_id(const struct uiListType *ult, +void WM_uilisttype_to_full_list_id(const uiListType *ult, const char *list_id, char r_full_list_id[]); /** @@ -1227,24 +1156,24 @@ void WM_uilisttype_to_full_list_id(const struct uiListType *ult, * * \note Assumes `uiList.list_id` was set using #WM_uilisttype_to_full_list_id()! */ -const char *WM_uilisttype_list_id_get(const struct uiListType *ult, struct uiList *list); +const char *WM_uilisttype_list_id_get(const uiListType *ult, uiList *list); /* `wm_menu_type.cc` */ /** * \note Called on initialize #WM_init(). */ -void WM_menutype_init(void); -struct MenuType *WM_menutype_find(const char *idname, bool quiet); -void WM_menutype_iter(struct GHashIterator *ghi); -bool WM_menutype_add(struct MenuType *mt); -void WM_menutype_freelink(struct MenuType *mt); -void WM_menutype_free(void); -bool WM_menutype_poll(struct bContext *C, struct MenuType *mt); +void WM_menutype_init(); +MenuType *WM_menutype_find(const char *idname, bool quiet); +void WM_menutype_iter(GHashIterator *ghi); +bool WM_menutype_add(MenuType *mt); +void WM_menutype_freelink(MenuType *mt); +void WM_menutype_free(); +bool WM_menutype_poll(bContext *C, MenuType *mt); -void WM_menutype_idname_visit_for_search(const struct bContext *C, - struct PointerRNA *ptr, - struct PropertyRNA *prop, +void WM_menutype_idname_visit_for_search(const bContext *C, + PointerRNA *ptr, + PropertyRNA *prop, const char *edit_text, StringPropertySearchVisitFunc visit_fn, void *visit_user_data); @@ -1254,68 +1183,52 @@ void WM_menutype_idname_visit_for_search(const struct bContext *C, /** * Called on initialize #WM_init(). */ -void WM_paneltype_init(void); -void WM_paneltype_clear(void); -struct PanelType *WM_paneltype_find(const char *idname, bool quiet); -bool WM_paneltype_add(struct PanelType *pt); -void WM_paneltype_remove(struct PanelType *pt); +void WM_paneltype_init(); +void WM_paneltype_clear(); +PanelType *WM_paneltype_find(const char *idname, bool quiet); +bool WM_paneltype_add(PanelType *pt); +void WM_paneltype_remove(PanelType *pt); -void WM_paneltype_idname_visit_for_search(const struct bContext *C, - struct PointerRNA *ptr, - struct PropertyRNA *prop, +void WM_paneltype_idname_visit_for_search(const bContext *C, + PointerRNA *ptr, + PropertyRNA *prop, const char *edit_text, StringPropertySearchVisitFunc visit_fn, void *visit_user_data); /* `wm_gesture_ops.cc` */ -int WM_gesture_box_invoke(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); -int WM_gesture_box_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); -void WM_gesture_box_cancel(struct bContext *C, struct wmOperator *op); -int WM_gesture_circle_invoke(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -int WM_gesture_circle_modal(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -void WM_gesture_circle_cancel(struct bContext *C, struct wmOperator *op); -int WM_gesture_lines_invoke(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -int WM_gesture_lines_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); -void WM_gesture_lines_cancel(struct bContext *C, struct wmOperator *op); -int WM_gesture_lasso_invoke(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -int WM_gesture_lasso_modal(struct bContext *C, struct wmOperator *op, const struct wmEvent *event); -void WM_gesture_lasso_cancel(struct bContext *C, struct wmOperator *op); +int WM_gesture_box_invoke(bContext *C, wmOperator *op, const wmEvent *event); +int WM_gesture_box_modal(bContext *C, wmOperator *op, const wmEvent *event); +void WM_gesture_box_cancel(bContext *C, wmOperator *op); +int WM_gesture_circle_invoke(bContext *C, wmOperator *op, const wmEvent *event); +int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event); +void WM_gesture_circle_cancel(bContext *C, wmOperator *op); +int WM_gesture_lines_invoke(bContext *C, wmOperator *op, const wmEvent *event); +int WM_gesture_lines_modal(bContext *C, wmOperator *op, const wmEvent *event); +void WM_gesture_lines_cancel(bContext *C, wmOperator *op); +int WM_gesture_lasso_invoke(bContext *C, wmOperator *op, const wmEvent *event); +int WM_gesture_lasso_modal(bContext *C, wmOperator *op, const wmEvent *event); +void WM_gesture_lasso_cancel(bContext *C, wmOperator *op); /** * helper function, we may want to add options for conversion to view space * * caller must free. */ -const int (*WM_gesture_lasso_path_to_array(struct bContext *C, - struct wmOperator *op, - int *mcoords_len))[2]; +const int (*WM_gesture_lasso_path_to_array(bContext *C, wmOperator *op, int *mcoords_len))[2]; -int WM_gesture_straightline_invoke(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); +int WM_gesture_straightline_invoke(bContext *C, wmOperator *op, const wmEvent *event); /** * This invoke callback starts the straight-line gesture with a viewport preview to the right side * of the line. */ -int WM_gesture_straightline_active_side_invoke(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); +int WM_gesture_straightline_active_side_invoke(bContext *C, wmOperator *op, const wmEvent *event); /** * This modal callback calls exec once per mouse move event while the gesture is active with the * updated line start and end values, so it can be used for tools that have a real time preview * (like a gradient updating in real time over the mesh). */ -int WM_gesture_straightline_modal(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); +int WM_gesture_straightline_modal(bContext *C, wmOperator *op, const wmEvent *event); /** * This modal one-shot callback only calls exec once after the gesture finishes without any updates * during the gesture execution. Should be used for operations that are intended to be applied once @@ -1323,24 +1236,19 @@ int WM_gesture_straightline_modal(struct bContext *C, * after finishing the gesture as the bisect operation is too heavy to be computed in real time for * a preview). */ -int WM_gesture_straightline_oneshot_modal(struct bContext *C, - struct wmOperator *op, - const struct wmEvent *event); -void WM_gesture_straightline_cancel(struct bContext *C, struct wmOperator *op); +int WM_gesture_straightline_oneshot_modal(bContext *C, wmOperator *op, const wmEvent *event); +void WM_gesture_straightline_cancel(bContext *C, wmOperator *op); /* Gesture manager API */ /** * Context checked on having screen, window and area. */ -struct wmGesture *WM_gesture_new(struct wmWindow *window, - const struct ARegion *region, - const struct wmEvent *event, - int type); -void WM_gesture_end(struct wmWindow *win, struct wmGesture *gesture); -void WM_gestures_remove(struct wmWindow *win); -void WM_gestures_free_all(struct wmWindow *win); -bool WM_gesture_is_modal_first(const struct wmGesture *gesture); +wmGesture *WM_gesture_new(wmWindow *window, const ARegion *region, const wmEvent *event, int type); +void WM_gesture_end(wmWindow *win, wmGesture *gesture); +void WM_gestures_remove(wmWindow *win); +void WM_gestures_free_all(wmWindow *win); +bool WM_gesture_is_modal_first(const wmGesture *gesture); /* File-selecting support. */ @@ -1350,8 +1258,8 @@ bool WM_gesture_is_modal_first(const struct wmGesture *gesture); * executing happens outside of lower level queues, with UI refreshed. * Should also allow multi-window solutions. */ -void WM_event_add_fileselect(struct bContext *C, struct wmOperator *op); -void WM_event_fileselect_event(struct wmWindowManager *wm, void *ophandle, int eventval); +void WM_event_add_fileselect(bContext *C, wmOperator *op); +void WM_event_fileselect_event(wmWindowManager *wm, void *ophandle, int eventval); /* Event consecutive data. */ @@ -1367,7 +1275,7 @@ void WM_event_consecutive_data_free(wmWindow *win); * * \see #BKE_area_find_region_active_win */ -void WM_operator_region_active_win_set(struct bContext *C); +void WM_operator_region_active_win_set(bContext *C); /** * Indented for use in a selection (picking) operators #wmOperatorType::invoke callback @@ -1391,7 +1299,7 @@ void WM_operator_region_active_win_set(struct bContext *C); * intended to box-select. In this case it's preferred to select on CLICK instead of PRESS * (see the Outliner use of click-drag). */ -int WM_operator_flag_only_pass_through_on_press(int retval, const struct wmEvent *event); +int WM_operator_flag_only_pass_through_on_press(int retval, const wmEvent *event); /* Drag and drop. */ @@ -1399,12 +1307,8 @@ int WM_operator_flag_only_pass_through_on_press(int retval, const struct wmEvent * Start dragging immediately with the given data. * Note that \a poin should be valid allocated and not on stack. */ -void WM_event_start_drag(struct bContext *C, - int icon, - eWM_DragDataType type, - void *poin, - double value, - unsigned int flags); +void WM_event_start_drag( + bContext *C, int icon, eWM_DragDataType type, void *poin, double value, unsigned int flags); /** * Create and fill the dragging data, but don't start dragging just yet (unlike * #WM_event_start_drag()). Must be followed up by #WM_event_start_prepared_drag(), otherwise the @@ -1412,35 +1316,24 @@ void WM_event_start_drag(struct bContext *C, * * Note that \a poin should be valid allocated and not on stack. */ -wmDrag *WM_drag_data_create(struct bContext *C, - int icon, - eWM_DragDataType type, - void *poin, - double value, - unsigned int flags); +wmDrag *WM_drag_data_create( + bContext *C, int icon, eWM_DragDataType type, void *poin, double value, unsigned int flags); /** * Invoke dragging using the given \a drag data. */ -void WM_event_start_prepared_drag(struct bContext *C, wmDrag *drag); -void WM_event_drag_image(struct wmDrag *, const struct ImBuf *, float scale); -void WM_drag_free(struct wmDrag *drag); +void WM_event_start_prepared_drag(bContext *C, wmDrag *drag); +void WM_event_drag_image(wmDrag *, const ImBuf *, float scale); +void WM_drag_free(wmDrag *drag); void WM_drag_data_free(eWM_DragDataType dragtype, void *poin); -void WM_drag_free_list(struct ListBase *lb); -struct wmDropBox *WM_dropbox_add( - ListBase *lb, - const char *idname, - bool (*poll)(struct bContext *, struct wmDrag *, const struct wmEvent *event), - void (*copy)(struct bContext *, struct wmDrag *, struct wmDropBox *), - void (*cancel)(struct Main *, struct wmDrag *, struct wmDropBox *), - WMDropboxTooltipFunc tooltip); -void WM_drag_draw_item_name_fn(struct bContext *C, - struct wmWindow *win, - struct wmDrag *drag, - const int xy[2]); -void WM_drag_draw_default_fn(struct bContext *C, - struct wmWindow *win, - struct wmDrag *drag, - const int xy[2]); +void WM_drag_free_list(ListBase *lb); +wmDropBox *WM_dropbox_add(ListBase *lb, + const char *idname, + bool (*poll)(bContext *, wmDrag *, const wmEvent *event), + void (*copy)(bContext *, wmDrag *, wmDropBox *), + void (*cancel)(Main *, wmDrag *, wmDropBox *), + WMDropboxTooltipFunc tooltip); +void WM_drag_draw_item_name_fn(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2]); +void WM_drag_draw_default_fn(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2]); /** * `spaceid` / `regionid` are zero for window drop maps. */ @@ -1451,15 +1344,15 @@ ListBase *WM_dropboxmap_find(const char *idname, int spaceid, int regionid); /** * \param flag_extra: Additional linking flags (from #eFileSel_Params_Flag). */ -ID *WM_drag_asset_id_import(const struct bContext *C, wmDragAsset *asset_drag, int flag_extra); +ID *WM_drag_asset_id_import(const bContext *C, wmDragAsset *asset_drag, int flag_extra); bool WM_drag_asset_will_import_linked(const wmDrag *drag); -void WM_drag_add_local_ID(struct wmDrag *drag, struct ID *id, struct ID *from_parent); -struct ID *WM_drag_get_local_ID(const struct wmDrag *drag, short idcode); -struct ID *WM_drag_get_local_ID_from_event(const struct wmEvent *event, short idcode); +void WM_drag_add_local_ID(wmDrag *drag, ID *id, ID *from_parent); +ID *WM_drag_get_local_ID(const wmDrag *drag, short idcode); +ID *WM_drag_get_local_ID_from_event(const wmEvent *event, short idcode); /** * Check if the drag data is either a local ID or an external ID asset of type \a idcode. */ -bool WM_drag_is_ID_type(const struct wmDrag *drag, int idcode); +bool WM_drag_is_ID_type(const wmDrag *drag, int idcode); /** * \note Does not store \a asset in any way, so it's fine to pass a temporary. @@ -1467,8 +1360,8 @@ bool WM_drag_is_ID_type(const struct wmDrag *drag, int idcode); wmDragAsset *WM_drag_create_asset_data(const blender::asset_system::AssetRepresentation *asset, int /* #eAssetImportMethod */ import_type); -struct wmDragAsset *WM_drag_get_asset_data(const struct wmDrag *drag, int idcode); -struct AssetMetaData *WM_drag_get_asset_meta_data(const struct wmDrag *drag, int idcode); +wmDragAsset *WM_drag_get_asset_data(const wmDrag *drag, int idcode); +AssetMetaData *WM_drag_get_asset_meta_data(const wmDrag *drag, int idcode); /** * When dragging a local ID, return that. Otherwise, if dragging an asset-handle, link or append * that depending on what was chosen by the drag-box (currently append only in fact). @@ -1476,9 +1369,7 @@ struct AssetMetaData *WM_drag_get_asset_meta_data(const struct wmDrag *drag, int * Use #WM_drag_free_imported_drag_ID() as cancel callback of the drop-box, so that the asset * import is rolled back if the drop operator fails. */ -struct ID *WM_drag_get_local_ID_or_import_from_asset(const struct bContext *C, - const struct wmDrag *drag, - int idcode); +ID *WM_drag_get_local_ID_or_import_from_asset(const bContext *C, const wmDrag *drag, int idcode); /** * \brief Free asset ID imported for canceled drop. @@ -1488,11 +1379,9 @@ struct ID *WM_drag_get_local_ID_or_import_from_asset(const struct bContext *C, * operator cancels. * This is for use as #wmDropBox.cancel() callback. */ -void WM_drag_free_imported_drag_ID(struct Main *bmain, - struct wmDrag *drag, - struct wmDropBox *drop); +void WM_drag_free_imported_drag_ID(Main *bmain, wmDrag *drag, wmDropBox *drop); -struct wmDragAssetCatalog *WM_drag_get_asset_catalog_data(const struct wmDrag *drag); +wmDragAssetCatalog *WM_drag_get_asset_catalog_data(const wmDrag *drag); /** * \note Does not store \a asset in any way, so it's fine to pass a temporary. @@ -1502,7 +1391,7 @@ void WM_drag_add_asset_list_item(wmDrag *drag, const ListBase *WM_drag_asset_list_get(const wmDrag *drag); -const char *WM_drag_get_item_name(struct wmDrag *drag); +const char *WM_drag_get_item_name(wmDrag *drag); /* Path drag and drop. */ /** @@ -1518,9 +1407,9 @@ const char *WM_drag_get_path(const wmDrag *drag); int /* eFileSel_File_Types */ WM_drag_get_path_file_type(const wmDrag *drag); /* Set OpenGL viewport and scissor */ -void wmViewport(const struct rcti *winrct); +void wmViewport(const rcti *winrct); void wmPartialViewport(rcti *drawrct, const rcti *winrct, const rcti *partialrct); -void wmWindowViewport(struct wmWindow *win); +void wmWindowViewport(wmWindow *win); /* OpenGL utilities with safety check */ void wmOrtho2(float x1, float x2, float y1, float y2); @@ -1529,23 +1418,23 @@ void wmOrtho2(float x1, float x2, float y1, float y2); /** * Default pixel alignment for regions. */ -void wmOrtho2_region_pixelspace(const struct ARegion *region); +void wmOrtho2_region_pixelspace(const ARegion *region); void wmOrtho2_pixelspace(float x, float y); -void wmGetProjectionMatrix(float mat[4][4], const struct rcti *winrct); +void wmGetProjectionMatrix(float mat[4][4], const rcti *winrct); /* threaded Jobs Manager */ -typedef enum eWM_JobFlag { +enum eWM_JobFlag { WM_JOB_PRIORITY = (1 << 0), WM_JOB_EXCL_RENDER = (1 << 1), WM_JOB_PROGRESS = (1 << 2), -} eWM_JobFlag; -ENUM_OPERATORS(enum eWM_JobFlag, WM_JOB_PROGRESS); +}; +ENUM_OPERATORS(eWM_JobFlag, WM_JOB_PROGRESS); /** * Identifying jobs by owner alone is unreliable, this isn't saved, * order can change (keep 0 for 'any'). */ -typedef enum eWM_JobType { +enum eWM_JobType { WM_JOB_TYPE_ANY = 0, WM_JOB_TYPE_COMPOSITE, WM_JOB_TYPE_RENDER, @@ -1580,7 +1469,7 @@ typedef enum eWM_JobType { WM_JOB_TYPE_UV_PACK, /* add as needed, bake, seq proxy build * if having hard coded values is a problem */ -} eWM_JobType; +}; /** * \return current job or adds new job, but doesn't run it. @@ -1588,37 +1477,37 @@ typedef enum eWM_JobType { * \note every owner only gets a single job, * adding a new one will stop running job and when stopped it starts the new one. */ -struct wmJob *WM_jobs_get(struct wmWindowManager *wm, - struct wmWindow *win, - const void *owner, - const char *name, - eWM_JobFlag flag, - eWM_JobType job_type); +wmJob *WM_jobs_get(wmWindowManager *wm, + wmWindow *win, + const void *owner, + const char *name, + eWM_JobFlag flag, + eWM_JobType job_type); /** * Returns true if job runs, for UI (progress) indicators. */ -bool WM_jobs_test(const struct wmWindowManager *wm, const void *owner, int job_type); -float WM_jobs_progress(const struct wmWindowManager *wm, const void *owner); -const char *WM_jobs_name(const struct wmWindowManager *wm, const void *owner); +bool WM_jobs_test(const wmWindowManager *wm, const void *owner, int job_type); +float WM_jobs_progress(const wmWindowManager *wm, const void *owner); +const char *WM_jobs_name(const wmWindowManager *wm, const void *owner); /** * Time that job started. */ -double WM_jobs_starttime(const struct wmWindowManager *wm, const void *owner); -void *WM_jobs_customdata_from_type(struct wmWindowManager *wm, const void *owner, int job_type); +double WM_jobs_starttime(const wmWindowManager *wm, const void *owner); +void *WM_jobs_customdata_from_type(wmWindowManager *wm, const void *owner, int job_type); -bool WM_jobs_is_running(const struct wmJob *wm_job); +bool WM_jobs_is_running(const wmJob *wm_job); bool WM_jobs_is_stopped(const wmWindowManager *wm, const void *owner); -void *WM_jobs_customdata_get(struct wmJob *); -void WM_jobs_customdata_set(struct wmJob *, void *customdata, void (*free)(void *)); -void WM_jobs_timer(struct wmJob *, double timestep, unsigned int note, unsigned int endnote); -void WM_jobs_delay_start(struct wmJob *, double delay_time); +void *WM_jobs_customdata_get(wmJob *); +void WM_jobs_customdata_set(wmJob *, void *customdata, void (*free)(void *)); +void WM_jobs_timer(wmJob *, double timestep, unsigned int note, unsigned int endnote); +void WM_jobs_delay_start(wmJob *, double delay_time); -typedef void (*wm_jobs_start_callback)(void *custom_data, - bool *stop, - bool *do_update, - float *progress); -void WM_jobs_callbacks(struct wmJob *, +using wm_jobs_start_callback = void (*)(void *custom_data, + bool *stop, + bool *do_update, + float *progress); +void WM_jobs_callbacks(wmJob *, wm_jobs_start_callback startjob, void (*initjob)(void *), void (*update)(void *), @@ -1636,32 +1525,30 @@ void WM_jobs_callbacks_ex(wmJob *wm_job, * If job running, the same owner gave it a new job. * if different owner starts existing startjob, it suspends itself */ -void WM_jobs_start(struct wmWindowManager *wm, struct wmJob *); +void WM_jobs_start(wmWindowManager *wm, wmJob *); /** * Signal job(s) from this owner or callback to stop, timer is required to get handled. */ -void WM_jobs_stop(struct wmWindowManager *wm, const void *owner, void *startjob); +void WM_jobs_stop(wmWindowManager *wm, const void *owner, void *startjob); /** * Actually terminate thread and job timer. */ -void WM_jobs_kill(struct wmWindowManager *wm, - void *owner, - void (*)(void *, bool *, bool *, float *)); +void WM_jobs_kill(wmWindowManager *wm, void *owner, void (*)(void *, bool *, bool *, float *)); /** * Wait until every job ended. */ -void WM_jobs_kill_all(struct wmWindowManager *wm); +void WM_jobs_kill_all(wmWindowManager *wm); /** * Wait until every job ended, except for one owner (used in undo to keep screen job alive). */ -void WM_jobs_kill_all_except(struct wmWindowManager *wm, const void *owner); -void WM_jobs_kill_type(struct wmWindowManager *wm, const void *owner, int job_type); +void WM_jobs_kill_all_except(wmWindowManager *wm, const void *owner); +void WM_jobs_kill_type(wmWindowManager *wm, const void *owner, int job_type); -bool WM_jobs_has_running(const struct wmWindowManager *wm); -bool WM_jobs_has_running_type(const struct wmWindowManager *wm, int job_type); +bool WM_jobs_has_running(const wmWindowManager *wm); +bool WM_jobs_has_running_type(const wmWindowManager *wm, int job_type); -void WM_job_main_thread_lock_acquire(struct wmJob *job); -void WM_job_main_thread_lock_release(struct wmJob *job); +void WM_job_main_thread_lock_acquire(wmJob *job); +void WM_job_main_thread_lock_release(wmJob *job); /* Clipboard. */ @@ -1681,7 +1568,7 @@ void WM_clipboard_text_set(const char *buf, bool selection); /** * Returns true if the clipboard contains an image. */ -bool WM_clipboard_image_available(void); +bool WM_clipboard_image_available(); /** * Get image data from the Clipboard @@ -1689,7 +1576,7 @@ bool WM_clipboard_image_available(void); * \param r_height: the returned image height in pixels. * \return pointer uint array in RGBA byte order. Caller must free. */ -struct ImBuf *WM_clipboard_image_get(void); +ImBuf *WM_clipboard_image_get(); /** * Put image data to the Clipboard @@ -1697,30 +1584,28 @@ struct ImBuf *WM_clipboard_image_get(void); * \param width: the image width in pixels. * \param height: the image height in pixels. */ -bool WM_clipboard_image_set(struct ImBuf *ibuf); +bool WM_clipboard_image_set(ImBuf *ibuf); /* progress */ -void WM_progress_set(struct wmWindow *win, float progress); -void WM_progress_clear(struct wmWindow *win); +void WM_progress_set(wmWindow *win, float progress); +void WM_progress_clear(wmWindow *win); /* Draw (for screenshot) */ -void *WM_draw_cb_activate(struct wmWindow *win, - void (*draw)(const struct wmWindow *, void *), - void *customdata); -void WM_draw_cb_exit(struct wmWindow *win, void *handle); -void WM_redraw_windows(struct bContext *C); +void *WM_draw_cb_activate(wmWindow *win, void (*draw)(const wmWindow *, void *), void *customdata); +void WM_draw_cb_exit(wmWindow *win, void *handle); +void WM_redraw_windows(bContext *C); -void WM_draw_region_viewport_ensure(struct ARegion *region, short space_type); -void WM_draw_region_viewport_bind(struct ARegion *region); -void WM_draw_region_viewport_unbind(struct ARegion *region); +void WM_draw_region_viewport_ensure(ARegion *region, short space_type); +void WM_draw_region_viewport_bind(ARegion *region); +void WM_draw_region_viewport_unbind(ARegion *region); /* Region drawing */ -void WM_draw_region_free(struct ARegion *region, bool hide); -struct GPUViewport *WM_draw_region_get_viewport(struct ARegion *region); -struct GPUViewport *WM_draw_region_get_bound_viewport(struct ARegion *region); +void WM_draw_region_free(ARegion *region, bool hide); +GPUViewport *WM_draw_region_get_viewport(ARegion *region); +GPUViewport *WM_draw_region_get_bound_viewport(ARegion *region); void WM_main_playanim(int argc, const char **argv); @@ -1728,52 +1613,50 @@ void WM_main_playanim(int argc, const char **argv); * Debugging only, convenience function to write on crash. * Convenient to save a blend file from a debugger. */ -bool write_crash_blend(void); +bool write_crash_blend(); /** * Lock the interface for any communication. */ -void WM_set_locked_interface(struct wmWindowManager *wm, bool lock); +void WM_set_locked_interface(wmWindowManager *wm, bool lock); -void WM_event_tablet_data_default_set(struct wmTabletData *tablet_data); +void WM_event_tablet_data_default_set(wmTabletData *tablet_data); /** * For testing only, see #G_FLAG_EVENT_SIMULATE. */ -struct wmEvent *WM_event_add_simulate(struct wmWindow *win, const struct wmEvent *event_to_add); +wmEvent *WM_event_add_simulate(wmWindow *win, const wmEvent *event_to_add); -const char *WM_window_cursor_keymap_status_get(const struct wmWindow *win, +const char *WM_window_cursor_keymap_status_get(const wmWindow *win, int button_index, int type_index); -void WM_window_cursor_keymap_status_refresh(struct bContext *C, struct wmWindow *win); +void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win); -void WM_window_status_area_tag_redraw(struct wmWindow *win); +void WM_window_status_area_tag_redraw(wmWindow *win); /** * Similar to #BKE_screen_area_map_find_area_xy and related functions, * use here since the area is stored in the window manager. */ -struct ScrArea *WM_window_status_area_find(struct wmWindow *win, struct bScreen *screen); -bool WM_window_modal_keymap_status_draw(struct bContext *C, - struct wmWindow *win, - struct uiLayout *layout); +ScrArea *WM_window_status_area_find(wmWindow *win, bScreen *screen); +bool WM_window_modal_keymap_status_draw(bContext *C, wmWindow *win, uiLayout *layout); /* `wm_event_query.cc` */ /** * For debugging only, getting inspecting events manually is tedious. */ -void WM_event_print(const struct wmEvent *event); +void WM_event_print(const wmEvent *event); /** * For modal callbacks, check configuration for how to interpret exit when dragging. */ -bool WM_event_is_modal_drag_exit(const struct wmEvent *event, +bool WM_event_is_modal_drag_exit(const wmEvent *event, short init_event_type, short init_event_val); -bool WM_event_is_mouse_drag(const struct wmEvent *event); +bool WM_event_is_mouse_drag(const wmEvent *event); bool WM_event_is_mouse_drag_or_press(const wmEvent *event); int WM_event_drag_direction(const wmEvent *event); -char WM_event_utf8_to_ascii(const struct wmEvent *event) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; +char WM_event_utf8_to_ascii(const wmEvent *event) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT; /** * Detect motion between selection (callers should only use this for selection picking), @@ -1803,9 +1686,9 @@ bool WM_event_consecutive_gesture_test(const wmEvent *event); */ bool WM_event_consecutive_gesture_test_break(const wmWindow *win, const wmEvent *event); -int WM_event_drag_threshold(const struct wmEvent *event); -bool WM_event_drag_test(const struct wmEvent *event, const int prev_xy[2]); -bool WM_event_drag_test_with_delta(const struct wmEvent *event, const int delta[2]); +int WM_event_drag_threshold(const wmEvent *event); +bool WM_event_drag_test(const wmEvent *event, const int prev_xy[2]); +bool WM_event_drag_test_with_delta(const wmEvent *event, const int delta[2]); void WM_event_drag_start_mval(const wmEvent *event, const ARegion *region, int r_mval[2]); void WM_event_drag_start_mval_fl(const wmEvent *event, const ARegion *region, float r_mval[2]); void WM_event_drag_start_xy(const wmEvent *event, int r_xy[2]); @@ -1822,69 +1705,63 @@ int WM_userdef_event_map(int kmitype); int WM_userdef_event_type_from_keymap_type(int kmitype); #ifdef WITH_INPUT_NDOF -void WM_event_ndof_pan_get(const struct wmNDOFMotionData *ndof, float r_pan[3], bool use_zoom); -void WM_event_ndof_rotate_get(const struct wmNDOFMotionData *ndof, float r_rot[3]); +void WM_event_ndof_pan_get(const wmNDOFMotionData *ndof, float r_pan[3], bool use_zoom); +void WM_event_ndof_rotate_get(const wmNDOFMotionData *ndof, float r_rot[3]); -float WM_event_ndof_to_axis_angle(const struct wmNDOFMotionData *ndof, float axis[3]); -void WM_event_ndof_to_quat(const struct wmNDOFMotionData *ndof, float q[4]); +float WM_event_ndof_to_axis_angle(const wmNDOFMotionData *ndof, float axis[3]); +void WM_event_ndof_to_quat(const wmNDOFMotionData *ndof, float q[4]); #endif /* WITH_INPUT_NDOF */ #ifdef WITH_XR_OPENXR -bool WM_event_is_xr(const struct wmEvent *event); +bool WM_event_is_xr(const wmEvent *event); #endif /** * If this is a tablet event, return tablet pressure and set `*pen_flip` * to 1 if the eraser tool is being used, 0 otherwise. */ -float WM_event_tablet_data(const struct wmEvent *event, int *pen_flip, float tilt[2]); -bool WM_event_is_tablet(const struct wmEvent *event); +float WM_event_tablet_data(const wmEvent *event, int *pen_flip, float tilt[2]); +bool WM_event_is_tablet(const wmEvent *event); -int WM_event_absolute_delta_x(const struct wmEvent *event); -int WM_event_absolute_delta_y(const struct wmEvent *event); +int WM_event_absolute_delta_x(const wmEvent *event); +int WM_event_absolute_delta_y(const wmEvent *event); #ifdef WITH_INPUT_IME -bool WM_event_is_ime_switch(const struct wmEvent *event); +bool WM_event_is_ime_switch(const wmEvent *event); #endif /* `wm_tooltip.cc` */ -typedef struct ARegion *(*wmTooltipInitFn)(struct bContext *C, - struct ARegion *region, - int *pass, - double *r_pass_delay, - bool *r_exit_on_event); +using wmTooltipInitFn = ARegion *(*)(bContext *C, + ARegion *region, + int *pass, + double *r_pass_delay, + bool *r_exit_on_event); -void WM_tooltip_immediate_init(struct bContext *C, - struct wmWindow *win, - struct ScrArea *area, - struct ARegion *region, - wmTooltipInitFn init); -void WM_tooltip_timer_init_ex(struct bContext *C, - struct wmWindow *win, - struct ScrArea *area, - struct ARegion *region, +void WM_tooltip_immediate_init( + bContext *C, wmWindow *win, ScrArea *area, ARegion *region, wmTooltipInitFn init); +void WM_tooltip_timer_init_ex(bContext *C, + wmWindow *win, + ScrArea *area, + ARegion *region, wmTooltipInitFn init, double delay); -void WM_tooltip_timer_init(struct bContext *C, - struct wmWindow *win, - struct ScrArea *area, - struct ARegion *region, - wmTooltipInitFn init); -void WM_tooltip_timer_clear(struct bContext *C, struct wmWindow *win); -void WM_tooltip_clear(struct bContext *C, struct wmWindow *win); -void WM_tooltip_init(struct bContext *C, struct wmWindow *win); -void WM_tooltip_refresh(struct bContext *C, struct wmWindow *win); -double WM_tooltip_time_closed(void); +void WM_tooltip_timer_init( + bContext *C, wmWindow *win, ScrArea *area, ARegion *region, wmTooltipInitFn init); +void WM_tooltip_timer_clear(bContext *C, wmWindow *win); +void WM_tooltip_clear(bContext *C, wmWindow *win); +void WM_tooltip_init(bContext *C, wmWindow *win); +void WM_tooltip_refresh(bContext *C, wmWindow *win); +double WM_tooltip_time_closed(); /* `wm_utils.cc` */ -struct wmGenericCallback *WM_generic_callback_steal(struct wmGenericCallback *callback); -void WM_generic_callback_free(struct wmGenericCallback *callback); +wmGenericCallback *WM_generic_callback_steal(wmGenericCallback *callback); +void WM_generic_callback_free(wmGenericCallback *callback); -void WM_generic_user_data_free(struct wmGenericUserData *wm_userdata); +void WM_generic_user_data_free(wmGenericUserData *wm_userdata); -bool WM_region_use_viewport(struct ScrArea *area, struct ARegion *region); +bool WM_region_use_viewport(ScrArea *area, ARegion *region); #ifdef WITH_XR_OPENXR /* `wm_xr_session.cc` */ @@ -1898,8 +1775,8 @@ bool WM_xr_session_exists(const wmXrData *xr); * Check if the session is running, according to the OpenXR definition. */ bool WM_xr_session_is_ready(const wmXrData *xr); -struct wmXrSessionState *WM_xr_session_state_handle_get(const wmXrData *xr); -struct ScrArea *WM_xr_session_area_get(const wmXrData *xr); +wmXrSessionState *WM_xr_session_state_handle_get(const wmXrData *xr); +ScrArea *WM_xr_session_area_get(const wmXrData *xr); void WM_xr_session_base_pose_reset(wmXrData *xr); bool WM_xr_session_state_viewer_pose_location_get(const wmXrData *xr, float r_location[3]); bool WM_xr_session_state_viewer_pose_rotation_get(const wmXrData *xr, float r_rotation[4]); @@ -1924,9 +1801,9 @@ bool WM_xr_session_state_nav_rotation_get(const wmXrData *xr, float r_rotation[4 void WM_xr_session_state_nav_rotation_set(wmXrData *xr, const float rotation[4]); bool WM_xr_session_state_nav_scale_get(const wmXrData *xr, float *r_scale); void WM_xr_session_state_nav_scale_set(wmXrData *xr, float scale); -void WM_xr_session_state_navigation_reset(struct wmXrSessionState *state); +void WM_xr_session_state_navigation_reset(wmXrSessionState *state); -struct ARegionType *WM_xr_surface_controller_region_type_get(void); +ARegionType *WM_xr_surface_controller_region_type_get(); /* wm_xr_actions.c */ @@ -1940,8 +1817,8 @@ bool WM_xr_action_create(wmXrData *xr, const char *action_name, eXrActionType type, const ListBase *user_paths, - struct wmOperatorType *ot, - struct IDProperty *op_properties, + wmOperatorType *ot, + IDProperty *op_properties, const char *haptic_name, const int64_t *haptic_duration, const float *haptic_frequency, @@ -1958,7 +1835,7 @@ bool WM_xr_action_binding_create(wmXrData *xr, const ListBase *component_paths, const float *float_thresholds, const eXrAxisFlag *axis_flags, - const struct wmXrPose *poses); + const wmXrPose *poses); void WM_xr_action_binding_destroy(wmXrData *xr, const char *action_set_name, const char *action_name, @@ -1981,7 +1858,7 @@ bool WM_xr_action_state_get(const wmXrData *xr, const char *action_set_name, const char *action_name, const char *subaction_path, - struct wmXrActionState *r_state); + wmXrActionState *r_state); bool WM_xr_haptic_action_apply(wmXrData *xr, const char *action_set_name, const char *action_name, @@ -1996,23 +1873,23 @@ void WM_xr_haptic_action_stop(wmXrData *xr, /* `wm_xr_actionmap.cc` */ -XrActionMap *WM_xr_actionmap_new(struct wmXrRuntimeData *runtime, +XrActionMap *WM_xr_actionmap_new(wmXrRuntimeData *runtime, const char *name, bool replace_existing); /** * Ensure unique name among all action maps. */ -void WM_xr_actionmap_ensure_unique(struct wmXrRuntimeData *runtime, XrActionMap *actionmap); -XrActionMap *WM_xr_actionmap_add_copy(struct wmXrRuntimeData *runtime, XrActionMap *am_src); -bool WM_xr_actionmap_remove(struct wmXrRuntimeData *runtime, XrActionMap *actionmap); -XrActionMap *WM_xr_actionmap_find(struct wmXrRuntimeData *runtime, const char *name); +void WM_xr_actionmap_ensure_unique(wmXrRuntimeData *runtime, XrActionMap *actionmap); +XrActionMap *WM_xr_actionmap_add_copy(wmXrRuntimeData *runtime, XrActionMap *am_src); +bool WM_xr_actionmap_remove(wmXrRuntimeData *runtime, XrActionMap *actionmap); +XrActionMap *WM_xr_actionmap_find(wmXrRuntimeData *runtime, const char *name); void WM_xr_actionmap_clear(XrActionMap *actionmap); -void WM_xr_actionmaps_clear(struct wmXrRuntimeData *runtime); -ListBase *WM_xr_actionmaps_get(struct wmXrRuntimeData *runtime); -short WM_xr_actionmap_active_index_get(const struct wmXrRuntimeData *runtime); -void WM_xr_actionmap_active_index_set(struct wmXrRuntimeData *runtime, short idx); -short WM_xr_actionmap_selected_index_get(const struct wmXrRuntimeData *runtime); -void WM_xr_actionmap_selected_index_set(struct wmXrRuntimeData *runtime, short idx); +void WM_xr_actionmaps_clear(wmXrRuntimeData *runtime); +ListBase *WM_xr_actionmaps_get(wmXrRuntimeData *runtime); +short WM_xr_actionmap_active_index_get(const wmXrRuntimeData *runtime); +void WM_xr_actionmap_active_index_set(wmXrRuntimeData *runtime, short idx); +short WM_xr_actionmap_selected_index_get(const wmXrRuntimeData *runtime); +void WM_xr_actionmap_selected_index_set(wmXrRuntimeData *runtime, short idx); XrActionMapItem *WM_xr_actionmap_item_new(XrActionMap *actionmap, const char *name, diff --git a/source/blender/windowmanager/WM_keymap.hh b/source/blender/windowmanager/WM_keymap.hh index 36d593b2b06..6854a0ef627 100644 --- a/source/blender/windowmanager/WM_keymap.hh +++ b/source/blender/windowmanager/WM_keymap.hh @@ -16,25 +16,25 @@ struct EnumPropertyItem; /* Key Configuration */ -void WM_keyconfig_init(struct bContext *C); -void WM_keyconfig_reload(struct bContext *C); +void WM_keyconfig_init(bContext *C); +void WM_keyconfig_reload(bContext *C); -wmKeyConfig *WM_keyconfig_new(struct wmWindowManager *wm, const char *idname, bool user_defined); -wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, const char *idname); -bool WM_keyconfig_remove(struct wmWindowManager *wm, struct wmKeyConfig *keyconf); -void WM_keyconfig_clear(struct wmKeyConfig *keyconf); -void WM_keyconfig_free(struct wmKeyConfig *keyconf); +wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, const char *idname, bool user_defined); +wmKeyConfig *WM_keyconfig_new_user(wmWindowManager *wm, const char *idname); +bool WM_keyconfig_remove(wmWindowManager *wm, wmKeyConfig *keyconf); +void WM_keyconfig_clear(wmKeyConfig *keyconf); +void WM_keyconfig_free(wmKeyConfig *keyconf); -void WM_keyconfig_set_active(struct wmWindowManager *wm, const char *idname); +void WM_keyconfig_set_active(wmWindowManager *wm, const char *idname); -void WM_keyconfig_update(struct wmWindowManager *wm); -void WM_keyconfig_update_tag(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi); -void WM_keyconfig_update_operatortype(void); +void WM_keyconfig_update(wmWindowManager *wm); +void WM_keyconfig_update_tag(wmKeyMap *keymap, wmKeyMapItem *kmi); +void WM_keyconfig_update_operatortype(); /* Keymap */ /** Parameters for matching events, passed into functions that create key-map items. */ -typedef struct KeyMapItem_Params { +struct KeyMapItem_Params { /** #wmKeyMapItem.type */ int16_t type; /** #wmKeyMapItem.val */ @@ -45,19 +45,19 @@ typedef struct KeyMapItem_Params { int16_t keymodifier; /** #wmKeyMapItem.direction */ int8_t direction; -} KeyMapItem_Params; +}; -void WM_keymap_clear(struct wmKeyMap *keymap); +void WM_keymap_clear(wmKeyMap *keymap); /** * Always add item. */ -wmKeyMapItem *WM_keymap_add_item(struct wmKeyMap *keymap, +wmKeyMapItem *WM_keymap_add_item(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params); -wmKeyMapItem *WM_keymap_add_item_copy(struct wmKeyMap *keymap, wmKeyMapItem *kmi_src); +wmKeyMapItem *WM_keymap_add_item_copy(wmKeyMap *keymap, wmKeyMapItem *kmi_src); -bool WM_keymap_remove_item(struct wmKeyMap *keymap, struct wmKeyMapItem *kmi); +bool WM_keymap_remove_item(wmKeyMap *keymap, wmKeyMapItem *kmi); int WM_keymap_item_to_string(const wmKeyMapItem *kmi, bool compact, char *result, @@ -68,24 +68,18 @@ wmKeyMap *WM_keymap_list_find_spaceid_or_empty(ListBase *lb, const char *idname, int spaceid, int regionid); -wmKeyMap *WM_keymap_ensure(struct wmKeyConfig *keyconf, - const char *idname, - int spaceid, - int regionid); -wmKeyMap *WM_keymap_find_all(struct wmWindowManager *wm, - const char *idname, - int spaceid, - int regionid); -wmKeyMap *WM_keymap_find_all_spaceid_or_empty(struct wmWindowManager *wm, +wmKeyMap *WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid); +wmKeyMap *WM_keymap_find_all(wmWindowManager *wm, const char *idname, int spaceid, int regionid); +wmKeyMap *WM_keymap_find_all_spaceid_or_empty(wmWindowManager *wm, const char *idname, int spaceid, int regionid); -wmKeyMap *WM_keymap_active(const struct wmWindowManager *wm, struct wmKeyMap *keymap); -bool WM_keymap_remove(struct wmKeyConfig *keyconfig, struct wmKeyMap *keymap); -bool WM_keymap_poll(struct bContext *C, struct wmKeyMap *keymap); +wmKeyMap *WM_keymap_active(const wmWindowManager *wm, wmKeyMap *keymap); +bool WM_keymap_remove(wmKeyConfig *keyconfig, wmKeyMap *keymap); +bool WM_keymap_poll(bContext *C, wmKeyMap *keymap); -wmKeyMapItem *WM_keymap_item_find_id(struct wmKeyMap *keymap, int id); -bool WM_keymap_item_compare(const struct wmKeyMapItem *k1, const struct wmKeyMapItem *k2); +wmKeyMapItem *WM_keymap_item_find_id(wmKeyMap *keymap, int id); +bool WM_keymap_item_compare(const wmKeyMapItem *k1, const wmKeyMapItem *k2); /* keymap_utils.c */ @@ -94,78 +88,74 @@ bool WM_keymap_item_compare(const struct wmKeyMapItem *k1, const struct wmKeyMap /** * Menu wrapper for #WM_keymap_add_item. */ -wmKeyMapItem *WM_keymap_add_menu(struct wmKeyMap *keymap, +wmKeyMapItem *WM_keymap_add_menu(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params); /** * Pie-menu wrapper for #WM_keymap_add_item. */ -wmKeyMapItem *WM_keymap_add_menu_pie(struct wmKeyMap *keymap, +wmKeyMapItem *WM_keymap_add_menu_pie(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params); /** * Panel (popover) wrapper for #WM_keymap_add_item. */ -wmKeyMapItem *WM_keymap_add_panel(struct wmKeyMap *keymap, +wmKeyMapItem *WM_keymap_add_panel(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params); /** * Tool wrapper for #WM_keymap_add_item. */ -wmKeyMapItem *WM_keymap_add_tool(struct wmKeyMap *keymap, +wmKeyMapItem *WM_keymap_add_tool(wmKeyMap *keymap, const char *idname, const KeyMapItem_Params *params); -wmKeyMap *WM_keymap_guess_from_context(const struct bContext *C); +wmKeyMap *WM_keymap_guess_from_context(const bContext *C); /** * Guess an appropriate key-map from the operator name. * * \note Needs to be kept up to date with Key-map and Operator naming. */ -wmKeyMap *WM_keymap_guess_opname(const struct bContext *C, const char *opname); +wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname); bool WM_keymap_uses_event_modifier(const wmKeyMap *keymap, int event_modifier); -void WM_keymap_fix_linking(void); +void WM_keymap_fix_linking(); /* Modal Keymap */ int WM_modalkeymap_items_to_string( - const struct wmKeyMap *km, int propvalue, bool compact, char *result, int result_maxncpy); + const wmKeyMap *km, int propvalue, bool compact, char *result, int result_maxncpy); int WM_modalkeymap_operator_items_to_string( - struct wmOperatorType *ot, int propvalue, bool compact, char *result, int result_maxncpy); -char *WM_modalkeymap_operator_items_to_string_buf(struct wmOperatorType *ot, + wmOperatorType *ot, int propvalue, bool compact, char *result, int result_maxncpy); +char *WM_modalkeymap_operator_items_to_string_buf(wmOperatorType *ot, int propvalue, bool compact, int result_maxncpy, int *r_available_len, char **r_result); -wmKeyMap *WM_modalkeymap_ensure(struct wmKeyConfig *keyconf, +wmKeyMap *WM_modalkeymap_ensure(wmKeyConfig *keyconf, const char *idname, - const struct EnumPropertyItem *items); -wmKeyMap *WM_modalkeymap_find(struct wmKeyConfig *keyconf, const char *idname); -wmKeyMapItem *WM_modalkeymap_add_item(struct wmKeyMap *km, - const KeyMapItem_Params *params, - int value); -wmKeyMapItem *WM_modalkeymap_add_item_str(struct wmKeyMap *km, + const EnumPropertyItem *items); +wmKeyMap *WM_modalkeymap_find(wmKeyConfig *keyconf, const char *idname); +wmKeyMapItem *WM_modalkeymap_add_item(wmKeyMap *km, const KeyMapItem_Params *params, int value); +wmKeyMapItem *WM_modalkeymap_add_item_str(wmKeyMap *km, const KeyMapItem_Params *params, const char *value); const wmKeyMapItem *WM_modalkeymap_find_propvalue(const wmKeyMap *km, int propvalue); -void WM_modalkeymap_assign(struct wmKeyMap *km, const char *opname); +void WM_modalkeymap_assign(wmKeyMap *km, const char *opname); /* Keymap Editor */ -void WM_keymap_restore_to_default(struct wmKeyMap *keymap, struct wmWindowManager *wm); +void WM_keymap_restore_to_default(wmKeyMap *keymap, wmWindowManager *wm); /** * Properties can be NULL, otherwise the arg passed is used and ownership is given to the `kmi`. */ -void WM_keymap_item_properties_reset(struct wmKeyMapItem *kmi, struct IDProperty *properties); -void WM_keymap_item_restore_to_default(wmWindowManager *wm, - struct wmKeyMap *keymap, - struct wmKeyMapItem *kmi); -int WM_keymap_item_map_type_get(const struct wmKeyMapItem *kmi); +void WM_keymap_item_properties_reset(wmKeyMapItem *kmi, IDProperty *properties); +void WM_keymap_item_restore_to_default(wmWindowManager *wm, wmKeyMap *keymap, wmKeyMapItem *kmi); +int WM_keymap_item_map_type_get(const wmKeyMapItem *kmi); /* Key Event */ @@ -184,24 +174,24 @@ int WM_keymap_item_raw_to_string(short shift, * \param include_mask, exclude_mask: * Event types to include/exclude when looking up keys (#eEventType_Mask). */ -wmKeyMapItem *WM_key_event_operator(const struct bContext *C, +wmKeyMapItem *WM_key_event_operator(const bContext *C, const char *opname, wmOperatorCallContext opcontext, - struct IDProperty *properties, + IDProperty *properties, short include_mask, short exclude_mask, - struct wmKeyMap **r_keymap); -char *WM_key_event_operator_string(const struct bContext *C, + wmKeyMap **r_keymap); +char *WM_key_event_operator_string(const bContext *C, const char *opname, wmOperatorCallContext opcontext, - struct IDProperty *properties, + IDProperty *properties, bool is_strict, char *result, int result_maxncpy); -wmKeyMapItem *WM_key_event_operator_from_keymap(struct wmKeyMap *keymap, +wmKeyMapItem *WM_key_event_operator_from_keymap(wmKeyMap *keymap, const char *opname, - struct IDProperty *properties, + IDProperty *properties, short include_mask, short exclude_mask); diff --git a/source/blender/windowmanager/WM_toolsystem.h b/source/blender/windowmanager/WM_toolsystem.h index e41e867221b..67cc8b0ca76 100644 --- a/source/blender/windowmanager/WM_toolsystem.h +++ b/source/blender/windowmanager/WM_toolsystem.h @@ -9,21 +9,21 @@ #include "BLI_compiler_attrs.h" -#ifdef __cplusplus -extern "C" { -#endif - struct IDProperty; struct Main; struct PointerRNA; +struct Scene; struct ScrArea; struct StructRNA; struct WorkSpace; struct bContext; +struct bToolRef; struct bToolRef_Runtime; +struct ViewLayer; struct wmMsgSubscribeKey; struct wmMsgSubscribeValue; struct wmOperatorType; +struct wmWindow; /* `wm_toolsystem.cc` */ @@ -35,43 +35,37 @@ struct wmOperatorType; #define WM_TOOLSYSTEM_SPACE_MASK_MODE_FROM_SPACE ((1 << SPACE_IMAGE) | (1 << SPACE_SEQ)) /* Values that define a category of active tool. */ -typedef struct bToolKey { +struct bToolKey { int space_type; int mode; -} bToolKey; +}; -struct bToolRef *WM_toolsystem_ref_from_context(struct bContext *C); -struct bToolRef *WM_toolsystem_ref_find(struct WorkSpace *workspace, const bToolKey *tkey); -bool WM_toolsystem_ref_ensure(struct WorkSpace *workspace, - const bToolKey *tkey, - struct bToolRef **r_tref); +bToolRef *WM_toolsystem_ref_from_context(bContext *C); +bToolRef *WM_toolsystem_ref_find(WorkSpace *workspace, const bToolKey *tkey); +bool WM_toolsystem_ref_ensure(WorkSpace *workspace, const bToolKey *tkey, bToolRef **r_tref); -struct bToolRef *WM_toolsystem_ref_set_by_id_ex(struct bContext *C, - struct WorkSpace *workspace, - const bToolKey *tkey, - const char *name, - bool cycle); -struct bToolRef *WM_toolsystem_ref_set_by_id(struct bContext *C, const char *name); +bToolRef *WM_toolsystem_ref_set_by_id_ex( + bContext *C, WorkSpace *workspace, const bToolKey *tkey, const char *name, bool cycle); +bToolRef *WM_toolsystem_ref_set_by_id(bContext *C, const char *name); -struct bToolRef_Runtime *WM_toolsystem_runtime_from_context(struct bContext *C); -struct bToolRef_Runtime *WM_toolsystem_runtime_find(struct WorkSpace *workspace, - const bToolKey *tkey); +bToolRef_Runtime *WM_toolsystem_runtime_from_context(bContext *C); +bToolRef_Runtime *WM_toolsystem_runtime_find(WorkSpace *workspace, const bToolKey *tkey); -void WM_toolsystem_unlink(struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey); -void WM_toolsystem_refresh(struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey); -void WM_toolsystem_reinit(struct bContext *C, struct WorkSpace *workspace, const bToolKey *tkey); +void WM_toolsystem_unlink(bContext *C, WorkSpace *workspace, const bToolKey *tkey); +void WM_toolsystem_refresh(bContext *C, WorkSpace *workspace, const bToolKey *tkey); +void WM_toolsystem_reinit(bContext *C, WorkSpace *workspace, const bToolKey *tkey); /** * Operate on all active tools. */ -void WM_toolsystem_unlink_all(struct bContext *C, struct WorkSpace *workspace); -void WM_toolsystem_refresh_all(struct bContext *C, struct WorkSpace *workspace); -void WM_toolsystem_reinit_all(struct bContext *C, struct wmWindow *win); +void WM_toolsystem_unlink_all(bContext *C, WorkSpace *workspace); +void WM_toolsystem_refresh_all(bContext *C, WorkSpace *workspace); +void WM_toolsystem_reinit_all(bContext *C, wmWindow *win); -void WM_toolsystem_ref_set_from_runtime(struct bContext *C, - struct WorkSpace *workspace, - struct bToolRef *tref, - const struct bToolRef_Runtime *tref_rt, +void WM_toolsystem_ref_set_from_runtime(bContext *C, + WorkSpace *workspace, + bToolRef *tref, + const bToolRef_Runtime *tref_rt, const char *idname); /** @@ -80,63 +74,58 @@ void WM_toolsystem_ref_set_from_runtime(struct bContext *C, * * \see #toolsystem_ref_link */ -void WM_toolsystem_ref_sync_from_context(struct Main *bmain, - struct WorkSpace *workspace, - struct bToolRef *tref); +void WM_toolsystem_ref_sync_from_context(Main *bmain, WorkSpace *workspace, bToolRef *tref); -void WM_toolsystem_init(struct bContext *C); +void WM_toolsystem_init(bContext *C); -int WM_toolsystem_mode_from_spacetype(const struct Scene *scene, - struct ViewLayer *view_layer, - struct ScrArea *area, +int WM_toolsystem_mode_from_spacetype(const Scene *scene, + ViewLayer *view_layer, + ScrArea *area, int space_type); -bool WM_toolsystem_key_from_context(const struct Scene *scene, - struct ViewLayer *view_layer, - struct ScrArea *area, +bool WM_toolsystem_key_from_context(const Scene *scene, + ViewLayer *view_layer, + ScrArea *area, bToolKey *tkey); -void WM_toolsystem_update_from_context_view3d(struct bContext *C); -void WM_toolsystem_update_from_context(struct bContext *C, - struct WorkSpace *workspace, - const struct Scene *scene, - struct ViewLayer *view_layer, - struct ScrArea *area); +void WM_toolsystem_update_from_context_view3d(bContext *C); +void WM_toolsystem_update_from_context( + bContext *C, WorkSpace *workspace, const Scene *scene, ViewLayer *view_layer, ScrArea *area); /** * For paint modes to support non-brush tools. */ -bool WM_toolsystem_active_tool_is_brush(const struct bContext *C); +bool WM_toolsystem_active_tool_is_brush(const bContext *C); /** Follow #wmMsgNotifyFn spec. */ -void WM_toolsystem_do_msg_notify_tag_refresh(struct bContext *C, - struct wmMsgSubscribeKey *msg_key, - struct wmMsgSubscribeValue *msg_val); +void WM_toolsystem_do_msg_notify_tag_refresh(bContext *C, + wmMsgSubscribeKey *msg_key, + wmMsgSubscribeValue *msg_val); -struct IDProperty *WM_toolsystem_ref_properties_get_idprops(struct bToolRef *tref); -struct IDProperty *WM_toolsystem_ref_properties_ensure_idprops(struct bToolRef *tref); -void WM_toolsystem_ref_properties_ensure_ex(struct bToolRef *tref, +IDProperty *WM_toolsystem_ref_properties_get_idprops(bToolRef *tref); +IDProperty *WM_toolsystem_ref_properties_ensure_idprops(bToolRef *tref); +void WM_toolsystem_ref_properties_ensure_ex(bToolRef *tref, const char *idname, - struct StructRNA *type, - struct PointerRNA *r_ptr); + StructRNA *type, + PointerRNA *r_ptr); #define WM_toolsystem_ref_properties_ensure_from_operator(tref, ot, r_ptr) \ WM_toolsystem_ref_properties_ensure_ex(tref, (ot)->idname, (ot)->srna, r_ptr) #define WM_toolsystem_ref_properties_ensure_from_gizmo_group(tref, gzgroup, r_ptr) \ WM_toolsystem_ref_properties_ensure_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr) -bool WM_toolsystem_ref_properties_get_ex(struct bToolRef *tref, +bool WM_toolsystem_ref_properties_get_ex(bToolRef *tref, const char *idname, - struct StructRNA *type, - struct PointerRNA *r_ptr); + StructRNA *type, + PointerRNA *r_ptr); #define WM_toolsystem_ref_properties_get_from_operator(tref, ot, r_ptr) \ WM_toolsystem_ref_properties_get_ex(tref, (ot)->idname, (ot)->srna, r_ptr) #define WM_toolsystem_ref_properties_get_from_gizmo_group(tref, gzgroup, r_ptr) \ WM_toolsystem_ref_properties_get_ex(tref, (gzgroup)->idname, (gzgroup)->srna, r_ptr) -void WM_toolsystem_ref_properties_init_for_keymap(struct bToolRef *tref, - struct PointerRNA *dst_ptr, - struct PointerRNA *src_ptr, - struct wmOperatorType *ot); +void WM_toolsystem_ref_properties_init_for_keymap(bToolRef *tref, + PointerRNA *dst_ptr, + PointerRNA *src_ptr, + wmOperatorType *ot); /** * Use to update the active tool (shown in the top bar) in the least disruptive way. @@ -146,15 +135,11 @@ void WM_toolsystem_ref_properties_init_for_keymap(struct bToolRef *tref, * * Used when undoing since the active mode may have changed. */ -void WM_toolsystem_refresh_active(struct bContext *C); +void WM_toolsystem_refresh_active(bContext *C); -void WM_toolsystem_refresh_screen_area(struct WorkSpace *workspace, - const struct Scene *scene, - struct ViewLayer *view_layer, - struct ScrArea *area); -void WM_toolsystem_refresh_screen_window(struct wmWindow *win); -void WM_toolsystem_refresh_screen_all(struct Main *bmain); - -#ifdef __cplusplus -} -#endif +void WM_toolsystem_refresh_screen_area(WorkSpace *workspace, + const Scene *scene, + ViewLayer *view_layer, + ScrArea *area); +void WM_toolsystem_refresh_screen_window(wmWindow *win); +void WM_toolsystem_refresh_screen_all(Main *bmain); diff --git a/source/blender/windowmanager/WM_types.hh b/source/blender/windowmanager/WM_types.hh index f1f04148e29..cfb8db3bed7 100644 --- a/source/blender/windowmanager/WM_types.hh +++ b/source/blender/windowmanager/WM_types.hh @@ -96,6 +96,8 @@ struct ID; struct ImBuf; struct bContext; +struct bContextStore; +struct GreasePencilLayer; struct wmDrag; struct wmDropBox; struct wmEvent; @@ -125,20 +127,20 @@ using AssetRepresentationHandle = blender::asset_system::AssetRepresentation; typedef void (*wmGenericUserDataFreeFn)(void *data); -typedef struct wmGenericUserData { +struct wmGenericUserData { void *data; /** When NULL, use #MEM_freeN. */ wmGenericUserDataFreeFn free_fn; bool use_free; -} wmGenericUserData; +}; -typedef void (*wmGenericCallbackFn)(struct bContext *C, void *user_data); +using wmGenericCallbackFn = void (*)(bContext *C, void *user_data); -typedef struct wmGenericCallback { +struct wmGenericCallback { wmGenericCallbackFn exec; void *user_data; wmGenericUserDataFreeFn free_user_data; -} wmGenericCallback; +}; /* ************** wmOperatorType ************************ */ @@ -302,16 +304,15 @@ enum { /* ************** Notifiers ****************** */ -typedef struct wmNotifier { - struct wmNotifier *next, *prev; +struct wmNotifier { + wmNotifier *next, *prev; - const struct wmWindow *window; + const wmWindow *window; unsigned int category, data, subtype, action; void *reference; - -} wmNotifier; +}; /* 4 levels * @@ -552,8 +553,8 @@ typedef struct wmNotifier { /** * wmGesture is registered to #wmWindow.gesture, handled by operator callbacks. */ -typedef struct wmGesture { - struct wmGesture *next, *prev; +struct wmGesture { + wmGesture *next, *prev; /** #wmEvent.type */ int event_type; /** #wmEvent.modifier */ @@ -602,7 +603,7 @@ typedef struct wmGesture { /** Free pointer to use for operator allocations (if set, its freed on exit). */ wmGenericUserData user_data; -} wmGesture; +}; /* ************** wmEvent ************************ */ @@ -636,7 +637,7 @@ typedef enum eWM_EventFlag { } eWM_EventFlag; ENUM_OPERATORS(eWM_EventFlag, WM_EVENT_FORCE_DRAG_THRESHOLD); -typedef struct wmTabletData { +struct wmTabletData { /** 0=EVT_TABLET_NONE, 1=EVT_TABLET_STYLUS, 2=EVT_TABLET_ERASER. */ int active; /** range 0.0 (not touching) to 1.0 (full pressure). */ @@ -647,7 +648,7 @@ typedef struct wmTabletData { float y_tilt; /** Interpret mouse motion as absolute as typical for tablets. */ char is_motion_absolute; -} wmTabletData; +}; /** * Each event should have full modifier state. @@ -687,8 +688,8 @@ typedef struct wmTabletData { * - Mouse-wheel events are excluded even though they generate #KM_PRESS * as clicking and dragging don't make sense for mouse wheel events. */ -typedef struct wmEvent { - struct wmEvent *next, *prev; +struct wmEvent { + wmEvent *next, *prev; /** Event code itself (short, is also in key-map). */ short type; @@ -772,7 +773,7 @@ typedef struct wmEvent { * Used to detect double-click events. */ double prev_press_time; -} wmEvent; +}; /** * Values below are ignored when detecting if the user intentionally moved the cursor. @@ -784,16 +785,16 @@ typedef struct wmEvent { #define WM_EVENT_CURSOR_MOTION_THRESHOLD ((float)U.move_threshold * UI_SCALE_FAC) /** Motion progress, for modal handlers. */ -typedef enum { +enum wmProgress { P_NOT_STARTED, P_STARTING, /* <-- */ P_IN_PROGRESS, /* <-- only these are sent for NDOF motion. */ P_FINISHING, /* <-- */ P_FINISHED, -} wmProgress; +}; #ifdef WITH_INPUT_NDOF -typedef struct wmNDOFMotionData { +struct wmNDOFMotionData { /* awfully similar to GHOST_TEventNDOFMotionData... */ /** * Each component normally ranges from -1 to +1, but can exceed that. @@ -813,18 +814,18 @@ typedef struct wmNDOFMotionData { float dt; /** Is this the first event, the last, or one of many in between? */ wmProgress progress; -} wmNDOFMotionData; +}; #endif /* WITH_INPUT_NDOF */ #ifdef WITH_XR_OPENXR /* Similar to GHOST_XrPose. */ -typedef struct wmXrPose { +struct wmXrPose { float position[3]; /* Blender convention (w, x, y, z) */ float orientation_quat[4]; -} wmXrPose; +}; -typedef struct wmXrActionState { +struct wmXrActionState { union { bool state_boolean; float state_float; @@ -832,9 +833,9 @@ typedef struct wmXrActionState { wmXrPose state_pose; }; int type; /* eXrActionType */ -} wmXrActionState; +}; -typedef struct wmXrActionData { +struct wmXrActionData { /** Action set name. */ char action_set[64]; /** Action name. */ @@ -861,12 +862,12 @@ typedef struct wmXrActionData { float controller_rot_other[4]; /** Operator. */ - struct wmOperatorType *ot; - struct IDProperty *op_properties; + wmOperatorType *ot; + IDProperty *op_properties; /** Whether bimanual interaction is occurring. */ bool bimanual; -} wmXrActionData; +}; #endif /** Timer flags. */ @@ -881,11 +882,11 @@ typedef enum { } wmTimerFlags; ENUM_OPERATORS(wmTimerFlags, WM_TIMER_TAGGED_FOR_REMOVAL) -typedef struct wmTimer { - struct wmTimer *next, *prev; +struct wmTimer { + wmTimer *next, *prev; /** Window this timer is attached to (optional). */ - struct wmWindow *win; + wmWindow *win; /** Set by timer user. */ double timestep; @@ -909,9 +910,9 @@ typedef struct wmTimer { double stime; /** Internal, put timers to sleep when needed. */ bool sleep; -} wmTimer; +}; -typedef struct wmOperatorType { +struct wmOperatorType { /** Text for UI, undo (should not exceed #OP_MAX_TYPENAME). */ const char *name; /** Unique identifier (must not exceed #OP_MAX_TYPENAME). */ @@ -929,7 +930,7 @@ typedef struct wmOperatorType { * any interface code or input device state. * See defines below for return values. */ - int (*exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT; + int (*exec)(bContext *, wmOperator *) ATTR_WARN_UNUSED_RESULT; /** * This callback executes on a running operator whenever as property @@ -937,7 +938,7 @@ typedef struct wmOperatorType { * invalid settings in exceptional cases. * Boolean return value, True denotes a change has been made and to redraw. */ - bool (*check)(struct bContext *, struct wmOperator *); + bool (*check)(bContext *, wmOperator *); /** * For modal temporary operators, initially invoke is called. then @@ -945,15 +946,13 @@ typedef struct wmOperatorType { * canceled due to some external reason, cancel is called * See defines below for return values. */ - int (*invoke)(struct bContext *, - struct wmOperator *, - const struct wmEvent *) ATTR_WARN_UNUSED_RESULT; + int (*invoke)(bContext *, wmOperator *, const wmEvent *) ATTR_WARN_UNUSED_RESULT; /** * Called when a modal operator is canceled (not used often). * Internal cleanup can be done here if needed. */ - void (*cancel)(struct bContext *, struct wmOperator *); + void (*cancel)(bContext *, wmOperator *); /** * Modal is used for operators which continuously run, eg: @@ -961,44 +960,42 @@ typedef struct wmOperatorType { * Modal operators can handle events which would normally access other operators, * they keep running until they don't return `OPERATOR_RUNNING_MODAL`. */ - int (*modal)(struct bContext *, - struct wmOperator *, - const struct wmEvent *) ATTR_WARN_UNUSED_RESULT; + int (*modal)(bContext *, wmOperator *, const wmEvent *) ATTR_WARN_UNUSED_RESULT; /** * Verify if the operator can be executed in the current context, note * that the operator might still fail to execute even if this return true. */ - bool (*poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT; + bool (*poll)(bContext *) ATTR_WARN_UNUSED_RESULT; /** * Use to check if properties should be displayed in auto-generated UI. * Use 'check' callback to enforce refreshing. */ - bool (*poll_property)(const struct bContext *C, - struct wmOperator *op, + bool (*poll_property)(const bContext *C, + wmOperator *op, const PropertyRNA *prop) ATTR_WARN_UNUSED_RESULT; /** Optional panel for redo and repeat, auto-generated if not set. */ - void (*ui)(struct bContext *, struct wmOperator *); + void (*ui)(bContext *, wmOperator *); /** * Return a different name to use in the user interface, based on property values. * The returned string does not need to be freed. */ - const char *(*get_name)(struct wmOperatorType *, struct PointerRNA *); + const char *(*get_name)(wmOperatorType *, PointerRNA *); /** * Return a different description to use in the user interface, based on property values. * The returned string must be freed by the caller, unless NULL. */ - char *(*get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *); + char *(*get_description)(bContext *C, wmOperatorType *, PointerRNA *); /** rna for properties */ - struct StructRNA *srna; + StructRNA *srna; /** previous settings - for initializing on re-use */ - struct IDProperty *last_properties; + IDProperty *last_properties; /** * Default rna property to use for generic invoke functions. @@ -1009,14 +1006,14 @@ typedef struct wmOperatorType { */ PropertyRNA *prop; - /** struct wmOperatorTypeMacro */ + /** wmOperatorTypeMacro */ ListBase macro; /** pointer to modal keymap, do not free! */ - struct wmKeyMap *modalkeymap; + wmKeyMap *modalkeymap; /** python needs the operator type as well */ - bool (*pyop_poll)(struct bContext *, struct wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT; + bool (*pyop_poll)(bContext *, wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT; /** RNA integration */ ExtensionRNA rna_ext; @@ -1026,25 +1023,24 @@ typedef struct wmOperatorType { /** Flag last for padding */ short flag; - -} wmOperatorType; +}; /** * Wrapper to reference a #wmOperatorType together with some set properties and other relevant * information to invoke the operator in a customizable way. */ -typedef struct wmOperatorCallParams { - struct wmOperatorType *optype; - struct PointerRNA *opptr; +struct wmOperatorCallParams { + wmOperatorType *optype; + PointerRNA *opptr; wmOperatorCallContext opcontext; -} wmOperatorCallParams; +}; #ifdef WITH_INPUT_IME /* *********** Input Method Editor (IME) *********** */ /** * \note similar to #GHOST_TEventImeData. */ -typedef struct wmIMEData { +struct wmIMEData { size_t result_len, composite_len; /** utf8 encoding */ @@ -1060,16 +1056,16 @@ typedef struct wmIMEData { int sel_end; bool is_ime_composing; -} wmIMEData; +}; #endif /* **************** Paint Cursor ******************* */ -typedef void (*wmPaintCursorDraw)(struct bContext *C, int, int, void *customdata); +using wmPaintCursorDraw = void (*)(bContext *C, int, int, void *customdata); /* *************** Drag and drop *************** */ -typedef enum eWM_DragDataType { +enum eWM_DragDataType { WM_DRAG_ID, WM_DRAG_ASSET, /** The user is dragging multiple assets. This is only supported in few specific cases, proper @@ -1084,30 +1080,30 @@ typedef enum eWM_DragDataType { WM_DRAG_DATASTACK, WM_DRAG_ASSET_CATALOG, WM_DRAG_GREASE_PENCIL_LAYER, -} eWM_DragDataType; +}; -typedef enum eWM_DragFlags { +enum eWM_DragFlags { WM_DRAG_NOP = 0, WM_DRAG_FREE_DATA = 1, -} eWM_DragFlags; +}; ENUM_OPERATORS(eWM_DragFlags, WM_DRAG_FREE_DATA) /* NOTE: structs need not exported? */ -typedef struct wmDragID { - struct wmDragID *next, *prev; - struct ID *id; - struct ID *from_parent; -} wmDragID; +struct wmDragID { + wmDragID *next, *prev; + ID *id; + ID *from_parent; +}; -typedef struct wmDragAsset { +struct wmDragAsset { int import_method; /* eAssetImportType */ const AssetRepresentationHandle *asset; -} wmDragAsset; +}; -typedef struct wmDragAssetCatalog { +struct wmDragAssetCatalog { bUUID drag_catalog_id; -} wmDragAssetCatalog; +}; /** * For some specific cases we support dragging multiple assets (#WM_DRAG_ASSET_LIST). There is no @@ -1117,57 +1113,54 @@ typedef struct wmDragAssetCatalog { * This struct basically contains a tagged union to either store a local ID pointer, or information * about an externally stored asset. */ -typedef struct wmDragAssetListItem { - struct wmDragAssetListItem *next, *prev; +struct wmDragAssetListItem { + wmDragAssetListItem *next, *prev; union { - struct ID *local_id; + ID *local_id; wmDragAsset *external_info; } asset_data; bool is_external; -} wmDragAssetListItem; +}; -typedef struct wmDragPath { +struct wmDragPath { char *path; /* Note that even though the enum type uses bit-flags, this should never have multiple type-bits * set, so `ELEM()` like comparison is possible. */ int file_type; /* eFileSel_File_Types */ -} wmDragPath; +}; -typedef struct wmDragGreasePencilLayer { - struct GreasePencilLayer *layer; -} wmDragGreasePencilLayer; +struct wmDragGreasePencilLayer { + GreasePencilLayer *layer; +}; -typedef char *(*WMDropboxTooltipFunc)(struct bContext *, - struct wmDrag *, - const int xy[2], - struct wmDropBox *drop); +using WMDropboxTooltipFunc = char *(*)(bContext *, wmDrag *, const int xy[2], wmDropBox *drop); -typedef struct wmDragActiveDropState { +struct wmDragActiveDropState { /** * Informs which dropbox is activated with the drag item. * When this value changes, the #draw_activate and #draw_deactivate dropbox callbacks are * triggered. */ - struct wmDropBox *active_dropbox; + wmDropBox *active_dropbox; /** * If `active_dropbox` is set, the area it successfully polled in. * To restore the context of it as needed. */ - struct ScrArea *area_from; + ScrArea *area_from; /** * If `active_dropbox` is set, the region it successfully polled in. * To restore the context of it as needed. */ - struct ARegion *region_from; + ARegion *region_from; /** * If `active_dropbox` is set, additional context provided by the active (i.e. hovered) button. * Activated before context sensitive operations (polling, drawing, dropping). */ - struct bContextStore *ui_context; + bContextStore *ui_context; /** * Text to show when a dropbox poll succeeds (so the dropbox itself is available) but the @@ -1176,10 +1169,10 @@ typedef struct wmDragActiveDropState { */ const char *disabled_info; bool free_disabled_info; -} wmDragActiveDropState; +}; -typedef struct wmDrag { - struct wmDrag *next, *prev; +struct wmDrag { + wmDrag *next, *prev; int icon; eWM_DragDataType type; @@ -1187,7 +1180,7 @@ typedef struct wmDrag { double value; /** If no icon but imbuf should be drawn around cursor. */ - const struct ImBuf *imb; + const ImBuf *imb; float imbuf_scale; wmDragActiveDropState drop_state; @@ -1198,7 +1191,7 @@ typedef struct wmDrag { ListBase ids; /** List of `wmDragAssetListItem`s. */ ListBase asset_items; -} wmDrag; +}; /** * Drop-boxes are like key-maps, part of the screen/area/region definition. @@ -1208,35 +1201,32 @@ typedef struct wmDrag { * way to override that (by design, since drop-boxes should act on the exact mouse position). * So the drop-boxes are supposed to check the required area and region context in their poll. */ -typedef struct wmDropBox { - struct wmDropBox *next, *prev; +struct wmDropBox { + wmDropBox *next, *prev; /** Test if the dropbox is active. */ - bool (*poll)(struct bContext *C, struct wmDrag *drag, const wmEvent *event); + bool (*poll)(bContext *C, wmDrag *drag, const wmEvent *event); /** Called when the drag action starts. Can be used to prefetch data for previews. * \note The dropbox that will be called eventually is not known yet when starting the drag. * So this callback is called on every dropbox that is registered in the current screen. */ - void (*on_drag_start)(struct bContext *C, struct wmDrag *drag); + void (*on_drag_start)(bContext *C, wmDrag *drag); /** Before exec, this copies drag info to #wmDrop properties. */ - void (*copy)(struct bContext *C, struct wmDrag *drag, struct wmDropBox *drop); + void (*copy)(bContext *C, wmDrag *drag, wmDropBox *drop); /** * If the operator is canceled (returns `OPERATOR_CANCELLED`), this can be used for cleanup of * `copy()` resources. */ - void (*cancel)(struct Main *bmain, struct wmDrag *drag, struct wmDropBox *drop); + void (*cancel)(Main *bmain, wmDrag *drag, wmDropBox *drop); /** * Override the default cursor overlay drawing function. * Can be used to draw text or thumbnails. IE a tooltip for drag and drop. * \param xy: Cursor location in window coordinates (#wmEvent.xy compatible). */ - void (*draw_droptip)(struct bContext *C, - struct wmWindow *win, - struct wmDrag *drag, - const int xy[2]); + void (*draw_droptip)(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2]); /** * Called with the draw buffer (#GPUViewport) set up for drawing into the region's view. @@ -1244,16 +1234,13 @@ typedef struct wmDropBox { * The callback has to do that itself, with for example #UI_view2d_view_ortho. * \param xy: Cursor location in window coordinates (#wmEvent.xy compatible). */ - void (*draw_in_view)(struct bContext *C, - struct wmWindow *win, - struct wmDrag *drag, - const int xy[2]); + void (*draw_in_view)(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2]); /** Called when poll returns true the first time. */ - void (*draw_activate)(struct wmDropBox *drop, struct wmDrag *drag); + void (*draw_activate)(wmDropBox *drop, wmDrag *drag); /** Called when poll returns false the first time or when the drag event ends. */ - void (*draw_deactivate)(struct wmDropBox *drop, struct wmDrag *drag); + void (*draw_deactivate)(wmDropBox *drop, wmDrag *drag); /** Custom data for drawing. */ void *draw_data; @@ -1268,53 +1255,50 @@ typedef struct wmDropBox { wmOperatorType *ot; /** Operator properties, assigned to ptr->data and can be written to a file. */ - struct IDProperty *properties; + IDProperty *properties; /** RNA pointer to access properties. */ - struct PointerRNA *ptr; -} wmDropBox; + PointerRNA *ptr; +}; /** * Struct to store tool-tip timer and possible creation if the time is reached. * Allows UI code to call #WM_tooltip_timer_init without each user having to handle the timer. */ -typedef struct wmTooltipState { +struct wmTooltipState { /** Create tooltip on this event. */ - struct wmTimer *timer; + wmTimer *timer; /** The area the tooltip is created in. */ - struct ScrArea *area_from; + ScrArea *area_from; /** The region the tooltip is created in. */ - struct ARegion *region_from; + ARegion *region_from; /** The tooltip region. */ - struct ARegion *region; + ARegion *region; /** Create the tooltip region (assign to 'region'). */ - struct ARegion *(*init)(struct bContext *C, - struct ARegion *region, - int *pass, - double *pass_delay, - bool *r_exit_on_event); + ARegion *(*init)( + bContext *C, ARegion *region, int *pass, double *pass_delay, bool *r_exit_on_event); /** Exit on any event, not needed for buttons since their highlight state is used. */ bool exit_on_event; /** Cursor location at the point of tooltip creation. */ int event_xy[2]; /** Pass, use when we want multiple tips, count down to zero. */ int pass; -} wmTooltipState; +}; /* *************** migrated stuff, clean later? ************** */ -typedef struct RecentFile { +struct RecentFile { struct RecentFile *next, *prev; char *filepath; -} RecentFile; +}; /* Logging */ struct CLG_LogRef; /* wm_init_exit.cc */ -extern struct CLG_LogRef *WM_LOG_OPERATORS; -extern struct CLG_LogRef *WM_LOG_HANDLERS; -extern struct CLG_LogRef *WM_LOG_EVENTS; -extern struct CLG_LogRef *WM_LOG_KEYMAPS; -extern struct CLG_LogRef *WM_LOG_TOOLS; -extern struct CLG_LogRef *WM_LOG_MSGBUS_PUB; -extern struct CLG_LogRef *WM_LOG_MSGBUS_SUB; +extern CLG_LogRef *WM_LOG_OPERATORS; +extern CLG_LogRef *WM_LOG_HANDLERS; +extern CLG_LogRef *WM_LOG_EVENTS; +extern CLG_LogRef *WM_LOG_KEYMAPS; +extern CLG_LogRef *WM_LOG_TOOLS; +extern CLG_LogRef *WM_LOG_MSGBUS_PUB; +extern CLG_LogRef *WM_LOG_MSGBUS_SUB; diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc index 83d49327836..8287e958877 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc @@ -37,7 +37,7 @@ #endif /* only for own init/exit calls (wm_gizmotype_init/wm_gizmotype_free) */ -#include "wm.h" +#include "wm.hh" /* own includes */ #include "wm_gizmo_intern.h" diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.cc index 873ef90e558..de71c4a696a 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group_type.cc @@ -23,7 +23,7 @@ #include "WM_types.hh" /* only for own init/exit calls (wm_gizmogrouptype_init/wm_gizmogrouptype_free) */ -#include "wm.h" +#include "wm.hh" /* own includes */ #include "wm_gizmo_intern.h" diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.cc index 4b9fa6af74a..c431de5fbeb 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_target_props.cc @@ -19,7 +19,7 @@ #include "WM_message.hh" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "ED_keyframing.h" #include "ED_screen.hh" diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.cc index 483566bde5e..8c2ea1dca7e 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_type.cc @@ -30,7 +30,7 @@ #include "ED_screen.hh" /* only for own init/exit calls (wm_gizmotype_init/wm_gizmotype_free) */ -#include "wm.h" +#include "wm.hh" /* own includes */ #include "wm_gizmo_intern.h" diff --git a/source/blender/windowmanager/gizmo/wm_gizmo_wmapi.h b/source/blender/windowmanager/gizmo/wm_gizmo_wmapi.h index 50526539cf5..f73cc116980 100644 --- a/source/blender/windowmanager/gizmo/wm_gizmo_wmapi.h +++ b/source/blender/windowmanager/gizmo/wm_gizmo_wmapi.h @@ -10,7 +10,7 @@ * needed to hook up the gizmo system with Blender's window manager. It's * mostly the event system that needs to communicate with gizmo code. * - * Only included in wm.h and lower level files. + * Only included in wm.hh and lower level files. */ #pragma once diff --git a/source/blender/windowmanager/intern/wm.cc b/source/blender/windowmanager/intern/wm.cc index bbbe73a90c9..479c33509a3 100644 --- a/source/blender/windowmanager/intern/wm.cc +++ b/source/blender/windowmanager/intern/wm.cc @@ -42,10 +42,10 @@ #include "WM_api.hh" #include "WM_message.hh" #include "WM_types.hh" -#include "wm.h" -#include "wm_draw.h" +#include "wm.hh" +#include "wm_draw.hh" #include "wm_event_system.h" -#include "wm_window.h" +#include "wm_window.hh" #ifdef WITH_XR_OPENXR # include "wm_xr.h" #endif diff --git a/source/blender/windowmanager/intern/wm_cursors.cc b/source/blender/windowmanager/intern/wm_cursors.cc index ca3902c55c9..3d1825d92b4 100644 --- a/source/blender/windowmanager/intern/wm_cursors.cc +++ b/source/blender/windowmanager/intern/wm_cursors.cc @@ -28,7 +28,7 @@ #include "WM_api.hh" #include "WM_types.hh" #include "wm_cursors.hh" -#include "wm_window.h" +#include "wm_window.hh" /* Blender custom cursor. */ struct BCursor { diff --git a/source/blender/windowmanager/intern/wm_dragdrop.cc b/source/blender/windowmanager/intern/wm_dragdrop.cc index 249d9ff497a..385518adff0 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.cc +++ b/source/blender/windowmanager/intern/wm_dragdrop.cc @@ -58,7 +58,7 @@ #include "WM_api.hh" #include "WM_types.hh" #include "wm_event_system.h" -#include "wm_window.h" +#include "wm_window.hh" /* ****************************************************** */ diff --git a/source/blender/windowmanager/intern/wm_draw.cc b/source/blender/windowmanager/intern/wm_draw.cc index 80db1d406ba..8abc582ce09 100644 --- a/source/blender/windowmanager/intern/wm_draw.cc +++ b/source/blender/windowmanager/intern/wm_draw.cc @@ -53,11 +53,11 @@ #include "WM_api.hh" #include "WM_toolsystem.h" #include "WM_types.hh" -#include "wm.h" -#include "wm_draw.h" +#include "wm.hh" +#include "wm_draw.hh" #include "wm_event_system.h" #include "wm_surface.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "UI_resources.h" diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 71d97d8a8de..6917d617170 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -72,11 +72,11 @@ #include "WM_toolsystem.h" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "wm_event_system.h" #include "wm_event_types.hh" #include "wm_surface.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "wm_window_private.h" #include "DEG_depsgraph.h" @@ -4634,7 +4634,7 @@ void WM_event_get_keymap_from_toolsystem(wmWindowManager *wm, } wmEventHandler_Keymap *WM_event_add_keymap_handler_dynamic( - ListBase *handlers, wmEventHandler_KeymapDynamicFn *keymap_fn, void *user_data) + ListBase *handlers, wmEventHandler_KeymapDynamicFn keymap_fn, void *user_data) { if (!keymap_fn) { CLOG_WARN(WM_LOG_HANDLERS, "called with nullptr keymap_fn"); diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index 70af74d9ffc..c097f865724 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -129,10 +129,10 @@ #include "WM_toolsystem.h" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "wm_event_system.h" #include "wm_files.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "CLG_log.h" diff --git a/source/blender/windowmanager/intern/wm_gesture.cc b/source/blender/windowmanager/intern/wm_gesture.cc index 73e1889a610..bc943522c04 100644 --- a/source/blender/windowmanager/intern/wm_gesture.cc +++ b/source/blender/windowmanager/intern/wm_gesture.cc @@ -26,8 +26,8 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" -#include "wm_draw.h" +#include "wm.hh" +#include "wm_draw.hh" #include "GPU_immediate.h" #include "GPU_immediate_util.h" diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.cc b/source/blender/windowmanager/intern/wm_gesture_ops.cc index 6502f93ae67..f670e569781 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.cc +++ b/source/blender/windowmanager/intern/wm_gesture_ops.cc @@ -24,7 +24,7 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "wm_event_system.h" #include "wm_event_types.hh" diff --git a/source/blender/windowmanager/intern/wm_init_exit.cc b/source/blender/windowmanager/intern/wm_init_exit.cc index b225331f070..03775fe2e90 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.cc +++ b/source/blender/windowmanager/intern/wm_init_exit.cc @@ -86,13 +86,13 @@ #include "WM_message.hh" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "wm_cursors.hh" #include "wm_event_system.h" #include "wm_files.hh" #include "wm_platform_support.h" #include "wm_surface.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "ED_anim_api.h" #include "ED_armature.h" diff --git a/source/blender/windowmanager/intern/wm_jobs.cc b/source/blender/windowmanager/intern/wm_jobs.cc index 89a0084ee6c..fa7ec3418b9 100644 --- a/source/blender/windowmanager/intern/wm_jobs.cc +++ b/source/blender/windowmanager/intern/wm_jobs.cc @@ -25,7 +25,7 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "wm_event_types.hh" #include "PIL_time.h" diff --git a/source/blender/windowmanager/intern/wm_operator_type.cc b/source/blender/windowmanager/intern/wm_operator_type.cc index 795104d4867..c364ec85590 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.cc +++ b/source/blender/windowmanager/intern/wm_operator_type.cc @@ -35,7 +35,7 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "wm_event_system.h" #define UNDOCUMENTED_OPERATOR_TIP N_("(undocumented operator)") diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index efc0a154746..c2c4315c410 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -94,12 +94,12 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" -#include "wm_draw.h" +#include "wm.hh" +#include "wm_draw.hh" #include "wm_event_system.h" #include "wm_event_types.hh" #include "wm_files.hh" -#include "wm_window.h" +#include "wm_window.hh" #ifdef WITH_XR_OPENXR # include "wm_xr.h" #endif diff --git a/source/blender/windowmanager/intern/wm_splash_screen.cc b/source/blender/windowmanager/intern/wm_splash_screen.cc index f3b6a9371d3..ca0630aebaf 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.cc +++ b/source/blender/windowmanager/intern/wm_splash_screen.cc @@ -50,7 +50,7 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" static void wm_block_close(bContext *C, void *arg_block, void * /*arg*/) { diff --git a/source/blender/windowmanager/intern/wm_stereo.cc b/source/blender/windowmanager/intern/wm_stereo.cc index a45c84c400f..af382229e1c 100644 --- a/source/blender/windowmanager/intern/wm_stereo.cc +++ b/source/blender/windowmanager/intern/wm_stereo.cc @@ -33,9 +33,9 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" -#include "wm_draw.h" -#include "wm_window.h" +#include "wm.hh" +#include "wm_draw.hh" +#include "wm_window.hh" #include "UI_interface.h" #include "UI_resources.h" diff --git a/source/blender/windowmanager/intern/wm_surface.cc b/source/blender/windowmanager/intern/wm_surface.cc index 2627841e4b3..4089d2cb92a 100644 --- a/source/blender/windowmanager/intern/wm_surface.cc +++ b/source/blender/windowmanager/intern/wm_surface.cc @@ -24,7 +24,7 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" +#include "wm.hh" #include "wm_surface.hh" diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index 67c4d3ea2ba..090eb376726 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -44,12 +44,12 @@ #include "WM_api.hh" #include "WM_types.hh" -#include "wm.h" -#include "wm_draw.h" +#include "wm.hh" +#include "wm_draw.hh" #include "wm_event_system.h" #include "wm_files.hh" #include "wm_platform_support.h" -#include "wm_window.h" +#include "wm_window.hh" #include "wm_window_private.h" #ifdef WITH_XR_OPENXR # include "wm_xr.h" diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus_intern.hh b/source/blender/windowmanager/message_bus/intern/wm_message_bus_intern.hh index 3340cc6a1ed..bc48f49ad08 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus_intern.hh +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus_intern.hh @@ -11,7 +11,7 @@ #include "../wm_message_bus.hh" struct wmMsgBus { - struct GSet *messages_gset[WM_MSG_TYPE_NUM]; + GSet *messages_gset[WM_MSG_TYPE_NUM]; /** Messages in order of being added. */ ListBase messages; /** Avoid checking messages when no tags exist. */ @@ -21,13 +21,12 @@ struct wmMsgBus { /** * \note #wmMsgBus.messages_tag_count isn't updated, caller must handle. */ -void wm_msg_subscribe_value_free(struct wmMsgSubscribeKey *msg_key, - struct wmMsgSubscribeValueLink *msg_lnk); +void wm_msg_subscribe_value_free(wmMsgSubscribeKey *msg_key, wmMsgSubscribeValueLink *msg_lnk); -typedef struct wmMsgSubscribeKey_Generic { +struct wmMsgSubscribeKey_Generic { wmMsgSubscribeKey head; wmMsg msg; -} wmMsgSubscribeKey_Generic; +}; BLI_INLINE const wmMsg *wm_msg_subscribe_value_msg_cast(const wmMsgSubscribeKey *key) { diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.hh b/source/blender/windowmanager/message_bus/wm_message_bus.hh index a26884de147..245115d9d90 100644 --- a/source/blender/windowmanager/message_bus/wm_message_bus.hh +++ b/source/blender/windowmanager/message_bus/wm_message_bus.hh @@ -15,65 +15,61 @@ struct ID; struct bContext; struct wmMsg; - /* Opaque (don't expose outside `wm_message_bus.cc`). */ struct wmMsgBus; struct wmMsgSubscribeKey; struct wmMsgSubscribeValue; struct wmMsgSubscribeValueLink; -typedef void (*wmMsgNotifyFn)(struct bContext *C, - struct wmMsgSubscribeKey *msg_key, - struct wmMsgSubscribeValue *msg_val); -typedef void (*wmMsgSubscribeValueFreeDataFn)(struct wmMsgSubscribeKey *msg_key, - struct wmMsgSubscribeValue *msg_val); +using wmMsgNotifyFn = void (*)(bContext *C, + wmMsgSubscribeKey *msg_key, + wmMsgSubscribeValue *msg_val); +using wmMsgSubscribeValueFreeDataFn = void (*)(wmMsgSubscribeKey *msg_key, + wmMsgSubscribeValue *msg_val); /* Exactly what arguments here is not obvious. */ -typedef void (*wmMsgSubscribeValueUpdateIdFn)(struct bContext *C, - struct wmMsgBus *mbus, - struct ID *id_src, - struct ID *id_dst, - struct wmMsgSubscribeValue *msg_val); +using wmMsgSubscribeValueUpdateIdFn = + void (*)(bContext *C, wmMsgBus *mbus, ID *id_src, ID *id_dst, wmMsgSubscribeValue *msg_val); enum { WM_MSG_TYPE_RNA = 0, WM_MSG_TYPE_STATIC = 1, }; #define WM_MSG_TYPE_NUM 2 -typedef struct wmMsgTypeInfo { +struct wmMsgTypeInfo { struct { unsigned int (*hash_fn)(const void *msg); bool (*cmp_fn)(const void *a, const void *b); void (*key_free_fn)(void *key); } gset; - void (*update_by_id)(struct wmMsgBus *mbus, struct ID *id_src, struct ID *id_dst); - void (*remove_by_id)(struct wmMsgBus *mbus, const struct ID *id); - void (*repr)(FILE *stream, const struct wmMsgSubscribeKey *msg_key); + void (*update_by_id)(wmMsgBus *mbus, ID *id_src, ID *id_dst); + void (*remove_by_id)(wmMsgBus *mbus, const ID *id); + void (*repr)(FILE *stream, const wmMsgSubscribeKey *msg_key); /* sizeof(wmMsgSubscribeKey_*) */ uint msg_key_size; -} wmMsgTypeInfo; +}; -typedef struct wmMsg { +struct wmMsg { unsigned int type; // #ifdef DEBUG /* For debugging: '__func__:__LINE__'. */ const char *id; // #endif -} wmMsg; +}; -typedef struct wmMsgSubscribeKey { +struct wmMsgSubscribeKey { /** Linked list for predictable ordering, otherwise we would depend on #GHash bucketing. */ - struct wmMsgSubscribeKey *next, *prev; + wmMsgSubscribeKey *next, *prev; ListBase values; /* Over-allocate, eg: #wmMsgSubscribeKey_RNA */ /* Last member will be 'wmMsg_*' */ -} wmMsgSubscribeKey; +}; /** One of many in #wmMsgSubscribeKey.values */ -typedef struct wmMsgSubscribeValue { - struct wmMsgSubscribe *next, *prev; +struct wmMsgSubscribeValue { + wmMsgSubscribeValue *next, *prev; /** Handle, used to iterate and clear. */ void *owner; @@ -90,25 +86,25 @@ typedef struct wmMsgSubscribeValue { /* tag to run when handling events, * we may want option for immediate execution. */ uint tag : 1; -} wmMsgSubscribeValue; +}; /** One of many in #wmMsgSubscribeKey.values */ -typedef struct wmMsgSubscribeValueLink { - struct wmMsgSubscribeValueLink *next, *prev; +struct wmMsgSubscribeValueLink { + wmMsgSubscribeValueLink *next, *prev; wmMsgSubscribeValue params; -} wmMsgSubscribeValueLink; +}; -void WM_msgbus_types_init(void); +void WM_msgbus_types_init(); -struct wmMsgBus *WM_msgbus_create(void); -void WM_msgbus_destroy(struct wmMsgBus *mbus); +wmMsgBus *WM_msgbus_create(); +void WM_msgbus_destroy(wmMsgBus *mbus); -void WM_msgbus_clear_by_owner(struct wmMsgBus *mbus, void *owner); +void WM_msgbus_clear_by_owner(wmMsgBus *mbus, void *owner); -void WM_msg_dump(struct wmMsgBus *mbus, const char *info); -void WM_msgbus_handle(struct wmMsgBus *mbus, struct bContext *C); +void WM_msg_dump(wmMsgBus *mbus, const char *info); +void WM_msgbus_handle(wmMsgBus *mbus, bContext *C); -void WM_msg_publish_with_key(struct wmMsgBus *mbus, wmMsgSubscribeKey *msg_key); +void WM_msg_publish_with_key(wmMsgBus *mbus, wmMsgSubscribeKey *msg_key); /** * \param msg_key_test: Needs following #wmMsgSubscribeKey fields filled in: * - `msg.params` @@ -119,12 +115,12 @@ void WM_msg_publish_with_key(struct wmMsgBus *mbus, wmMsgSubscribeKey *msg_key); * \return The key for this subscription. * note that this is only needed in rare cases when the key needs further manipulation. */ -wmMsgSubscribeKey *WM_msg_subscribe_with_key(struct wmMsgBus *mbus, +wmMsgSubscribeKey *WM_msg_subscribe_with_key(wmMsgBus *mbus, const wmMsgSubscribeKey *msg_key_test, const wmMsgSubscribeValue *msg_val_params); -void WM_msg_id_update(struct wmMsgBus *mbus, struct ID *id_src, struct ID *id_dst); -void WM_msg_id_remove(struct wmMsgBus *mbus, const struct ID *id); +void WM_msg_id_update(wmMsgBus *mbus, ID *id_src, ID *id_dst); +void WM_msg_id_remove(wmMsgBus *mbus, const ID *id); /* -------------------------------------------------------------------------- */ /* `wm_message_bus_static.cc` */ @@ -136,33 +132,33 @@ enum { WM_MSG_STATICTYPE_FILE_READ = 2, }; -typedef struct wmMsgParams_Static { +struct wmMsgParams_Static { int event; -} wmMsgParams_Static; +}; -typedef struct wmMsg_Static { +struct wmMsg_Static { wmMsg head; /* keep first */ wmMsgParams_Static params; -} wmMsg_Static; +}; -typedef struct wmMsgSubscribeKey_Static { +struct wmMsgSubscribeKey_Static { wmMsgSubscribeKey head; wmMsg_Static msg; -} wmMsgSubscribeKey_Static; +}; void WM_msgtypeinfo_init_static(wmMsgTypeInfo *msgtype_info); -wmMsgSubscribeKey_Static *WM_msg_lookup_static(struct wmMsgBus *mbus, +wmMsgSubscribeKey_Static *WM_msg_lookup_static(wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params); -void WM_msg_publish_static_params(struct wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params); -void WM_msg_publish_static(struct wmMsgBus *mbus, +void WM_msg_publish_static_params(wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params); +void WM_msg_publish_static(wmMsgBus *mbus, /* wmMsgParams_Static (expanded) */ int event); -void WM_msg_subscribe_static_params(struct wmMsgBus *mbus, +void WM_msg_subscribe_static_params(wmMsgBus *mbus, const wmMsgParams_Static *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr); -void WM_msg_subscribe_static(struct wmMsgBus *mbus, +void WM_msg_subscribe_static(wmMsgBus *mbus, int event, const wmMsgSubscribeValue *msg_val_params, const char *id_repr); @@ -170,7 +166,7 @@ void WM_msg_subscribe_static(struct wmMsgBus *mbus, /* -------------------------------------------------------------------------- */ /* `wm_message_bus_rna.cc` */ -typedef struct wmMsgParams_RNA { +struct wmMsgParams_RNA { /** when #PointerRNA.data & owner_id are NULL. match against all. */ PointerRNA ptr; /** when NULL, match against any property. */ @@ -181,43 +177,42 @@ typedef struct wmMsgParams_RNA { * otherwise it's allocated. */ char *data_path; -} wmMsgParams_RNA; +}; -typedef struct wmMsg_RNA { +struct wmMsg_RNA { wmMsg head; /* keep first */ wmMsgParams_RNA params; -} wmMsg_RNA; +}; -typedef struct wmMsgSubscribeKey_RNA { +struct wmMsgSubscribeKey_RNA { wmMsgSubscribeKey head; wmMsg_RNA msg; -} wmMsgSubscribeKey_RNA; +}; void WM_msgtypeinfo_init_rna(wmMsgTypeInfo *msgtype_info); -wmMsgSubscribeKey_RNA *WM_msg_lookup_rna(struct wmMsgBus *mbus, - const wmMsgParams_RNA *msg_key_params); -void WM_msg_publish_rna_params(struct wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params); -void WM_msg_publish_rna(struct wmMsgBus *mbus, +wmMsgSubscribeKey_RNA *WM_msg_lookup_rna(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params); +void WM_msg_publish_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params); +void WM_msg_publish_rna(wmMsgBus *mbus, /* wmMsgParams_RNA (expanded) */ PointerRNA *ptr, PropertyRNA *prop); -void WM_msg_subscribe_rna_params(struct wmMsgBus *mbus, +void WM_msg_subscribe_rna_params(wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr); -void WM_msg_subscribe_rna(struct wmMsgBus *mbus, +void WM_msg_subscribe_rna(wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr); /* ID variants */ -void WM_msg_subscribe_ID(struct wmMsgBus *mbus, - struct ID *id, +void WM_msg_subscribe_ID(wmMsgBus *mbus, + ID *id, const wmMsgSubscribeValue *msg_val_params, const char *id_repr); -void WM_msg_publish_ID(struct wmMsgBus *mbus, struct ID *id); +void WM_msg_publish_ID(wmMsgBus *mbus, ID *id); #define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_) \ { \ diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.hh similarity index 80% rename from source/blender/windowmanager/wm.h rename to source/blender/windowmanager/wm.hh index 2064e92f3fe..408f0b7a358 100644 --- a/source/blender/windowmanager/wm.h +++ b/source/blender/windowmanager/wm.hh @@ -12,21 +12,17 @@ struct wmWindow; #include "gizmo/wm_gizmo_wmapi.h" -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct wmPaintCursor { - struct wmPaintCursor *next, *prev; +struct wmPaintCursor { + wmPaintCursor *next, *prev; void *customdata; - bool (*poll)(struct bContext *C); + bool (*poll)(bContext *C); void (*draw)(bContext *C, int, int, void *customdata); short space_type; short region_type; -} wmPaintCursor; +}; /** * Cause a delayed #WM_exit() @@ -42,7 +38,7 @@ extern void wm_close_and_free(bContext *C, wmWindowManager *); /** * On startup, it adds all data, for matching. */ -extern void wm_add_default(struct Main *bmain, bContext *C); +extern void wm_add_default(Main *bmain, bContext *C); extern void wm_clear_default_size(bContext *C); /* Register to window-manager for redo or macro. */ @@ -56,26 +52,26 @@ void wm_operator_register(bContext *C, wmOperator *op); /* wm_operator.c, for init/exit */ -void wm_operatortype_free(void); +void wm_operatortype_free(); /** * Called on initialize #WM_init(). */ -void wm_operatortype_init(void); +void wm_operatortype_init(); /** * Default key-map for windows and screens, only call once per WM. */ void wm_window_keymap(wmKeyConfig *keyconf); -void wm_operatortypes_register(void); +void wm_operatortypes_register(); /* `wm_gesture.cc` */ /* Called in `wm_draw.cc`. */ -void wm_gesture_draw(struct wmWindow *win); +void wm_gesture_draw(wmWindow *win); /** * Use for line gesture. */ -void wm_gesture_tag_redraw(struct wmWindow *win); +void wm_gesture_tag_redraw(wmWindow *win); /* `wm_jobs.cc` */ @@ -93,10 +89,10 @@ void wm_jobs_timer_end(wmWindowManager *wm, wmTimer *wt); /** * Run the auto-save timer action. */ -void wm_autosave_timer(struct Main *bmain, wmWindowManager *wm, wmTimer *wt); -void wm_autosave_timer_begin(struct wmWindowManager *wm); +void wm_autosave_timer(Main *bmain, wmWindowManager *wm, wmTimer *wt); +void wm_autosave_timer_begin(wmWindowManager *wm); void wm_autosave_timer_end(wmWindowManager *wm); -void wm_autosave_delete(void); +void wm_autosave_delete(); /* `wm_splash_screen.cc` */ @@ -124,7 +120,3 @@ void wm_stereo3d_set_cancel(bContext *C, wmOperator *op); */ void wm_open_init_load_ui(wmOperator *op, bool use_prefs); void wm_open_init_use_scripts(wmOperator *op, bool use_prefs); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/windowmanager/wm_cursors.hh b/source/blender/windowmanager/wm_cursors.hh index 90bd3426654..1f3603cc5f1 100644 --- a/source/blender/windowmanager/wm_cursors.hh +++ b/source/blender/windowmanager/wm_cursors.hh @@ -61,5 +61,5 @@ typedef enum WMCursorType { WM_CURSOR_NUM, } WMCursorType; -void wm_init_cursor_data(void); +void wm_init_cursor_data(); bool wm_cursor_arrow_move(struct wmWindow *win, const struct wmEvent *event); diff --git a/source/blender/windowmanager/wm_draw.h b/source/blender/windowmanager/wm_draw.h deleted file mode 100644 index 63e86e4f1b8..00000000000 --- a/source/blender/windowmanager/wm_draw.h +++ /dev/null @@ -1,42 +0,0 @@ -/* SPDX-FileCopyrightText: 2007 Blender Foundation - * - * SPDX-License-Identifier: GPL-2.0-or-later */ - -/** \file - * \ingroup wm - */ - -#pragma once - -struct GPUOffScreen; -struct GPUTexture; -struct GPUViewport; - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct wmDrawBuffer { - struct GPUOffScreen *offscreen; - struct GPUViewport *viewport; - bool stereo; - int bound_view; -} wmDrawBuffer; - -struct ARegion; -struct ScrArea; -struct bContext; -struct wmWindow; - -/* `wm_draw.cc` */ - -void wm_draw_update(struct bContext *C); -void wm_draw_region_clear(struct wmWindow *win, struct ARegion *region); -void wm_draw_region_blend(struct ARegion *region, int view, bool blend); -void wm_draw_region_test(struct bContext *C, struct ScrArea *area, struct ARegion *region); - -struct GPUTexture *wm_draw_region_texture(struct ARegion *region, int view); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/windowmanager/wm_draw.hh b/source/blender/windowmanager/wm_draw.hh new file mode 100644 index 00000000000..3190ac451f4 --- /dev/null +++ b/source/blender/windowmanager/wm_draw.hh @@ -0,0 +1,33 @@ +/* SPDX-FileCopyrightText: 2007 Blender Foundation + * + * SPDX-License-Identifier: GPL-2.0-or-later */ + +/** \file + * \ingroup wm + */ + +#pragma once + +struct ARegion; +struct GPUOffScreen; +struct GPUTexture; +struct GPUViewport; +struct ScrArea; +struct bContext; +struct wmWindow; + +struct wmDrawBuffer { + struct GPUOffScreen *offscreen; + struct GPUViewport *viewport; + bool stereo; + int bound_view; +}; + +/* `wm_draw.cc` */ + +void wm_draw_update(bContext *C); +void wm_draw_region_clear(wmWindow *win, ARegion *region); +void wm_draw_region_blend(ARegion *region, int view, bool blend); +void wm_draw_region_test(bContext *C, ScrArea *area, ARegion *region); + +GPUTexture *wm_draw_region_texture(ARegion *region, int view); diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h index 4aa978755ba..85e066fab38 100644 --- a/source/blender/windowmanager/wm_event_system.h +++ b/source/blender/windowmanager/wm_event_system.h @@ -17,31 +17,27 @@ enum wmOperatorCallContext; struct wmXrActionData; #endif -#ifdef __cplusplus -extern "C" { -#endif - /* wmKeyMap is in DNA_windowmanager.h, it's saveable */ /** Custom types for handlers, for signaling, freeing */ -typedef enum eWM_EventHandlerType { +enum eWM_EventHandlerType { WM_HANDLER_TYPE_GIZMO = 1, WM_HANDLER_TYPE_UI, WM_HANDLER_TYPE_OP, WM_HANDLER_TYPE_DROPBOX, WM_HANDLER_TYPE_KEYMAP, -} eWM_EventHandlerType; +}; -typedef bool (*EventHandlerPoll)(const ARegion *region, const wmEvent *event); +using EventHandlerPoll = bool (*)(const ARegion *region, const wmEvent *event); -typedef struct wmEventHandler { - struct wmEventHandler *next, *prev; +struct wmEventHandler { + wmEventHandler *next, *prev; eWM_EventHandlerType type; eWM_EventHandlerFlag flag; EventHandlerPoll poll; -} wmEventHandler; +}; /** Run after the keymap item runs. */ struct wmEventHandler_KeymapPost { @@ -51,33 +47,33 @@ struct wmEventHandler_KeymapPost { /** Support for a getter function that looks up the keymap each access. */ struct wmEventHandler_KeymapDynamic { - wmEventHandler_KeymapDynamicFn *keymap_fn; + wmEventHandler_KeymapDynamicFn keymap_fn; void *user_data; }; /** #WM_HANDLER_TYPE_KEYMAP */ -typedef struct wmEventHandler_Keymap { +struct wmEventHandler_Keymap { wmEventHandler head; /** Pointer to builtin/custom keymaps (never NULL). */ wmKeyMap *keymap; - struct wmEventHandler_KeymapPost post; - struct wmEventHandler_KeymapDynamic dynamic; + wmEventHandler_KeymapPost post; + wmEventHandler_KeymapDynamic dynamic; - struct bToolRef *keymap_tool; -} wmEventHandler_Keymap; + bToolRef *keymap_tool; +}; /** #WM_HANDLER_TYPE_GIZMO */ -typedef struct wmEventHandler_Gizmo { +struct wmEventHandler_Gizmo { wmEventHandler head; /** Gizmo handler (never NULL). */ struct wmGizmoMap *gizmo_map; -} wmEventHandler_Gizmo; +}; /** #WM_HANDLER_TYPE_UI */ -typedef struct wmEventHandler_UI { +struct wmEventHandler_UI { wmEventHandler head; wmUIHandlerFunc handle_fn; /* callback receiving events */ @@ -86,14 +82,14 @@ typedef struct wmEventHandler_UI { /** Store context for this handler for derived/modal handlers. */ struct { - struct ScrArea *area; - struct ARegion *region; - struct ARegion *menu; + ScrArea *area; + ARegion *region; + ARegion *menu; } context; -} wmEventHandler_UI; +}; /** #WM_HANDLER_TYPE_OP */ -typedef struct wmEventHandler_Op { +struct wmEventHandler_Op { wmEventHandler head; /** Operator can be NULL. */ @@ -106,21 +102,21 @@ typedef struct wmEventHandler_Op { struct { /* To override the window, and hence the screen. Set for few cases only, usually window/screen * can be taken from current context. */ - struct wmWindow *win; + wmWindow *win; - struct ScrArea *area; - struct ARegion *region; + ScrArea *area; + ARegion *region; short region_type; } context; -} wmEventHandler_Op; +}; /** #WM_HANDLER_TYPE_DROPBOX */ -typedef struct wmEventHandler_Dropbox { +struct wmEventHandler_Dropbox { wmEventHandler head; /** Never NULL. */ ListBase *dropboxes; -} wmEventHandler_Dropbox; +}; /* `wm_event_system.cc` */ @@ -140,7 +136,7 @@ void wm_event_do_handlers(bContext *C); */ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void *customdata); #ifdef WITH_XR_OPENXR -void wm_event_add_xrevent(wmWindow *win, struct wmXrActionData *actiondata, short val); +void wm_event_add_xrevent(wmWindow *win, wmXrActionData *actiondata, short val); #endif void wm_event_do_depsgraph(bContext *C, bool is_after_open_file); @@ -166,11 +162,11 @@ void wm_event_handler_ui_cancel_ex(bContext *C, * Applies the global tablet pressure correction curve. */ float wm_pressure_curve(float raw_pressure); -void wm_tablet_data_from_ghost(const struct GHOST_TabletData *tablet_data, wmTabletData *wmtab); +void wm_tablet_data_from_ghost(const GHOST_TabletData *tablet_data, wmTabletData *wmtab); /* wm_dropbox.c */ -void wm_dropbox_free(void); +void wm_dropbox_free(); /** * Additional work to cleanly end dragging. Additional because this doesn't actually remove the * drag items. Should be called whenever dragging is stopped @@ -193,7 +189,3 @@ wmOperatorCallContext wm_drop_operator_context_get(const wmDropBox *drop); * Called in #wm_draw_window_onscreen. */ void wm_drags_draw(bContext *C, wmWindow *win); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/windowmanager/wm_files.hh b/source/blender/windowmanager/wm_files.hh index 3ecabe155a7..969751a7b92 100644 --- a/source/blender/windowmanager/wm_files.hh +++ b/source/blender/windowmanager/wm_files.hh @@ -8,14 +8,21 @@ #pragma once +#include "WM_types.hh" + +struct bContext; struct Main; +struct ReportList; struct wmFileReadPost_Params; struct wmGenericCallback; +struct wmOperator; struct wmOperatorType; +struct wmWindow; +struct wmWindowManager; /* wm_files.cc */ -void wm_history_file_read(void); +void wm_history_file_read(); struct wmHomeFileRead_Params { /** Load data, disable when only loading user preferences. */ @@ -56,24 +63,23 @@ struct wmHomeFileRead_Params { * in this return argument. * The caller is responsible for calling #wm_homefile_read_post with this return argument. */ -void wm_homefile_read_ex(struct bContext *C, - const struct wmHomeFileRead_Params *params_homefile, - struct ReportList *reports, - struct wmFileReadPost_Params **r_params_file_read_post); -void wm_homefile_read(struct bContext *C, - const struct wmHomeFileRead_Params *params_homefile, - struct ReportList *reports); +void wm_homefile_read_ex(bContext *C, + const wmHomeFileRead_Params *params_homefile, + ReportList *reports, + wmFileReadPost_Params **r_params_file_read_post); +void wm_homefile_read(bContext *C, + const wmHomeFileRead_Params *params_homefile, + ReportList *reports); /** * Special case, support deferred execution of #wm_file_read_post, * Needed when loading for the first time to workaround order of initialization bug, see #89046. */ -void wm_homefile_read_post(struct bContext *C, - const struct wmFileReadPost_Params *params_file_read_post); +void wm_homefile_read_post(bContext *C, const wmFileReadPost_Params *params_file_read_post); -void wm_file_read_report(struct Main *bmain, struct wmWindow *win); +void wm_file_read_report(Main *bmain, wmWindow *win); -void wm_close_file_dialog(bContext *C, struct wmGenericCallback *post_action); +void wm_close_file_dialog(bContext *C, wmGenericCallback *post_action); /** * \return True if the dialog was created, the calling operator should return #OPERATOR_INTERFACE * then. @@ -93,27 +99,27 @@ bool wm_file_or_session_data_has_unsaved_changes(const Main *bmain, const wmWind */ void wm_save_file_forwardcompat_dialog(bContext *C, wmOperator *op); -void WM_OT_save_homefile(struct wmOperatorType *ot); -void WM_OT_save_userpref(struct wmOperatorType *ot); -void WM_OT_read_userpref(struct wmOperatorType *ot); -void WM_OT_read_factory_userpref(struct wmOperatorType *ot); -void WM_OT_read_history(struct wmOperatorType *ot); -void WM_OT_read_homefile(struct wmOperatorType *ot); -void WM_OT_read_factory_settings(struct wmOperatorType *ot); +void WM_OT_save_homefile(wmOperatorType *ot); +void WM_OT_save_userpref(wmOperatorType *ot); +void WM_OT_read_userpref(wmOperatorType *ot); +void WM_OT_read_factory_userpref(wmOperatorType *ot); +void WM_OT_read_history(wmOperatorType *ot); +void WM_OT_read_homefile(wmOperatorType *ot); +void WM_OT_read_factory_settings(wmOperatorType *ot); -void WM_OT_open_mainfile(struct wmOperatorType *ot); +void WM_OT_open_mainfile(wmOperatorType *ot); -void WM_OT_revert_mainfile(struct wmOperatorType *ot); -void WM_OT_recover_last_session(struct wmOperatorType *ot); -void WM_OT_recover_auto_save(struct wmOperatorType *ot); +void WM_OT_revert_mainfile(wmOperatorType *ot); +void WM_OT_recover_last_session(wmOperatorType *ot); +void WM_OT_recover_auto_save(wmOperatorType *ot); -void WM_OT_save_as_mainfile(struct wmOperatorType *ot); -void WM_OT_save_mainfile(struct wmOperatorType *ot); +void WM_OT_save_as_mainfile(wmOperatorType *ot); +void WM_OT_save_mainfile(wmOperatorType *ot); /* `wm_files_link.cc` */ -void WM_OT_link(struct wmOperatorType *ot); -void WM_OT_append(struct wmOperatorType *ot); +void WM_OT_link(wmOperatorType *ot); +void WM_OT_append(wmOperatorType *ot); -void WM_OT_lib_relocate(struct wmOperatorType *ot); -void WM_OT_lib_reload(struct wmOperatorType *ot); +void WM_OT_lib_relocate(wmOperatorType *ot); +void WM_OT_lib_reload(wmOperatorType *ot); diff --git a/source/blender/windowmanager/wm_surface.hh b/source/blender/windowmanager/wm_surface.hh index 3178cce808b..412b290b5b0 100644 --- a/source/blender/windowmanager/wm_surface.hh +++ b/source/blender/windowmanager/wm_surface.hh @@ -13,40 +13,41 @@ #pragma once struct bContext; +struct GPUContext; -typedef struct wmSurface { - struct wmSurface *next, *prev; +struct wmSurface { + wmSurface *next, *prev; GHOST_ContextHandle system_gpu_context; - struct GPUContext *blender_gpu_context; + GPUContext *blender_gpu_context; void *customdata; - void (*draw)(struct bContext *); + void (*draw)(bContext *); /* To evaluate the surface's depsgraph. Called as part of the main loop. */ - void (*do_depsgraph)(struct bContext *C); + void (*do_depsgraph)(bContext *C); /** Free customdata, not the surface itself (done by wm_surface API) */ - void (*free_data)(struct wmSurface *); + void (*free_data)(wmSurface *); /** Called when surface is activated for drawing (made drawable). */ - void (*activate)(void); + void (*activate)(); /** Called when surface is deactivated for drawing (current drawable cleared). */ - void (*deactivate)(void); -} wmSurface; + void (*deactivate)(); +}; /* Create/Free */ void wm_surface_add(wmSurface *surface); void wm_surface_remove(wmSurface *surface); -void wm_surfaces_free(void); +void wm_surfaces_free(); /* Utils */ -void wm_surfaces_iter(struct bContext *C, void (*cb)(struct bContext *, wmSurface *)); +void wm_surfaces_iter(bContext *C, void (*cb)(bContext *, wmSurface *)); /* Evaluation. */ -void wm_surfaces_do_depsgraph(struct bContext *C); +void wm_surfaces_do_depsgraph(bContext *C); /* Drawing */ void wm_surface_make_drawable(wmSurface *surface); -void wm_surface_clear_drawable(void); +void wm_surface_clear_drawable(); void wm_surface_set_drawable(wmSurface *surface, bool activate); -void wm_surface_reset_drawable(void); +void wm_surface_reset_drawable(); diff --git a/source/blender/windowmanager/wm_window.h b/source/blender/windowmanager/wm_window.hh similarity index 83% rename from source/blender/windowmanager/wm_window.h rename to source/blender/windowmanager/wm_window.hh index dc4a9b89497..c3794693e8d 100644 --- a/source/blender/windowmanager/wm_window.h +++ b/source/blender/windowmanager/wm_window.hh @@ -8,11 +8,15 @@ #pragma once -struct wmOperator; +#include "BLI_compiler_attrs.h" -#ifdef __cplusplus -extern "C" { -#endif +struct bContext; +struct Main; +struct PointerRNA; +struct wmOperator; +struct wmOperatorType; +struct wmWindow; +struct wmWindowManager; /* *************** internal api ************** */ @@ -21,8 +25,8 @@ extern "C" { * need to event handling. */ void wm_ghost_init(bContext *C); -void wm_ghost_init_background(void); -void wm_ghost_exit(void); +void wm_ghost_init_background(); +void wm_ghost_exit(); /** * This one should correctly check for apple top header... @@ -37,15 +41,12 @@ void wm_get_desktopsize(int *r_width, int *r_height); /** * Don't change context itself. */ -wmWindow *wm_window_new(const struct Main *bmain, - wmWindowManager *wm, - wmWindow *parent, - bool dialog); +wmWindow *wm_window_new(const Main *bmain, wmWindowManager *wm, wmWindow *parent, bool dialog); /** * Part of `wm_window.cc` API. */ wmWindow *wm_window_copy( - struct Main *bmain, wmWindowManager *wm, wmWindow *win_src, bool duplicate_layout, bool child); + Main *bmain, wmWindowManager *wm, wmWindow *win_src, bool duplicate_layout, bool child); /** * A higher level version of copy that tests the new window can be added. * (called from the operator directly). @@ -88,7 +89,7 @@ void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win); /** * Reset active the current window gpu drawing context. */ -void wm_window_reset_drawable(void); +void wm_window_reset_drawable(); void wm_window_raise(wmWindow *win); void wm_window_lower(wmWindow *win); @@ -119,11 +120,11 @@ void wm_window_timers_delete_removed(wmWindowManager *wm); /* *************** window operators ************** */ -int wm_window_close_exec(bContext *C, struct wmOperator *op); +int wm_window_close_exec(bContext *C, wmOperator *op); /** * Full-screen operator callback. */ -int wm_window_fullscreen_toggle_exec(bContext *C, struct wmOperator *op); +int wm_window_fullscreen_toggle_exec(bContext *C, wmOperator *op); /** * Call the quit confirmation prompt or exit directly if needed. The use can * still cancel via the confirmation popup. Also, this may not quit Blender @@ -133,12 +134,8 @@ int wm_window_fullscreen_toggle_exec(bContext *C, struct wmOperator *op); */ void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win) ATTR_NONNULL(); -int wm_window_new_exec(bContext *C, struct wmOperator *op); -int wm_window_new_main_exec(bContext *C, struct wmOperator *op); +int wm_window_new_exec(bContext *C, wmOperator *op); +int wm_window_new_main_exec(bContext *C, wmOperator *op); -void wm_test_autorun_revert_action_set(struct wmOperatorType *ot, struct PointerRNA *ptr); +void wm_test_autorun_revert_action_set(wmOperatorType *ot, PointerRNA *ptr); void wm_test_autorun_warning(bContext *C); - -#ifdef __cplusplus -} -#endif diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.cc b/source/blender/windowmanager/xr/intern/wm_xr_session.cc index e39a45e7da4..e72fdf01719 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_session.cc +++ b/source/blender/windowmanager/xr/intern/wm_xr_session.cc @@ -43,7 +43,7 @@ #include "wm_event_system.h" #include "wm_surface.hh" -#include "wm_window.h" +#include "wm_window.hh" #include "wm_xr_intern.h" static wmSurface *g_xr_surface = nullptr;