Cleanup: Various cleanups in newly C++ headers

Mostly remove unnecessary struct and typedef keywords.
Move a few more small wm headers to C++ as well.
This commit is contained in:
Hans Goudey
2023-08-04 17:55:14 -04:00
parent bc8c892c65
commit c15d391e86
63 changed files with 1110 additions and 1309 deletions
@@ -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).
*
+3 -3
View File
@@ -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();
@@ -38,7 +38,7 @@
#include "RNA_define.h"
#include "WM_api.hh"
#include "wm.h"
#include "wm.hh"
#include "GHOST_Path-api.hh"
@@ -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)
@@ -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"
@@ -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();
+1 -1
View File
@@ -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"
@@ -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"
@@ -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
@@ -30,7 +30,7 @@
#include "WM_api.hh"
#include "WM_types.hh"
#include "wm_window.h"
#include "wm_window.hh"
#include "draw_manager.h"
@@ -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"
+6 -6
View File
@@ -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 */
+1 -1
View File
@@ -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 */
@@ -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
/* -------------------------------------------------------------------- */
@@ -18,7 +18,7 @@
#include "BKE_screen.h"
#include "WM_api.hh"
#include "wm_draw.h"
#include "wm_draw.hh"
#include "ED_screen.hh"
+1 -1
View File
@@ -31,7 +31,7 @@
#include "ED_screen.hh"
#include "UI_interface.h"
#include "wm_window.h"
#include "wm_window.hh"
#include "render_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);
@@ -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
@@ -130,5 +130,5 @@ enum eActKeys_Mirror_Mode {
/* ***************************************** */
/* `action_ops.cc` */
void action_operatortypes(void);
void action_operatortypes();
void action_keymap(wmKeyConfig *keyconf);
@@ -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);
/**
@@ -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*/]);
@@ -149,5 +149,5 @@ bool nlaedit_is_tweakmode_on(bAnimContext *ac);
/* --- */
void nla_operatortypes(void);
void nla_operatortypes();
void nla_keymap(wmKeyConfig *keyconf);
@@ -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` */
@@ -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);
@@ -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);
+1 -1
View File
@@ -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"
+3 -3
View File
@@ -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
File diff suppressed because it is too large Load Diff
+52 -62
View File
@@ -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);
+58 -73
View File
@@ -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);
+123 -139
View File
@@ -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;
@@ -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"
@@ -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"
@@ -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"
@@ -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"
@@ -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
+3 -3
View File
@@ -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
@@ -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 {
@@ -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"
/* ****************************************************** */
@@ -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"
@@ -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");
@@ -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"
@@ -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"
@@ -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"
@@ -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"
@@ -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"
@@ -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)")
@@ -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
@@ -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*/)
{
@@ -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"
@@ -24,7 +24,7 @@
#include "WM_api.hh"
#include "WM_types.hh"
#include "wm.h"
#include "wm.hh"
#include "wm_surface.hh"
@@ -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"
@@ -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)
{
@@ -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_) \
{ \
@@ -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
+1 -1
View File
@@ -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);
-42
View File
@@ -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
+33
View File
@@ -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);
+29 -37
View File
@@ -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
+35 -29
View File
@@ -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);
+15 -14
View File
@@ -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();
@@ -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
@@ -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;