Blender V5.3
DNA_windowmanager_types.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2007 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_windowmanager_enums.h" /* Own enums. */
12
13#include "DNA_listBase.h"
14#include "DNA_screen_types.h" /* for #ScrAreaMap */
15#include "DNA_xr_types.h" /* for #XrSessionSettings */
16
17#include "DNA_ID.h"
18
19#include "BLI_enum_flags.hh"
20
21namespace blender {
22
24namespace bke {
26struct WindowRuntime;
27} // namespace bke
28
29namespace ui {
30struct Layout;
31} // namespace ui
32
33#ifdef hyper /* MSVC defines. */
34# undef hyper
35#endif
36
37/* Defined here: */
38
39struct wmNotifier;
40struct wmWindow;
41struct wmWindowManager;
42
44struct wmEvent;
45struct wmKeyConfig;
46struct wmKeyMap;
47struct wmMsgBus;
48struct wmOperator;
49struct wmOperatorType;
50
51/* Forward declarations: */
52
53struct PointerRNA;
54struct Report;
55struct ReportList;
56struct Stereo3dFormat;
57struct bContext;
58struct bScreen;
59struct wmTimer;
60
61#define OP_MAX_TYPENAME 64
62#define KMAP_MAX_NAME 64
63
64/* Timer custom-data to control reports display. */
65/* These two lines with # tell `makesdna` this struct can be excluded. */
66#
67#
69 float widthfac = 0;
70 float flash_progress = 0;
71};
72
73/* reports need to be before wmWindowManager */
74
75// #ifdef WITH_XR_OPENXR
83// #endif
84
90
97
98
107
108#define WM_OUTLINER_SYNC_SELECT_FROM_ALL \
109 (WM_OUTLINER_SYNC_SELECT_FROM_OBJECT | WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE | \
110 WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE | WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE)
111
114#ifdef __cplusplus
116 static constexpr ID_Type id_type = ID_WM;
117#endif
118
120
121 ListBaseT<wmWindow> windows = {nullptr, nullptr};
122
125 char _pad0[1] = {};
127 short file_saved = 0;
129 short op_undo_depth = 0;
130
133
138
140 struct wmTimer *autosavetimer = nullptr;
143 char _pad2[7] = {};
144
145 // #ifdef WITH_XR_OPENXR
147 // #endif
148
150};
151
152#define WM_KEYCONFIG_ARRAY_P(wm) \
153 &(wm)->runtime->defaultconf, &(wm)->runtime->addonconf, &(wm)->runtime->userconf
154
155#define WM_KEYCONFIG_STR_DEFAULT "Blender"
156
157/* IME is win32 and apple only! */
158#if !(defined(WIN32) || defined(__APPLE__)) && !defined(DNA_DEPRECATED)
159# ifdef __GNUC__
160# define ime_data ime_data __attribute__((deprecated))
161# endif
162#endif
163
167struct wmWindow {
169
170 struct wmWindow *next = nullptr, *prev = nullptr;
171
173 struct wmWindow *parent = nullptr;
174
176 struct Scene *scene = nullptr;
178 struct Scene *new_scene = nullptr;
180 char view_layer_name[/*MAX_NAME*/ 64] = "";
183 struct Scene *unpinned_scene = nullptr;
184
186
190
191 DNA_DEPRECATED struct bScreen *screen = nullptr;
192
194 int winid = 0;
196 short posx = 0, posy = 0;
211 short sizex = 0, sizey = 0;
213 char windowstate = 0;
215 char active = 0;
217 short cursor = 0;
219 short lastcursor = 0;
221 short modalcursor = 0;
223 short grabcursor = 0;
224
232
234
235 /* Track the state of the event queue,
236 * these store the state that needs to be kept between handling events in the queue. */
247
257
262 char addmousemove = 0;
263 char _pad1[7] = {};
264
267
269};
270
271#ifdef ime_data
272# undef ime_data
273#endif
274
275/* These two lines with # tell `makesdna` this struct can be excluded. */
276/* should be something like DNA_EXCLUDE
277 * but the preprocessor first removes all comments, spaces etc */
278#
279#
281 struct wmOperatorTypeMacro *next = nullptr, *prev = nullptr;
282
283 /* operator id */
284 char idname[/*OP_MAX_TYPENAME*/ 64] = "";
285 /* rna pointer to access properties, like keymap */
287 struct IDProperty *properties = nullptr;
288 struct PointerRNA *ptr = nullptr;
289};
290
293 KMI_INACTIVE = (1 << 0),
294 KMI_EXPANDED = (1 << 1),
296 KMI_UPDATE = (1 << 3),
311};
313
314
318 /* 2 is deprecated, was tweak. */
322};
323
325enum eKeyMap_Flag : short {
327 KEYMAP_MODAL = (1 << 0),
329 KEYMAP_USER = (1 << 1),
330 KEYMAP_EXPANDED = (1 << 2),
333 KEYMAP_DIFF = (1 << 4),
336 KEYMAP_UPDATE = (1 << 6),
338 KEYMAP_TOOL = (1 << 7),
339};
341
342
346 struct wmKeyMapItem *next = nullptr, *prev = nullptr;
347
348 /* operator */
350 char idname[64] = "";
353
354 /* modal */
356 char propvalue_str[64] = "";
358 short propvalue = 0;
359
360 /* event */
362 short type = 0;
370
371 /* Modifier keys:
372 * Valid values:
373 * - #KM_ANY
374 * - #KM_NOTHING
375 * - #KM_MOD_HELD (not #KM_PRESS even though the values match).
376 */
377
385
386 char _pad0[7] = {};
387
389 short keymodifier = 0;
390
391 /* flag: inactive, expanded */
393
394 /* runtime */
398 short id = 0;
405 struct PointerRNA *ptr = nullptr;
406};
407
410 struct wmKeyMapDiffItem *next = nullptr, *prev = nullptr;
411
414};
415
419struct wmKeyMap {
420 struct wmKeyMap *next = nullptr, *prev = nullptr;
421
422 ListBaseT<wmKeyMapItem> items = {nullptr, nullptr};
423 ListBaseT<wmKeyMapDiffItem> diff_items = {nullptr, nullptr};
424
426 char idname[64] = "";
428 short spaceid = 0;
430 short regionid = 0;
432 char owner_id[128] = "";
433
437 short kmi_id = 0;
438
439 /* runtime */
441 bool (*poll)(struct bContext *);
442 bool (*poll_modal_item)(const struct wmOperator *op, int value) = {};
443
445 const void *modal_items = nullptr;
446};
447
456 struct wmKeyConfigPref *next = nullptr, *prev = nullptr;
458 char idname[64] = "";
459 IDProperty *prop = nullptr;
460};
461
463enum eKeyConf_Flag : short {
464 KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
465 KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
466};
468
470 struct wmKeyConfig *next = nullptr, *prev = nullptr;
471
473 char idname[64] = "";
475 char basename[64] = "";
476
477 ListBaseT<wmKeyMap> keymaps = {nullptr, nullptr};
478 int actkeymap = 0;
480 char _pad0[2] = {};
481};
482
488 struct wmOperator *next = nullptr, *prev = nullptr;
489
490 /* saved */
492 char idname[/*OP_MAX_TYPENAME*/ 64] = "";
495
496 /* runtime */
498 struct wmOperatorType *type = nullptr;
500 void *customdata = nullptr;
502 void *py_instance = nullptr;
503
505 struct PointerRNA *ptr = nullptr;
507 struct ReportList *reports = nullptr;
508
510 ListBaseT<wmOperator> macro = {nullptr, nullptr};
512 struct wmOperator *opm = nullptr;
514 ui::Layout *layout = nullptr;
516 char _pad[6] = {};
517};
518
519} // namespace blender
#define ENUM_OPERATORS(_enum_type)
ID and Library types, which are fundamental for SDNA.
#define DNA_DEFINE_CXX_METHODS(class_name)
Definition DNA_defs.h:104
#define DNA_DEPRECATED
Definition DNA_defs.h:21
These structs are the foundation for all linked lists in the library system.
BMesh Iterators.
@ WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE
@ WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE
@ WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE
@ WM_OUTLINER_SYNC_SELECT_FROM_COLLECTION
unsigned char uint8_t
Definition BKE_text.h:79
signed char int8_t
Definition BKE_text.h:76
struct wmKeyConfigPref * prev
struct wmKeyConfigPref * next
ListBaseT< wmKeyMap > keymaps
struct wmKeyMapDiffItem * next
struct wmKeyMapDiffItem * prev
ListBaseT< wmKeyMapDiffItem > diff_items
bool(*) poll_modal_item(const struct wmOperator *op, int value)
bool(*) poll(struct bContext *)
ListBaseT< wmKeyMapItem > items
struct wmOperatorTypeMacro * prev
struct wmOperatorTypeMacro * next
ListBaseT< wmOperator > macro
struct ReportList * reports
struct wmOperatorType * type
eWM_ExtensionsUpdates extensions_updates
bke::WindowManagerRuntime * runtime
eWM_OutlinerSyncSelectDirty outliner_sync_select_dirty
bke::WindowRuntime * runtime
struct wmEvent_ConsecutiveData * event_queue_consecutive_gesture_data
DNA_DEPRECATED struct bScreen * screen
struct WorkSpaceInstanceHook * workspace_hook
struct Stereo3dFormat * stereo3d_format
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime