diff options
Diffstat (limited to 'source/blender/windowmanager/WM_types.h')
-rw-r--r-- | source/blender/windowmanager/WM_types.h | 72 |
1 files changed, 49 insertions, 23 deletions
diff --git a/source/blender/windowmanager/WM_types.h b/source/blender/windowmanager/WM_types.h index ff252f0fc20..3c0e99bddd0 100644 --- a/source/blender/windowmanager/WM_types.h +++ b/source/blender/windowmanager/WM_types.h @@ -94,12 +94,12 @@ * </pre> * * A common way to get the space from the ScrArea: - * <pre> - * if (sa->spacetype == SPACE_VIEW3D) { - * View3D *v3d = sa->spacedata.first; - * ... - * } - * </pre> + * \code{.c} + * if (sa->spacetype == SPACE_VIEW3D) { + * View3D *v3d = sa->spacedata.first; + * ... + * } + * \endcode */ #ifdef __cplusplus @@ -109,7 +109,6 @@ extern "C" { struct bContext; struct wmEvent; struct wmWindowManager; -struct uiLayout; struct wmOperator; struct ImBuf; @@ -124,17 +123,22 @@ struct ImBuf; /* ************** wmOperatorType ************************ */ /* flag */ -#define OPTYPE_REGISTER 1 /* register operators in stack after finishing */ -#define OPTYPE_UNDO 2 /* do undo push after after */ -#define OPTYPE_BLOCKING 4 /* let blender grab all input from the WM (X11) */ -#define OPTYPE_MACRO 8 -#define OPTYPE_GRAB_POINTER 16 /* grabs the cursor and optionally enables continuous cursor wrapping */ -#define OPTYPE_PRESET 32 /* show preset menu */ -#define OPTYPE_INTERNAL 64 /* some operators are mainly for internal use - * and don't make sense to be accessed from the - * search menu, even if poll() returns true. - * currently only used for the search toolbox */ -#define OPTYPE_LOCK_BYPASS 128 /* Allow operator to run when interface is locked */ +enum { + OPTYPE_REGISTER = (1 << 0), /* register operators in stack after finishing */ + OPTYPE_UNDO = (1 << 1), /* do undo push after after */ + OPTYPE_BLOCKING = (1 << 2), /* let blender grab all input from the WM (X11) */ + OPTYPE_MACRO = (1 << 3), + OPTYPE_GRAB_CURSOR = (1 << 4), /* grabs the cursor and optionally enables continuous cursor wrapping */ + OPTYPE_PRESET = (1 << 5), /* show preset menu */ + + /* some operators are mainly for internal use + * and don't make sense to be accessed from the + * search menu, even if poll() returns true. + * currently only used for the search toolbox */ + OPTYPE_INTERNAL = (1 << 6), + + OPTYPE_LOCK_BYPASS = (1 << 7), /* Allow operator to run when interface is locked */ +}; /* context to call operator in for WM_operator_name_call */ /* rna_ui.c contains EnumPropertyItem's of these, keep in sync */ @@ -169,7 +173,7 @@ enum { #define KM_OSKEY2 128 /* KM_MOD_ flags for wmKeyMapItem and wmEvent.alt/shift/oskey/ctrl */ -/* note that KM_ANY and false are used with these defines too */ +/* note that KM_ANY and KM_NOTHING are used with these defines too */ #define KM_MOD_FIRST 1 #define KM_MOD_SECOND 2 @@ -239,6 +243,7 @@ typedef struct wmNotifier { #define NC_MASK (21<<24) #define NC_GPENCIL (22<<24) #define NC_LINESTYLE (23<<24) +#define NC_CAMERA (24<<24) /* data type, 256 entries is enough, it can overlap */ #define NOTE_DATA 0x00FF0000 @@ -297,6 +302,7 @@ typedef struct wmNotifier { #define ND_POINTCACHE (28<<16) #define ND_PARENT (29<<16) #define ND_LOD (30<<16) +#define ND_DRAW_RENDER_VIEWPORT (31<<16) /* for camera & sequencer viewport update, also /w NC_SCENE */ /* NC_MATERIAL Material */ #define ND_SHADING (30<<16) @@ -324,6 +330,9 @@ typedef struct wmNotifier { #define ND_NLA_ACTCHANGE (74<<16) #define ND_FCURVES_ORDER (75<<16) + /* NC_GPENCIL */ +#define ND_GPENCIL_EDITMODE (85<<16) + /* NC_GEOM Geometry */ /* Mesh, Curve, MetaBall, Armature, .. */ #define ND_SELECT (90<<16) @@ -352,6 +361,7 @@ typedef struct wmNotifier { #define ND_SPACE_NODE_VIEW (17<<16) #define ND_SPACE_CHANGED (18<<16) /*sent to a new editor type after it's replaced an old one*/ #define ND_SPACE_CLIP (19<<16) +#define ND_SPACE_FILE_PREVIEW (20<<16) /* subtype, 256 entries too */ #define NOTE_SUBTYPE 0x0000FF00 @@ -449,7 +459,7 @@ typedef struct wmEvent { const char *keymap_idname; /* tablet info, only use when the tablet is active */ - struct wmTabletData *tablet_data; + const struct wmTabletData *tablet_data; /* custom data */ short custom; /* custom data type, stylus, 6dof, see wm_event_types.h */ @@ -554,9 +564,7 @@ typedef struct wmOperatorType { /* pointer to modal keymap, do not free! */ struct wmKeyMap *modalkeymap; - /* only used for operators defined with python - * use to store pointers to python functions */ - void *pyop_data; + /* python needs the operator type as well */ int (*pyop_poll)(struct bContext *, struct wmOperatorType *ot) ATTR_WARN_UNUSED_RESULT; /* RNA integration */ @@ -567,6 +575,24 @@ typedef struct wmOperatorType { } wmOperatorType; +#ifdef WITH_INPUT_IME +/* *********** Input Method Editor (IME) *********** */ + +/* similar to GHOST_TEventImeData */ +typedef struct wmIMEData { + size_t result_len, composite_len; + + char *str_result; /* utf8 encoding */ + char *str_composite; /* utf8 encoding */ + + int cursor_pos; /* cursor position in the IME composition. */ + int sel_start; /* beginning of the selection */ + int sel_end; /* end of the selection */ + + bool is_ime_composing; +} wmIMEData; +#endif + /* **************** Paint Cursor ******************* */ typedef void (*wmPaintCursorDraw)(struct bContext *C, int, int, void *customdata); |