Blender V4.5
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#ifdef __cplusplus
20# include <mutex>
21using std_mutex_type = std::mutex;
22#else
23# define std_mutex_type void
24#endif
25
27#ifdef __cplusplus
28namespace blender::bke {
29struct WindowManagerRuntime;
30struct WindowRuntime;
31} // namespace blender::bke
34#else // __cplusplus
37#endif // __cplusplus
38
39#ifdef hyper /* MSVC defines. */
40# undef hyper
41#endif
42
43/* Defined here: */
44
45struct wmNotifier;
46struct wmWindow;
47struct wmWindowManager;
48
50struct wmEvent;
51struct wmKeyConfig;
52struct wmKeyMap;
53struct wmMsgBus;
54struct wmOperator;
55struct wmOperatorType;
56
57/* Forward declarations: */
58
59struct PointerRNA;
60struct Report;
61struct ReportList;
62struct Stereo3dFormat;
63struct bContext;
64struct bScreen;
65struct uiLayout;
66struct wmTimer;
67
68#define OP_MAX_TYPENAME 64
69#define KMAP_MAX_NAME 64
70
72typedef enum eReportType {
73 RPT_DEBUG = (1 << 0),
74 RPT_INFO = (1 << 1),
75 RPT_OPERATOR = (1 << 2),
76 RPT_PROPERTY = (1 << 3),
77 RPT_WARNING = (1 << 4),
78 RPT_ERROR = (1 << 5),
84
85#define RPT_DEBUG_ALL (RPT_DEBUG)
86#define RPT_INFO_ALL (RPT_INFO)
87#define RPT_OPERATOR_ALL (RPT_OPERATOR)
88#define RPT_PROPERTY_ALL (RPT_PROPERTY)
89#define RPT_WARNING_ALL (RPT_WARNING)
90#define RPT_ERROR_ALL \
91 (RPT_ERROR | RPT_ERROR_INVALID_INPUT | RPT_ERROR_INVALID_CONTEXT | RPT_ERROR_OUT_OF_MEMORY)
92
94 RPT_PRINT = (1 << 0),
95 RPT_STORE = (1 << 1),
96 RPT_FREE = (1 << 2),
97 RPT_OP_HOLD = (1 << 3), /* don't move them into the operator global list (caller will use) */
100};
101
102/* These two lines with # tell `makesdna` this struct can be excluded. */
103#
104#
105typedef struct Report {
106 struct Report *next, *prev;
108 short type;
109 short flag;
111 int len;
112 const char *typestr;
113 const char *message;
115
132
133/* Timer custom-data to control reports display. */
134/* These two lines with # tell `makesdna` this struct can be excluded. */
135#
136#
141
142// #ifdef WITH_XR_OPENXR
150// #endif
151
152/* reports need to be before wmWindowManager */
153
234
235#define WM_KEYCONFIG_ARRAY_P(wm) &(wm)->defaultconf, &(wm)->addonconf, &(wm)->userconf
236
238enum {
241};
242
244enum {
247};
248
250enum {
255};
256
257#define WM_OUTLINER_SYNC_SELECT_FROM_ALL \
258 (WM_OUTLINER_SYNC_SELECT_FROM_OBJECT | WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE | \
259 WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE | WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE)
260
261#define WM_KEYCONFIG_STR_DEFAULT "Blender"
262
263/* IME is win32 and apple only! */
264#if !(defined(WIN32) || defined(__APPLE__)) && !defined(DNA_DEPRECATED)
265# ifdef __GNUC__
266# define ime_data ime_data __attribute__((deprecated))
267# endif
268#endif
269
273typedef struct wmWindow {
274 struct wmWindow *next, *prev;
275
277 void *ghostwin;
279 void *gpuctx;
280
283
285 struct Scene *scene;
289 char view_layer_name[/*MAX_NAME*/ 64];
293
295
299
300 struct bScreen *screen DNA_DEPRECATED;
301
303 int winid;
305 short posx, posy;
316 short sizex, sizey;
320 char active;
322 short cursor;
329
337
339
340 /* Track the state of the event queue,
341 * these store the state that needs to be kept between handling events in the queue. */
352
362
387
393 char _pad1[7];
394
399
402
405
408
411
416 void *_pad2;
418
420 void *_pad3;
422
423#ifdef ime_data
424# undef ime_data
425#endif
426
427/* These two lines with # tell `makesdna` this struct can be excluded. */
428/* should be something like DNA_EXCLUDE
429 * but the preprocessor first removes all comments, spaces etc */
430#
431#
432typedef struct wmOperatorTypeMacro {
434
435 /* operator id */
436 char idname[/*OP_MAX_TYPENAME*/ 64];
437 /* rna pointer to access properties, like keymap */
442
446typedef struct wmKeyMapItem {
448
449 /* operator */
451 char idname[64];
454
455 /* modal */
460
461 /* event */
463 short type;
465 int8_t val;
470 int8_t direction;
471
472 /* Modifier keys:
473 * Valid values:
474 * - #KM_ANY
475 * - #KM_NOTHING
476 * - #KM_MOD_HELD (not #KM_PRESS even though the values match).
477 */
478
479 int8_t shift;
480 int8_t ctrl;
481 int8_t alt;
483 int8_t oskey;
485 int8_t hyper;
486
487 char _pad0[7];
488
491
492 /* flag: inactive, expanded */
493 uint8_t flag;
494
495 /* runtime */
497 uint8_t maptype;
499 short id;
508
516
518enum {
519 KMI_INACTIVE = (1 << 0),
520 KMI_EXPANDED = (1 << 1),
522 KMI_UPDATE = (1 << 3),
537};
538
540enum {
543 /* 2 is deprecated, was tweak. */
547};
548
552typedef struct wmKeyMap {
553 struct wmKeyMap *next, *prev;
554
557
559 char idname[64];
561 short spaceid;
563 short regionid;
565 char owner_id[128];
566
568 short flag;
570 short kmi_id;
571
572 /* runtime */
574 bool (*poll)(struct bContext *);
575 bool (*poll_modal_item)(const struct wmOperator *op, int value);
576
578 const void *modal_items;
580
582enum {
584 KEYMAP_MODAL = (1 << 0),
586 KEYMAP_USER = (1 << 1),
587 KEYMAP_EXPANDED = (1 << 2),
590 KEYMAP_DIFF = (1 << 4),
593 KEYMAP_UPDATE = (1 << 6),
595 KEYMAP_TOOL = (1 << 7),
596};
597
611
612typedef struct wmKeyConfig {
614
616 char idname[64];
618 char basename[64];
619
622 short flag;
623 char _pad0[2];
625
627enum {
628 KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
629 KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
630};
631
636typedef struct wmOperator {
638
639 /* saved */
641 char idname[/*OP_MAX_TYPENAME*/ 64];
644
645 /* runtime */
652
657
664 short flag;
665 char _pad[6];
#define ENUM_OPERATORS(_type, _max)
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.
#define std_mutex_type
struct WindowManagerRuntimeHandle WindowManagerRuntimeHandle
@ RPT_PRINT_HANDLED_BY_OWNER
@ WM_INIT_FLAG_KEYCONFIG
@ WM_INIT_FLAG_WINDOW
@ KEYCONF_INIT_DEFAULT
@ 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 WindowRuntimeHandle WindowRuntimeHandle
@ KEYMAP_USER_MODIFIED
@ KEYMAP_CHILDREN_EXPANDED
@ WM_EXTENSIONS_UPDATE_CHECKING
@ WM_EXTENSIONS_UPDATE_UNSET
@ RPT_ERROR_OUT_OF_MEMORY
@ RPT_ERROR_INVALID_INPUT
@ RPT_ERROR_INVALID_CONTEXT
unsigned long long int uint64_t
Definition DNA_ID.h:404
std_mutex_type * lock
struct wmTimer * reporttimer
struct Report * next
struct Report * prev
const char * typestr
const char * message
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
struct wmMsgBus * message_bus
struct wmKeyConfig * defaultconf
WindowManagerRuntimeHandle * runtime
struct UndoStack * undo_stack
struct wmWindow * winactive
struct wmKeyConfig * userconf
struct wmTimer * autosavetimer
struct wmWindow * windrawable
struct wmKeyConfig * addonconf
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