Blender  V3.3
wm_operator_type.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
9 #include "MEM_guardedalloc.h"
10 
11 #include "CLG_log.h"
12 
13 #include "DNA_ID.h"
14 #include "DNA_scene_types.h"
15 #include "DNA_screen_types.h"
16 #include "DNA_userdef_types.h"
18 
19 #include "BLT_translation.h"
20 
21 #include "BLI_blenlib.h"
22 #include "BLI_ghash.h"
23 #include "BLI_utildefines.h"
24 
25 #include "BKE_context.h"
26 #include "BKE_idprop.h"
27 
28 #include "RNA_access.h"
29 #include "RNA_define.h"
30 #include "RNA_enum_types.h"
31 #include "RNA_prototypes.h"
32 
33 #include "WM_api.h"
34 #include "WM_types.h"
35 
36 #include "wm.h"
37 #include "wm_event_system.h"
38 
39 #define UNDOCUMENTED_OPERATOR_TIP N_("(undocumented operator)")
40 
42 
43 /* -------------------------------------------------------------------- */
49 static int ot_prop_basic_count = -1;
50 
51 wmOperatorType *WM_operatortype_find(const char *idname, bool quiet)
52 {
53  if (idname[0]) {
55 
56  /* needed to support python style names without the _OT_ syntax */
57  char idname_bl[OP_MAX_TYPENAME];
58  WM_operator_bl_idname(idname_bl, idname);
59 
60  ot = BLI_ghash_lookup(global_ops_hash, idname_bl);
61  if (ot) {
62  return ot;
63  }
64 
65  if (!quiet) {
66  CLOG_INFO(
67  WM_LOG_OPERATORS, 0, "search for unknown operator '%s', '%s'\n", idname_bl, idname);
68  }
69  }
70  else {
71  if (!quiet) {
72  CLOG_INFO(WM_LOG_OPERATORS, 0, "search for empty operator");
73  }
74  }
75 
76  return NULL;
77 }
78 
80 {
82 }
83 
84 /* -------------------------------------------------------------------- */
89 {
90  wmOperatorType *ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
91 
93 
94  ot->srna = RNA_def_struct_ptr(&BLENDER_RNA, "", &RNA_OperatorProperties);
96  /* Set the default i18n context now, so that opfunc can redefine it if needed! */
100 
101  return ot;
102 }
104 {
105  if (ot->name == NULL) {
106  CLOG_ERROR(WM_LOG_OPERATORS, "Operator '%s' has no name property", ot->idname);
107  }
108  BLI_assert((ot->description == NULL) || (ot->description[0]));
109 
110  /* Allow calling _begin without _end in operatortype creation. */
112 
113  /* XXX All ops should have a description but for now allow them not to. */
117 
119 }
120 
121 /* All ops in 1 list (for time being... needs evaluation later). */
122 
123 void WM_operatortype_append(void (*opfunc)(wmOperatorType *))
124 {
126  opfunc(ot);
128 }
129 
130 void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata)
131 {
133  opfunc(ot, userdata);
135 }
136 
140 {
142 
144 
145  if (ot->last_properties) {
147  }
148 
149  if (ot->macro.first) {
151  }
152 
154 
156 
157  MEM_freeN(ot);
158 }
159 
160 bool WM_operatortype_remove(const char *idname)
161 {
162  wmOperatorType *ot = WM_operatortype_find(idname, 0);
163 
164  if (ot == NULL) {
165  return false;
166  }
167 
169 
170  return true;
171 }
172 
174 {
175  /* reserve size is set based on blender default setup */
176  global_ops_hash = BLI_ghash_str_new_ex("wm_operatortype_init gh", 2048);
177 }
178 
180 {
181  if (ot->last_properties) {
183  }
184 
185  if (ot->macro.first) {
187  }
188 
189  if (ot->rna_ext.srna) {
190  /* python operator, allocs own string */
191  MEM_freeN((void *)ot->idname);
192  }
193 
194  MEM_freeN(ot);
195 }
196 
198 {
201 }
202 
204 {
205  if (ot_prop_basic_count == -1) {
206  /* Don't do anything if _begin was called before, but not _end. */
208  }
209 }
210 
212 {
213  PointerRNA struct_ptr;
214  int counter = 0;
215 
216  if (ot_prop_basic_count == -1) {
217  /* WM_operatortype_props_advanced_begin was not called. Don't do anything. */
218  return;
219  }
220 
222 
223  RNA_STRUCT_BEGIN (&struct_ptr, prop) {
224  counter++;
227  }
228  }
230 
231  ot_prop_basic_count = -1;
232 }
233 
235 {
236  GHashIterator iter;
237 
238  for (WM_operatortype_iter(&iter); (!BLI_ghashIterator_done(&iter));
239  (BLI_ghashIterator_step(&iter))) {
241 
242  if (ot->last_properties) {
245  }
246  }
247 }
248 
251  PropertyRNA *UNUSED(prop),
252  const char *UNUSED(edit_text),
254  void *visit_user_data)
255 {
256  GHashIterator gh_iter;
257  GHASH_ITER (gh_iter, global_ops_hash) {
259 
260  char idname_py[OP_MAX_TYPENAME];
261  WM_operator_py_idname(idname_py, ot->idname);
262 
263  StringPropertySearchVisitParams visit_params = {NULL};
264  visit_params.text = idname_py;
265  visit_params.info = ot->name;
266  visit_fn(visit_user_data, &visit_params);
267  }
268 }
269 
272 /* -------------------------------------------------------------------- */
276 typedef struct {
277  int retval;
278 } MacroData;
279 
280 static void wm_macro_start(wmOperator *op)
281 {
282  if (op->customdata == NULL) {
283  op->customdata = MEM_callocN(sizeof(MacroData), "MacroData");
284  }
285 }
286 
287 static int wm_macro_end(wmOperator *op, int retval)
288 {
289  if (retval & OPERATOR_CANCELLED) {
290  MacroData *md = op->customdata;
291 
292  if (md->retval & OPERATOR_FINISHED) {
293  retval |= OPERATOR_FINISHED;
294  retval &= ~OPERATOR_CANCELLED;
295  }
296  }
297 
298  /* if modal is ending, free custom data */
299  if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED)) {
300  if (op->customdata) {
301  MEM_freeN(op->customdata);
302  op->customdata = NULL;
303  }
304  }
305 
306  return retval;
307 }
308 
309 /* macro exec only runs exec calls */
311 {
312  int retval = OPERATOR_FINISHED;
313 
314  wm_macro_start(op);
315 
316  LISTBASE_FOREACH (wmOperator *, opm, &op->macro) {
317  if (opm->type->exec) {
318  retval = opm->type->exec(C, opm);
319  OPERATOR_RETVAL_CHECK(retval);
320 
321  if (retval & OPERATOR_FINISHED) {
322  MacroData *md = op->customdata;
323  md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
324  }
325  else {
326  break; /* operator didn't finish, end macro */
327  }
328  }
329  else {
330  CLOG_WARN(WM_LOG_OPERATORS, "'%s' can't exec macro", opm->type->idname);
331  }
332  }
333 
334  return wm_macro_end(op, retval);
335 }
336 
338  wmOperator *op,
339  const wmEvent *event,
340  wmOperator *opm)
341 {
342  int retval = OPERATOR_FINISHED;
343 
344  /* start from operator received as argument */
345  for (; opm; opm = opm->next) {
346  if (opm->type->invoke) {
347  retval = opm->type->invoke(C, opm, event);
348  }
349  else if (opm->type->exec) {
350  retval = opm->type->exec(C, opm);
351  }
352 
353  OPERATOR_RETVAL_CHECK(retval);
354 
355  BLI_movelisttolist(&op->reports->list, &opm->reports->list);
356 
357  if (retval & OPERATOR_FINISHED) {
358  MacroData *md = op->customdata;
359  md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
360  }
361  else {
362  break; /* operator didn't finish, end macro */
363  }
364  }
365 
366  return wm_macro_end(op, retval);
367 }
368 
369 static int wm_macro_invoke(bContext *C, wmOperator *op, const wmEvent *event)
370 {
371  wm_macro_start(op);
372  return wm_macro_invoke_internal(C, op, event, op->macro.first);
373 }
374 
375 static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
376 {
377  wmOperator *opm = op->opm;
378  int retval = OPERATOR_FINISHED;
379 
380  if (opm == NULL) {
381  CLOG_ERROR(WM_LOG_OPERATORS, "macro error, calling NULL modal()");
382  }
383  else {
384  retval = opm->type->modal(C, opm, event);
385  OPERATOR_RETVAL_CHECK(retval);
386 
387  /* if we're halfway through using a tool and cancel it, clear the options T37149. */
388  if (retval & OPERATOR_CANCELLED) {
390  }
391 
392  /* if this one is done but it's not the last operator in the macro */
393  if ((retval & OPERATOR_FINISHED) && opm->next) {
394  MacroData *md = op->customdata;
395 
396  md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
397 
398  retval = wm_macro_invoke_internal(C, op, event, opm->next);
399 
400  /* if new operator is modal and also added its own handler */
401  if (retval & OPERATOR_RUNNING_MODAL && op->opm != opm) {
402  wmWindow *win = CTX_wm_window(C);
403  wmEventHandler_Op *handler;
404 
405  handler = BLI_findptr(&win->modalhandlers, op, offsetof(wmEventHandler_Op, op));
406  if (handler) {
407  BLI_remlink(&win->modalhandlers, handler);
408  wm_event_free_handler(&handler->head);
409  }
410 
411  /* If operator is blocking, grab cursor.
412  * This may end up grabbing twice, but we don't care. */
413  if (op->opm->type->flag & OPTYPE_BLOCKING) {
414  int bounds[4] = {-1, -1, -1, -1};
416 
417  if ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) ||
418  (op->opm->type->flag & OPTYPE_GRAB_CURSOR_XY)) {
420  }
421  else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_X) {
423  }
424  else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_Y) {
426  }
427 
428  if (wrap) {
429  ARegion *region = CTX_wm_region(C);
430  if (region) {
431  bounds[0] = region->winrct.xmin;
432  bounds[1] = region->winrct.ymax;
433  bounds[2] = region->winrct.xmax;
434  bounds[3] = region->winrct.ymin;
435  }
436  }
437 
438  WM_cursor_grab_enable(win, wrap, false, bounds);
439  }
440  }
441  }
442  }
443 
444  return wm_macro_end(op, retval);
445 }
446 
448 {
449  /* call cancel on the current modal operator, if any */
450  if (op->opm && op->opm->type->cancel) {
451  op->opm->type->cancel(C, op->opm);
452  }
453 
455 }
456 
458  const char *name,
459  const char *description,
460  int flag)
461 {
463  const char *i18n_context;
464 
465  if (WM_operatortype_find(idname, true)) {
466  CLOG_ERROR(WM_LOG_OPERATORS, "operator %s exists, cannot create macro", idname);
467  return NULL;
468  }
469 
470  ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
471  ot->srna = RNA_def_struct_ptr(&BLENDER_RNA, "", &RNA_OperatorProperties);
472 
473  ot->idname = idname;
474  ot->name = name;
475  ot->description = description;
476  ot->flag = OPTYPE_MACRO | flag;
477 
478  ot->exec = wm_macro_exec;
482  ot->poll = NULL;
483 
484  /* XXX All ops should have a description but for now allow them not to. */
485  BLI_assert((ot->description == NULL) || (ot->description[0]));
486 
490  /* Use i18n context from rna_ext.srna if possible (py operators). */
494  ot->translation_context = i18n_context;
495 
497 
498  return ot;
499 }
500 
501 void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata)
502 {
504 
505  ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
506  ot->srna = RNA_def_struct_ptr(&BLENDER_RNA, "", &RNA_OperatorProperties);
507 
508  ot->flag = OPTYPE_MACRO;
509  ot->exec = wm_macro_exec;
513  ot->poll = NULL;
514 
515  /* XXX All ops should have a description but for now allow them not to. */
516  BLI_assert((ot->description == NULL) || (ot->description[0]));
517 
518  /* Set the default i18n context now, so that opfunc can redefine it if needed! */
521  opfunc(ot, userdata);
522 
526 
528 }
529 
531 {
532  wmOperatorTypeMacro *otmacro = MEM_callocN(sizeof(wmOperatorTypeMacro), "wmOperatorTypeMacro");
533 
534  BLI_strncpy(otmacro->idname, idname, OP_MAX_TYPENAME);
535 
536  /* do this on first use, since operatordefinitions might have been not done yet */
537  WM_operator_properties_alloc(&(otmacro->ptr), &(otmacro->properties), idname);
539 
540  BLI_addtail(&ot->macro, otmacro);
541 
542  {
543  /* operator should always be found but in the event its not. don't segfault */
544  wmOperatorType *otsub = WM_operatortype_find(idname, 0);
545  if (otsub) {
547  ot->srna, otsub->idname, otsub->srna, otsub->name, otsub->description);
548  }
549  }
550 
551  return otmacro;
552 }
553 
555 {
556  LISTBASE_FOREACH (wmOperatorTypeMacro *, otmacro, &ot->macro) {
557  if (otmacro->ptr) {
558  WM_operator_properties_free(otmacro->ptr);
559  MEM_freeN(otmacro->ptr);
560  }
561  }
563 }
564 
565 const char *WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
566 {
567  const char *name = NULL;
568 
569  if (ot->get_name && properties) {
570  name = ot->get_name(ot, properties);
571  }
572 
573  return (name && name[0]) ? name : RNA_struct_ui_name(ot->srna);
574 }
575 
577  struct wmOperatorType *ot,
578  struct PointerRNA *properties)
579 {
580  if (ot->get_description && properties) {
581  char *description = ot->get_description(C, ot, properties);
582 
583  if (description) {
584  if (description[0]) {
585  return description;
586  }
587  MEM_freeN(description);
588  }
589  }
590 
591  const char *info = RNA_struct_ui_description(ot->srna);
592  if (info && info[0]) {
593  return BLI_strdup(info);
594  }
595  return NULL;
596 }
597 
599  struct wmOperatorType *ot,
600  struct PointerRNA *properties)
601 {
602  char *text = WM_operatortype_description(C, ot, properties);
603  if (text == NULL) {
604  const char *text_orig = WM_operatortype_name(ot, properties);
605  if (text_orig != NULL) {
606  text = BLI_strdup(text_orig);
607  }
608  }
609  return text;
610 }
611 
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
void IDP_FreeProperty(struct IDProperty *prop)
Definition: idprop.c:1093
#define BLI_assert(a)
Definition: BLI_assert.h:46
GHash * BLI_ghash_str_new_ex(const char *info, unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
void BLI_ghashIterator_step(GHashIterator *ghi)
Definition: BLI_ghash.c:914
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.h:302
#define GHASH_ITER(gh_iter_, ghash_)
Definition: BLI_ghash.h:321
void(* GHashValFreeFP)(void *val)
Definition: BLI_ghash.h:38
void * BLI_ghash_lookup(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:734
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:790
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition: BLI_ghash.c:710
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:863
void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
Definition: BLI_ghash.c:898
BLI_INLINE bool BLI_ghashIterator_done(const GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.h:310
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:336
void void void BLI_movelisttolist(struct ListBase *dst, struct ListBase *src) ATTR_NONNULL(1
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:466
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:100
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, int offset) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL() ATTR_MALLOC
Definition: string.c:42
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_NONNULL()
Definition: string.c:64
#define UNUSED(x)
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define CLOG_ERROR(clg_ref,...)
Definition: CLG_log.h:190
#define CLOG_WARN(clg_ref,...)
Definition: CLG_log.h:189
#define CLOG_INFO(clg_ref, level,...)
Definition: CLG_log.h:187
ID and Library types, which are fundamental for sdna.
#define OP_MAX_TYPENAME
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
@ OPERATOR_RUNNING_MODAL
@ OP_IS_MODAL_GRAB_CURSOR
#define OPERATOR_RETVAL_CHECK(ret)
Read Guarded memory(de)allocation.
#define RNA_STRUCT_BEGIN(sptr, prop)
Definition: RNA_access.h:569
#define RNA_STRUCT_END
Definition: RNA_access.h:589
void(* StringPropertySearchVisitFunc)(void *visit_user_data, const StringPropertySearchVisitParams *params)
Definition: RNA_types.h:568
#define C
Definition: RandGen.cpp:25
#define WM_operatortype_prop_tag(property, tags)
Definition: WM_api.h:1013
@ OPTYPE_MACRO
Definition: WM_types.h:151
@ OPTYPE_BLOCKING
Definition: WM_types.h:150
@ OPTYPE_GRAB_CURSOR_XY
Definition: WM_types.h:154
@ OPTYPE_GRAB_CURSOR_X
Definition: WM_types.h:156
@ OPTYPE_GRAB_CURSOR_Y
Definition: WM_types.h:158
@ WM_CURSOR_WRAP_X
Definition: WM_types.h:190
@ WM_CURSOR_WRAP_XY
Definition: WM_types.h:192
@ WM_CURSOR_WRAP_Y
Definition: WM_types.h:191
@ WM_CURSOR_WRAP_NONE
Definition: WM_types.h:189
@ OP_PROP_TAG_ADVANCED
Definition: WM_types.h:224
struct CLG_LogRef * WM_LOG_OPERATORS
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
ccl_gpu_kernel_postfix ccl_global int * counter
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
static struct PartialUpdateUser * wrap(PartialUpdateUserImpl *user)
const char * RNA_struct_ui_description(const StructRNA *type)
Definition: rna_access.c:609
const char * RNA_struct_ui_name(const StructRNA *type)
Definition: rna_access.c:591
unsigned int RNA_struct_count_properties(StructRNA *srna)
Definition: rna_access.c:780
const char * RNA_struct_translation_context(const StructRNA *type)
Definition: rna_access.c:619
void RNA_def_struct_property_tags(StructRNA *srna, const EnumPropertyItem *prop_tag_defines)
Definition: rna_define.c:1143
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1237
void RNA_def_struct_identifier(BlenderRNA *brna, StructRNA *srna, const char *identifier)
Definition: rna_define.c:1205
StructRNA * RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRNA *srnafrom)
Definition: rna_define.c:900
PropertyRNA * RNA_def_pointer_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4186
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
Definition: rna_define.c:777
void RNA_def_struct_translation_context(StructRNA *srna, const char *context)
Definition: rna_define.c:1250
BlenderRNA BLENDER_RNA
const EnumPropertyItem rna_enum_operator_property_tags[]
Definition: rna_wm.c:485
CLG_LogType * type
Definition: CLG_log.h:106
StructRNA * srna
Definition: RNA_types.h:766
void * first
Definition: DNA_listBase.h:31
int ymin
Definition: DNA_vec_types.h:64
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
int xmax
Definition: DNA_vec_types.h:63
wmEventHandler head
struct IDProperty * properties
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:935
struct IDProperty * last_properties
Definition: WM_types.h:972
const char * idname
Definition: WM_types.h:890
char *(* get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *)
Definition: WM_types.h:966
int cursor_pending
Definition: WM_types.h:996
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:927
struct StructRNA * srna
Definition: WM_types.h:969
ExtensionRNA rna_ext
Definition: WM_types.h:993
const char * translation_context
Definition: WM_types.h:891
const char * description
Definition: WM_types.h:893
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:903
const char *(* get_name)(struct wmOperatorType *, struct PointerRNA *)
Definition: WM_types.h:960
ListBase macro
Definition: WM_types.h:984
struct ReportList * reports
struct wmOperator * next
struct wmOperatorType * type
struct PointerRNA * ptr
struct wmOperator * opm
void WM_cursor_grab_enable(wmWindow *win, int wrap, bool hide, int bounds[4])
Definition: wm_cursors.c:226
@ WM_CURSOR_PICK_AREA
Definition: wm_cursors.h:61
void wm_event_free_handler(wmEventHandler *handler)
PointerRNA * ptr
Definition: wm_files.c:3480
wmOperatorType * ot
Definition: wm_files.c:3479
void WM_keyconfig_update_operatortype(void)
Definition: wm_keymap.c:1800
wmOperatorType * WM_operatortype_append_macro(const char *idname, const char *name, const char *description, int flag)
static int wm_macro_end(wmOperator *op, int retval)
void WM_operatortype_last_properties_clear_all(void)
void WM_operatortype_iter(GHashIterator *ghi)
static void wm_operatortype_free_macro(wmOperatorType *ot)
char * WM_operatortype_description(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *properties)
wmOperatorTypeMacro * WM_operatortype_macro_define(wmOperatorType *ot, const char *idname)
static int ot_prop_basic_count
static wmOperatorType * wm_operatortype_append__begin(void)
void WM_operatortype_props_advanced_begin(wmOperatorType *ot)
static void wm_macro_start(wmOperator *op)
char * WM_operatortype_description_or_name(struct bContext *C, struct wmOperatorType *ot, struct PointerRNA *properties)
wmOperatorType * WM_operatortype_find(const char *idname, bool quiet)
void WM_operatortype_append(void(*opfunc)(wmOperatorType *))
void wm_operatortype_free(void)
static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operatortype_append_macro_ptr(void(*opfunc)(wmOperatorType *, void *), void *userdata)
static int wm_macro_exec(bContext *C, wmOperator *op)
void WM_operatortype_append_ptr(void(*opfunc)(wmOperatorType *, void *), void *userdata)
static void wm_operatortype_append__end(wmOperatorType *ot)
#define UNDOCUMENTED_OPERATOR_TIP
const char * WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
static GHash * global_ops_hash
void wm_operatortype_init(void)
static void operatortype_ghash_free_cb(wmOperatorType *ot)
void WM_operatortype_remove_ptr(wmOperatorType *ot)
void WM_operatortype_idname_visit_for_search(const bContext *UNUSED(C), PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), const char *UNUSED(edit_text), StringPropertySearchVisitFunc visit_fn, void *visit_user_data)
static int wm_macro_invoke(bContext *C, wmOperator *op, const wmEvent *event)
void WM_operatortype_props_advanced_end(wmOperatorType *ot)
static int wm_macro_invoke_internal(bContext *C, wmOperator *op, const wmEvent *event, wmOperator *opm)
bool WM_operatortype_remove(const char *idname)
static void wm_macro_cancel(bContext *C, wmOperator *op)
size_t WM_operator_py_idname(char *dst, const char *src)
Definition: wm_operators.c:110
size_t WM_operator_bl_idname(char *dst, const char *src)
Definition: wm_operators.c:128
void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring)
Definition: wm_operators.c:680
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
Definition: wm_operators.c:661
void WM_operator_properties_clear(PointerRNA *ptr)
Definition: wm_operators.c:774
void WM_operator_properties_free(PointerRNA *ptr)
Definition: wm_operators.c:783
void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
Definition: wm_operators.c:701