Blender V5.0
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
20#ifdef __cplusplus
21namespace blender::bke {
23struct WindowRuntime;
24} // namespace blender::bke
27#else // __cplusplus
30#endif // __cplusplus
31
32#ifdef hyper /* MSVC defines. */
33# undef hyper
34#endif
35
36/* Defined here: */
37
38struct wmNotifier;
39struct wmWindow;
40struct wmWindowManager;
41
43struct wmEvent;
44struct wmKeyConfig;
45struct wmKeyMap;
46struct wmMsgBus;
47struct wmOperator;
48struct wmOperatorType;
49
50/* Forward declarations: */
51
52struct PointerRNA;
53struct Report;
54struct ReportList;
55struct Stereo3dFormat;
56struct bContext;
57struct bScreen;
58struct uiLayout;
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#
72
73// #ifdef WITH_XR_OPENXR
81// #endif
82
83/* reports need to be before wmWindowManager */
84
86typedef struct wmWindowManager {
87#ifdef __cplusplus
89 static constexpr ID_Type id_type = ID_WM;
90#endif
91
93
95
97 uint8_t init_flag;
98 char _pad0[1];
103
106
111
116 char _pad2[7];
117
118 // #ifdef WITH_XR_OPENXR
120 // #endif
121
124
125#define WM_KEYCONFIG_ARRAY_P(wm) \
126 &(wm)->runtime->defaultconf, &(wm)->runtime->addonconf, &(wm)->runtime->userconf
127
129enum {
132};
133
135enum {
138};
139
141enum {
146};
147
148#define WM_OUTLINER_SYNC_SELECT_FROM_ALL \
149 (WM_OUTLINER_SYNC_SELECT_FROM_OBJECT | WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE | \
150 WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE | WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE)
151
152#define WM_KEYCONFIG_STR_DEFAULT "Blender"
153
154/* IME is win32 and apple only! */
155#if !(defined(WIN32) || defined(__APPLE__)) && !defined(DNA_DEPRECATED)
156# ifdef __GNUC__
157# define ime_data ime_data __attribute__((deprecated))
158# endif
159#endif
160
164typedef struct wmWindow {
165 struct wmWindow *next, *prev;
166
168 void *ghostwin;
170 void *gpuctx;
171
174
176 struct Scene *scene;
180 char view_layer_name[/*MAX_NAME*/ 64];
184
186
190
191 struct bScreen *screen DNA_DEPRECATED;
192
194 int winid;
196 short posx, posy;
211 short sizex, sizey;
215 char active;
217 short cursor;
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
282
288 char _pad1[7];
289
294
297
300
303
306
311 void *_pad2;
313
315 void *_pad3;
317
318#ifdef ime_data
319# undef ime_data
320#endif
321
322/* These two lines with # tell `makesdna` this struct can be excluded. */
323/* should be something like DNA_EXCLUDE
324 * but the preprocessor first removes all comments, spaces etc */
325#
326#
327typedef struct wmOperatorTypeMacro {
329
330 /* operator id */
331 char idname[/*OP_MAX_TYPENAME*/ 64];
332 /* rna pointer to access properties, like keymap */
337
341typedef struct wmKeyMapItem {
343
344 /* operator */
346 char idname[64];
349
350 /* modal */
355
356 /* event */
358 short type;
360 int8_t val;
365 int8_t direction;
366
367 /* Modifier keys:
368 * Valid values:
369 * - #KM_ANY
370 * - #KM_NOTHING
371 * - #KM_MOD_HELD (not #KM_PRESS even though the values match).
372 */
373
374 int8_t shift;
375 int8_t ctrl;
376 int8_t alt;
378 int8_t oskey;
380 int8_t hyper;
381
382 char _pad0[7];
383
386
387 /* flag: inactive, expanded */
388 uint8_t flag;
389
390 /* runtime */
392 uint8_t maptype;
394 short id;
403
411
413enum {
414 KMI_INACTIVE = (1 << 0),
415 KMI_EXPANDED = (1 << 1),
417 KMI_UPDATE = (1 << 3),
432};
433
435enum {
438 /* 2 is deprecated, was tweak. */
442};
443
447typedef struct wmKeyMap {
448 struct wmKeyMap *next, *prev;
449
452
454 char idname[64];
456 short spaceid;
458 short regionid;
460 char owner_id[128];
461
463 short flag;
465 short kmi_id;
466
467 /* runtime */
469 bool (*poll)(struct bContext *);
470 bool (*poll_modal_item)(const struct wmOperator *op, int value);
471
473 const void *modal_items;
475
477enum {
479 KEYMAP_MODAL = (1 << 0),
481 KEYMAP_USER = (1 << 1),
482 KEYMAP_EXPANDED = (1 << 2),
485 KEYMAP_DIFF = (1 << 4),
488 KEYMAP_UPDATE = (1 << 6),
490 KEYMAP_TOOL = (1 << 7),
491};
492
506
507typedef struct wmKeyConfig {
509
511 char idname[64];
513 char basename[64];
514
517 short flag;
518 char _pad0[2];
520
522enum {
523 KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
524 KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
525};
526
531typedef struct wmOperator {
533
534 /* saved */
536 char idname[/*OP_MAX_TYPENAME*/ 64];
539
540 /* runtime */
547
552
559 short flag;
560 char _pad[6];
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_WM
These structs are the foundation for all linked lists in the library system.
@ WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE
@ WM_OUTLINER_SYNC_SELECT_FROM_OBJECT
@ WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE
@ WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE
struct WindowManagerRuntimeHandle WindowManagerRuntimeHandle
@ WM_INIT_FLAG_KEYCONFIG
@ WM_INIT_FLAG_WINDOW
@ KEYCONF_INIT_DEFAULT
struct WindowRuntimeHandle WindowRuntimeHandle
@ WM_EXTENSIONS_UPDATE_CHECKING
@ WM_EXTENSIONS_UPDATE_UNSET
@ KEYMAP_USER_MODIFIED
@ KEYMAP_CHILDREN_EXPANDED
unsigned long long int uint64_t
Definition DNA_ID.h:414
struct wmKeyConfigPref * next
struct wmKeyConfigPref * prev
struct wmKeyConfig * prev
struct wmKeyConfig * next
struct wmKeyMapDiffItem * next
struct wmKeyMapDiffItem * prev
struct PointerRNA * ptr
struct wmKeyMapItem * next
struct wmKeyMapItem * prev
struct wmKeyMap * prev
bool(* poll_modal_item)(const struct wmOperator *op, int value)
bool(* poll)(struct bContext *)
struct wmKeyMap * next
const void * modal_items
struct wmOperatorTypeMacro * prev
struct wmOperatorTypeMacro * next
struct IDProperty * properties
struct ReportList * reports
IDProperty * properties
struct uiLayout * layout
struct wmOperator * next
struct wmOperator * prev
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmOperator * opm
WindowManagerRuntimeHandle * runtime
struct wmTimer * autosavetimer
struct wmWindow * parent
WindowRuntimeHandle * runtime
uint64_t eventstate_prev_press_time_ms
struct wmEvent * eventstate
struct wmEvent * event_last_handled
struct Scene * scene
struct wmWindow * prev
struct bScreen *screen DNA_DEPRECATED
int event_queue_consecutive_gesture_xy[2]
struct Scene * unpinned_scene
char event_queue_check_drag_handled
short event_queue_consecutive_gesture_type
struct wmEvent_ConsecutiveData * event_queue_consecutive_gesture_data
struct wmWindow * next
ScrAreaMap global_areas
struct WorkSpaceInstanceHook * workspace_hook
struct Scene * new_scene
struct Stereo3dFormat * stereo3d_format
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime