Blender V4.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
9#pragma once
10
11#include "DNA_listBase.h"
12#include "DNA_screen_types.h" /* for #ScrAreaMap */
13#include "DNA_xr_types.h" /* for #XrSessionSettings */
14
15#include "DNA_ID.h"
16
17#ifdef __cplusplus
18# include <mutex>
19using std_mutex_type = std::mutex;
20#else
21# define std_mutex_type void
22#endif
23
25#ifdef __cplusplus
26namespace blender::bke {
27class WindowManagerRuntime;
28}
30#else // __cplusplus
32#endif // __cplusplus
33
34/* Defined here: */
35
36struct wmNotifier;
37struct wmWindow;
38struct wmWindowManager;
39
41struct wmEvent;
42struct wmKeyConfig;
43struct wmKeyMap;
44struct wmMsgBus;
45struct wmOperator;
46struct wmOperatorType;
47
48/* Forward declarations: */
49
50struct PointerRNA;
51struct Report;
52struct ReportList;
53struct Stereo3dFormat;
54struct bContext;
55struct bScreen;
56struct uiLayout;
57struct wmTimer;
58
59#define OP_MAX_TYPENAME 64
60#define KMAP_MAX_NAME 64
61
63typedef enum eReportType {
64 RPT_DEBUG = (1 << 0),
65 RPT_INFO = (1 << 1),
66 RPT_OPERATOR = (1 << 2),
67 RPT_PROPERTY = (1 << 3),
68 RPT_WARNING = (1 << 4),
69 RPT_ERROR = (1 << 5),
75
76#define RPT_DEBUG_ALL (RPT_DEBUG)
77#define RPT_INFO_ALL (RPT_INFO)
78#define RPT_OPERATOR_ALL (RPT_OPERATOR)
79#define RPT_PROPERTY_ALL (RPT_PROPERTY)
80#define RPT_WARNING_ALL (RPT_WARNING)
81#define RPT_ERROR_ALL \
82 (RPT_ERROR | RPT_ERROR_INVALID_INPUT | RPT_ERROR_INVALID_CONTEXT | RPT_ERROR_OUT_OF_MEMORY)
83
85 RPT_PRINT = (1 << 0),
86 RPT_STORE = (1 << 1),
87 RPT_FREE = (1 << 2),
88 RPT_OP_HOLD = (1 << 3), /* don't move them into the operator global list (caller will use) */
91};
92
93/* These two lines with # tell `makesdna` this struct can be excluded. */
94#
95#
96typedef struct Report {
97 struct Report *next, *prev;
99 short type;
100 short flag;
102 int len;
103 const char *typestr;
104 const char *message;
106
123
124/* Timer custom-data to control reports display. */
125/* These two lines with # tell `makesdna` this struct can be excluded. */
126#
127#
132
133// #ifdef WITH_XR_OPENXR
141// #endif
142
143/* reports need to be before wmWindowManager */
144
236
237#define WM_KEYCONFIG_ARRAY_P(wm) &(wm)->defaultconf, &(wm)->addonconf, &(wm)->userconf
238
240enum {
243};
244
246enum {
249};
250
252enum {
257};
258
259#define WM_OUTLINER_SYNC_SELECT_FROM_ALL \
260 (WM_OUTLINER_SYNC_SELECT_FROM_OBJECT | WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE | \
261 WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE | WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE)
262
263#define WM_KEYCONFIG_STR_DEFAULT "Blender"
264
265/* IME is win32 and apple only! */
266#if !(defined(WIN32) || defined(__APPLE__)) && !defined(DNA_DEPRECATED)
267# ifdef __GNUC__
268# define ime_data ime_data __attribute__((deprecated))
269# endif
270#endif
271
275typedef struct wmWindow {
276 struct wmWindow *next, *prev;
277
279 void *ghostwin;
281 void *gpuctx;
282
285
287 struct Scene *scene;
295
297
301
302 struct bScreen *screen DNA_DEPRECATED;
303
305 int winid;
307 short posx, posy;
318 short sizex, sizey;
322 char active;
324 short cursor;
341
344
345 /* Track the state of the event queue,
346 * these store the state that needs to be kept between handling events in the queue. */
357
364
389
394 const struct wmIMEData *ime_data;
396 char _pad1[7];
397
404
407
410
413
416
422
424
425#ifdef ime_data
426# undef ime_data
427#endif
428
429/* These two lines with # tell `makesdna` this struct can be excluded. */
430/* should be something like DNA_EXCLUDE
431 * but the preprocessor first removes all comments, spaces etc */
432#
433#
434typedef struct wmOperatorTypeMacro {
436
437 /* operator id */
438 char idname[64]; /* OP_MAX_TYPENAME */
439 /* rna pointer to access properties, like keymap */
444
448typedef struct wmKeyMapItem {
450
451 /* operator */
453 char idname[64];
456
457 /* modal */
462
463 /* event */
465 short type;
474 short shift, ctrl, alt, oskey;
477
478 /* flag: inactive, expanded */
479 short flag;
480
481 /* runtime */
483 short maptype;
485 short id;
486 char _pad[2];
495
503
505enum {
506 KMI_INACTIVE = (1 << 0),
507 KMI_EXPANDED = (1 << 1),
509 KMI_UPDATE = (1 << 3),
524};
525
527enum {
530 /* 2 is deprecated, was tweak. */
534};
535
539typedef struct wmKeyMap {
540 struct wmKeyMap *next, *prev;
541
544
546 char idname[64];
548 short spaceid;
550 short regionid;
552 char owner_id[128];
553
555 short flag;
557 short kmi_id;
558
559 /* runtime */
561 bool (*poll)(struct bContext *);
562 bool (*poll_modal_item)(const struct wmOperator *op, int value);
563
565 const void *modal_items;
567
569enum {
571 KEYMAP_MODAL = (1 << 0),
573 KEYMAP_USER = (1 << 1),
574 KEYMAP_EXPANDED = (1 << 2),
577 KEYMAP_DIFF = (1 << 4),
580 KEYMAP_UPDATE = (1 << 6),
582 KEYMAP_TOOL = (1 << 7),
583};
584
598
599typedef struct wmKeyConfig {
601
603 char idname[64];
605 char basename[64];
606
609 short flag;
610 char _pad0[2];
612
614enum {
615 KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
616 KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
617};
618
623typedef struct wmOperator {
625
626 /* saved */
628 char idname[64]; /* OP_MAX_TYPENAME */
631
632 /* runtime */
639
644
651 short flag;
652 char _pad[6];
654
658enum {
671};
672#define OPERATOR_FLAGS_ALL \
673 (OPERATOR_RUNNING_MODAL | OPERATOR_CANCELLED | OPERATOR_FINISHED | OPERATOR_PASS_THROUGH | \
674 OPERATOR_HANDLED | OPERATOR_INTERFACE | 0)
675
676/* sanity checks for debug mode only */
677#define OPERATOR_RETVAL_CHECK(ret) \
678 (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret)
679
681enum {
686 OP_IS_INVOKE = (1 << 0),
688 OP_IS_REPEAT = (1 << 1),
698
701
707};
struct GSet GSet
Definition BLI_ghash.h:341
#define ENUM_OPERATORS(_type, _max)
ID and Library types, which are fundamental for SDNA.
These structs are the foundation for all linked lists in the library system.
struct wmKeyConfig wmKeyConfig
#define std_mutex_type
struct wmOperatorTypeMacro wmOperatorTypeMacro
struct wmKeyMapDiffItem wmKeyMapDiffItem
struct WindowManagerRuntimeHandle WindowManagerRuntimeHandle
struct wmXrData wmXrData
@ RPT_PRINT_HANDLED_BY_OWNER
struct wmOperator wmOperator
@ KEYMAP_USER_MODIFIED
@ KEYMAP_CHILDREN_EXPANDED
@ WM_INIT_FLAG_KEYCONFIG
@ WM_INIT_FLAG_WINDOW
struct Report Report
@ OP_IS_MODAL_CURSOR_REGION
@ OP_IS_MODAL_GRAB_CURSOR
@ 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
@ KEYCONF_INIT_DEFAULT
struct wmWindowManager wmWindowManager
struct wmKeyMap wmKeyMap
struct ReportTimerInfo ReportTimerInfo
struct wmKeyMapItem wmKeyMapItem
struct wmKeyConfigPref wmKeyConfigPref
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_PASS_THROUGH
struct wmWindow wmWindow
@ RPT_ERROR_OUT_OF_MEMORY
@ RPT_ERROR_INVALID_INPUT
@ RPT_ERROR_INVALID_CONTEXT
@ WM_EXTENSIONS_UPDATE_CHECKING
@ WM_EXTENSIONS_UPDATE_UNSET
struct ReportList ReportList
unsigned char uint8_t
Definition stdint.h:78
unsigned __int64 uint64_t
Definition stdint.h:90
signed char int8_t
Definition stdint.h:75
Definition DNA_ID.h:413
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 GSet * notifier_queue_set
struct wmKeyConfig * addonconf
const struct wmNotifier * notifier_current
struct wmWindow * parent
uint64_t eventstate_prev_press_time_ms
struct wmEvent * eventstate
struct wmEvent * event_last_handled
struct Scene * scene
char event_queue_consecutive_gesture_type
struct wmWindow * prev
struct bScreen *screen DNA_DEPRECATED
int event_queue_consecutive_gesture_xy[2]
const struct wmIMEData * ime_data
struct Scene * unpinned_scene
char event_queue_check_drag_handled
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