Blender  V2.93
DNA_windowmanager_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2007 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_listBase.h"
27 #include "DNA_screen_types.h" /* for #ScrAreaMap */
28 #include "DNA_xr_types.h" /* for #XrSessionSettings */
29 
30 #include "DNA_ID.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /* defined here: */
37 struct wmWindow;
38 struct wmWindowManager;
39 
40 struct wmEvent;
41 struct wmGesture;
42 struct wmKeyConfig;
43 struct wmKeyMap;
44 struct wmMsgBus;
45 struct wmOperator;
46 struct wmOperatorType;
47 
48 /* forwards */
49 struct PointerRNA;
50 struct Report;
51 struct ReportList;
52 struct Stereo3dFormat;
53 struct bContext;
54 struct bScreen;
55 struct uiLayout;
56 struct wmTimer;
57 
58 #define OP_MAX_TYPENAME 64
59 #define KMAP_MAX_NAME 64
60 
61 /* keep in sync with 'rna_enum_wm_report_items' in wm_rna.c */
62 typedef enum ReportType {
63  RPT_DEBUG = (1 << 0),
64  RPT_INFO = (1 << 1),
65  RPT_OPERATOR = (1 << 2),
66  RPT_PROPERTY = (1 << 3),
67  RPT_WARNING = (1 << 4),
68  RPT_ERROR = (1 << 5),
73 
74 #define RPT_DEBUG_ALL (RPT_DEBUG)
75 #define RPT_INFO_ALL (RPT_INFO)
76 #define RPT_OPERATOR_ALL (RPT_OPERATOR)
77 #define RPT_PROPERTY_ALL (RPT_PROPERTY)
78 #define RPT_WARNING_ALL (RPT_WARNING)
79 #define RPT_ERROR_ALL \
80  (RPT_ERROR | RPT_ERROR_INVALID_INPUT | RPT_ERROR_INVALID_CONTEXT | RPT_ERROR_OUT_OF_MEMORY)
81 
83  RPT_PRINT = (1 << 0),
84  RPT_STORE = (1 << 1),
85  RPT_FREE = (1 << 2),
86  RPT_OP_HOLD = (1 << 3), /* don't move them into the operator global list (caller will use) */
87 };
88 
89 /* These two Lines with # tell makesdna this struct can be excluded. */
90 #
91 #
92 typedef struct Report {
93  struct Report *next, *prev;
95  short type;
96  short flag;
98  int len;
99  const char *typestr;
100  const char *message;
102 
103 /* saved in the wm, don't remove */
104 typedef struct ReportList {
110  int flag;
111  char _pad[4];
114 
115 /* timer customdata to control reports display */
116 /* These two Lines with # tell makesdna this struct can be excluded. */
117 #
118 #
119 typedef struct ReportTimerInfo {
120  float col[4];
121  float widthfac;
123 
124 //#ifdef WITH_XR_OPENXR
125 typedef struct wmXrData {
132 //#endif
133 
134 /* reports need to be before wmWindowManager */
135 
136 /* windowmanager is saved, tag WMAN */
137 typedef struct wmWindowManager {
139 
143 
145  short initialized;
147  short file_saved;
150 
153 
156 
159 
161  struct ReportList reports;
162 
165 
168 
171 
180 
185 
188 
191  char _pad[7];
192 
194 
195  //#ifdef WITH_XR_OPENXR
197  //#endif
199 
200 /* wmWindowManager.initialized */
201 enum {
202  WM_WINDOW_IS_INIT = (1 << 0),
204 };
205 
206 /* wmWindowManager.outliner_sync_select_dirty */
207 enum {
212 };
213 
214 #define WM_OUTLINER_SYNC_SELECT_FROM_ALL \
215  (WM_OUTLINER_SYNC_SELECT_FROM_OBJECT | WM_OUTLINER_SYNC_SELECT_FROM_EDIT_BONE | \
216  WM_OUTLINER_SYNC_SELECT_FROM_POSE_BONE | WM_OUTLINER_SYNC_SELECT_FROM_SEQUENCE)
217 
218 #define WM_KEYCONFIG_STR_DEFAULT "Blender"
219 
220 /* IME is win32 only! */
221 #if !defined(WIN32) && !defined(DNA_DEPRECATED)
222 # ifdef __GNUC__
223 # define ime_data ime_data __attribute__((deprecated))
224 # endif
225 #endif
226 
227 /* the saveable part, rest of data is local in ghostwinlay */
228 typedef struct wmWindow {
229  struct wmWindow *next, *prev;
230 
232  void *ghostwin;
234  void *gpuctx;
235 
237  struct wmWindow *parent;
238 
240  struct Scene *scene;
242  struct Scene *new_scene;
244  char view_layer_name[64];
245 
247 
251 
252  struct bScreen *screen DNA_DEPRECATED;
253 
255  int winid;
257  short posx, posy, sizex, sizey;
261  char active;
263  short cursor;
265  short lastcursor;
267  short modalcursor;
269  short grabcursor;
274 
275  /* Track the state of the event queue,
276  * these store the state that needs to be kept between handling events in the queue. */
287 
288  char _pad0[1];
289 
297 
300 
302  struct wmGesture *tweak;
303 
304  /* Input Method Editor data - complex character input (especially for Asian character input)
305  * Currently WIN32, runtime-only data. */
306  struct wmIMEData *ime_data;
307 
314 
317 
320 
321  /* custom drawing callbacks */
323 
324  /* Private runtime info to show text in the status bar. */
327 
328 #ifdef ime_data
329 # undef ime_data
330 #endif
331 
332 /* These two Lines with # tell makesdna this struct can be excluded. */
333 /* should be something like DNA_EXCLUDE
334  * but the preprocessor first removes all comments, spaces etc */
335 #
336 #
337 typedef struct wmOperatorTypeMacro {
339 
340  /* operator id */
341  char idname[64];
342  /* rna pointer to access properties, like keymap */
345  struct PointerRNA *ptr;
347 
348 /* Partial copy of the event, for matching by event handler. */
349 typedef struct wmKeyMapItem {
350  struct wmKeyMapItem *next, *prev;
351 
352  /* operator */
354  char idname[64];
357 
358  /* modal */
360  char propvalue_str[64];
362  short propvalue;
363 
364  /* event */
366  short type;
368  short val;
370  short shift, ctrl, alt, oskey;
372  short keymodifier;
373 
374  /* flag: inactive, expanded */
375  short flag;
376 
377  /* runtime */
379  short maptype;
381  short id;
382  char _pad[2];
389  struct PointerRNA *ptr;
391 
393 typedef struct wmKeyMapDiffItem {
395 
399 
401 enum {
402  KMI_INACTIVE = (1 << 0),
403  KMI_EXPANDED = (1 << 1),
404  KMI_USER_MODIFIED = (1 << 2),
405  KMI_UPDATE = (1 << 3),
419  KMI_REPEAT_IGNORE = (1 << 4),
420 };
421 
423 enum {
430 };
431 
432 /* stored in WM, the actively used keymaps */
433 typedef struct wmKeyMap {
434  struct wmKeyMap *next, *prev;
435 
438 
440  char idname[64];
442  short spaceid;
444  short regionid;
446  char owner_id[64];
447 
449  short flag;
451  short kmi_id;
452 
453  /* runtime */
455  bool (*poll)(struct bContext *);
456  bool (*poll_modal_item)(const struct wmOperator *op, int value);
457 
459  const void *modal_items;
461 
463 enum {
464  KEYMAP_MODAL = (1 << 0), /* modal map, not using operatornames */
465  KEYMAP_USER = (1 << 1), /* user keymap */
466  KEYMAP_EXPANDED = (1 << 2),
468  KEYMAP_DIFF = (1 << 4), /* diff keymap for user preferences */
469  KEYMAP_USER_MODIFIED = (1 << 5), /* keymap has user modifications */
470  KEYMAP_UPDATE = (1 << 6),
471  KEYMAP_TOOL = (1 << 7), /* keymap for active tool system */
472 };
473 
481 typedef struct wmKeyConfigPref {
484  char idname[64];
487 
488 typedef struct wmKeyConfig {
489  struct wmKeyConfig *next, *prev;
490 
492  char idname[64];
494  char basename[64];
495 
498  short flag;
499  char _pad0[2];
501 
503 enum {
504  KEYCONF_USER = (1 << 1), /* And what about (1 << 0)? */
505  KEYCONF_INIT_DEFAULT = (1 << 2), /* Has default keymap been initialized? */
506 };
507 
512 typedef struct wmOperator {
513  struct wmOperator *next, *prev;
514 
515  /* saved */
517  char idname[64];
520 
521  /* runtime */
525  void *customdata;
527  void *py_instance;
528 
530  struct PointerRNA *ptr;
533 
537  struct wmOperator *opm;
539  struct uiLayout *layout;
540  short flag;
541  char _pad[6];
543 
547 enum {
549  OPERATOR_CANCELLED = (1 << 1),
550  OPERATOR_FINISHED = (1 << 2),
551  /* add this flag if the event should pass through */
553  /* in case operator got executed outside WM code... like via fileselect */
554  OPERATOR_HANDLED = (1 << 4),
555  /* used for operators that act indirectly (eg. popup menu)
556  * note: this isn't great design (using operators to trigger UI) avoid where possible. */
557  OPERATOR_INTERFACE = (1 << 5),
558 };
559 #define OPERATOR_FLAGS_ALL \
560  (OPERATOR_RUNNING_MODAL | OPERATOR_CANCELLED | OPERATOR_FINISHED | OPERATOR_PASS_THROUGH | \
561  OPERATOR_HANDLED | OPERATOR_INTERFACE | 0)
562 
563 /* sanity checks for debug mode only */
564 #define OPERATOR_RETVAL_CHECK(ret) \
565  (void)ret, BLI_assert(ret != 0 && (ret & OPERATOR_FLAGS_ALL) == ret)
566 
568 enum {
572  OP_IS_INVOKE = (1 << 0),
574  OP_IS_REPEAT = (1 << 1),
583  OP_IS_REPEAT_LAST = (1 << 1),
584 
587 
591 };
592 
593 #ifdef __cplusplus
594 }
595 #endif
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
struct wmOperatorTypeMacro wmOperatorTypeMacro
struct wmKeyMapDiffItem wmKeyMapDiffItem
@ OPERATOR_CANCELLED
@ OPERATOR_INTERFACE
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OPERATOR_HANDLED
@ OPERATOR_PASS_THROUGH
struct wmXrData wmXrData
struct wmOperator wmOperator
@ KEYMAP_USER_MODIFIED
@ KEYMAP_CHILDREN_EXPANDED
struct Report Report
@ 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 wmWindowManager wmWindowManager
@ KEYCONF_INIT_DEFAULT
struct wmKeyMap wmKeyMap
struct ReportTimerInfo ReportTimerInfo
@ KMI_REPEAT_IGNORE
@ KMI_USER_MODIFIED
@ WM_KEYCONFIG_IS_INIT
@ WM_WINDOW_IS_INIT
struct wmKeyMapItem wmKeyMapItem
@ OP_IS_REPEAT_LAST
@ OP_IS_MODAL_CURSOR_REGION
@ OP_IS_MODAL_GRAB_CURSOR
struct wmKeyConfigPref wmKeyConfigPref
@ RPT_ERROR_OUT_OF_MEMORY
@ RPT_ERROR_INVALID_INPUT
@ RPT_ERROR_INVALID_CONTEXT
struct wmWindow wmWindow
@ KMI_TYPE_TEXTINPUT
@ KMI_TYPE_KEYBOARD
struct ReportList ReportList
Definition: DNA_ID.h:273
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
struct ReportList reports
struct UndoStack * undo_stack
struct wmKeyConfig * userconf
struct wmTimer * autosavetimer
struct wmWindow * windrawable
struct wmKeyConfig * addonconf
struct wmWindow * winactive
struct wmWindow * parent
struct wmEvent * eventstate
struct Scene * scene
struct wmWindow * prev
struct bScreen *screen DNA_DEPRECATED
struct wmIMEData * ime_data
char event_queue_check_drag_handled
char view_layer_name[64]
struct wmWindow * next
ScrAreaMap global_areas
struct WorkSpaceInstanceHook * workspace_hook
struct Scene * new_scene
struct wmGesture * tweak
struct Stereo3dFormat * stereo3d_format
XrSessionSettings session_settings
struct wmXrRuntimeData * runtime