Blender  V2.93
wm_operator_type.c
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 
23 #include "MEM_guardedalloc.h"
24 
25 #include "CLG_log.h"
26 
27 #include "DNA_ID.h"
28 #include "DNA_scene_types.h"
29 #include "DNA_screen_types.h"
30 #include "DNA_userdef_types.h"
32 
33 #include "BLT_translation.h"
34 
35 #include "BLI_blenlib.h"
36 #include "BLI_ghash.h"
37 #include "BLI_utildefines.h"
38 
39 #include "BKE_context.h"
40 #include "BKE_idprop.h"
41 
42 #include "RNA_access.h"
43 #include "RNA_define.h"
44 #include "RNA_enum_types.h"
45 
46 #include "WM_api.h"
47 #include "WM_types.h"
48 
49 #include "wm.h"
50 #include "wm_event_system.h"
51 
52 #define UNDOCUMENTED_OPERATOR_TIP N_("(undocumented operator)")
53 
55 
56 /* -------------------------------------------------------------------- */
62 static int ot_prop_basic_count = -1;
63 
64 wmOperatorType *WM_operatortype_find(const char *idname, bool quiet)
65 {
66  if (idname[0]) {
68 
69  /* needed to support python style names without the _OT_ syntax */
70  char idname_bl[OP_MAX_TYPENAME];
71  WM_operator_bl_idname(idname_bl, idname);
72 
73  ot = BLI_ghash_lookup(global_ops_hash, idname_bl);
74  if (ot) {
75  return ot;
76  }
77 
78  if (!quiet) {
79  CLOG_INFO(
80  WM_LOG_OPERATORS, 0, "search for unknown operator '%s', '%s'\n", idname_bl, idname);
81  }
82  }
83  else {
84  if (!quiet) {
85  CLOG_INFO(WM_LOG_OPERATORS, 0, "search for empty operator");
86  }
87  }
88 
89  return NULL;
90 }
91 
92 /* caller must free */
94 {
96 }
97 
98 /* -------------------------------------------------------------------- */
103 {
104  wmOperatorType *ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
105 
107 
110  /* Set the default i18n context now, so that opfunc can redefine it if needed! */
113 
114  return ot;
115 }
117 {
118  if (ot->name == NULL) {
119  CLOG_ERROR(WM_LOG_OPERATORS, "Operator '%s' has no name property", ot->idname);
120  }
121  BLI_assert((ot->description == NULL) || (ot->description[0]));
122 
123  /* Allow calling _begin without _end in operatortype creation. */
125 
126  /* XXX All ops should have a description but for now allow them not to. */
130 
132 }
133 
134 /* all ops in 1 list (for time being... needs evaluation later) */
135 void WM_operatortype_append(void (*opfunc)(wmOperatorType *))
136 {
138  opfunc(ot);
140 }
141 
142 void WM_operatortype_append_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata)
143 {
145  opfunc(ot, userdata);
147 }
148 
151 /* called on initialize WM_exit() */
153 {
155 
157 
158  if (ot->last_properties) {
160  }
161 
162  if (ot->macro.first) {
164  }
165 
167 
169 
170  MEM_freeN(ot);
171 }
172 
173 bool WM_operatortype_remove(const char *idname)
174 {
175  wmOperatorType *ot = WM_operatortype_find(idname, 0);
176 
177  if (ot == NULL) {
178  return false;
179  }
180 
182 
183  return true;
184 }
185 
186 /* called on initialize WM_init() */
188 {
189  /* reserve size is set based on blender default setup */
190  global_ops_hash = BLI_ghash_str_new_ex("wm_operatortype_init gh", 2048);
191 }
192 
194 {
195  if (ot->last_properties) {
197  }
198 
199  if (ot->macro.first) {
201  }
202 
203  if (ot->rna_ext.srna) {
204  /* python operator, allocs own string */
205  MEM_freeN((void *)ot->idname);
206  }
207 
208  MEM_freeN(ot);
209 }
210 
212 {
215 }
216 
230 {
231  if (ot_prop_basic_count == -1) {
232  /* Don't do anything if _begin was called before, but not _end */
234  }
235 }
236 
246 {
247  PointerRNA struct_ptr;
248  int counter = 0;
249 
250  if (ot_prop_basic_count == -1) {
251  /* WM_operatortype_props_advanced_begin was not called. Don't do anything. */
252  return;
253  }
254 
256 
257  RNA_STRUCT_BEGIN (&struct_ptr, prop) {
258  counter++;
259  if (counter > ot_prop_basic_count) {
261  }
262  }
264 
265  ot_prop_basic_count = -1;
266 }
267 
272 {
273  GHashIterator iter;
274 
275  for (WM_operatortype_iter(&iter); (!BLI_ghashIterator_done(&iter));
276  (BLI_ghashIterator_step(&iter))) {
278 
279  if (ot->last_properties) {
282  }
283  }
284 }
285 
288 /* -------------------------------------------------------------------- */
292 typedef struct {
293  int retval;
294 } MacroData;
295 
296 static void wm_macro_start(wmOperator *op)
297 {
298  if (op->customdata == NULL) {
299  op->customdata = MEM_callocN(sizeof(MacroData), "MacroData");
300  }
301 }
302 
303 static int wm_macro_end(wmOperator *op, int retval)
304 {
305  if (retval & OPERATOR_CANCELLED) {
306  MacroData *md = op->customdata;
307 
308  if (md->retval & OPERATOR_FINISHED) {
309  retval |= OPERATOR_FINISHED;
310  retval &= ~OPERATOR_CANCELLED;
311  }
312  }
313 
314  /* if modal is ending, free custom data */
315  if (retval & (OPERATOR_FINISHED | OPERATOR_CANCELLED)) {
316  if (op->customdata) {
317  MEM_freeN(op->customdata);
318  op->customdata = NULL;
319  }
320  }
321 
322  return retval;
323 }
324 
325 /* macro exec only runs exec calls */
327 {
328  int retval = OPERATOR_FINISHED;
329 
330  wm_macro_start(op);
331 
332  LISTBASE_FOREACH (wmOperator *, opm, &op->macro) {
333  if (opm->type->exec) {
334  retval = opm->type->exec(C, opm);
335  OPERATOR_RETVAL_CHECK(retval);
336 
337  if (retval & OPERATOR_FINISHED) {
338  MacroData *md = op->customdata;
339  md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
340  }
341  else {
342  break; /* operator didn't finish, end macro */
343  }
344  }
345  else {
346  CLOG_WARN(WM_LOG_OPERATORS, "'%s' cant exec macro", opm->type->idname);
347  }
348  }
349 
350  return wm_macro_end(op, retval);
351 }
352 
354  wmOperator *op,
355  const wmEvent *event,
356  wmOperator *opm)
357 {
358  int retval = OPERATOR_FINISHED;
359 
360  /* start from operator received as argument */
361  for (; opm; opm = opm->next) {
362  if (opm->type->invoke) {
363  retval = opm->type->invoke(C, opm, event);
364  }
365  else if (opm->type->exec) {
366  retval = opm->type->exec(C, opm);
367  }
368 
369  OPERATOR_RETVAL_CHECK(retval);
370 
371  BLI_movelisttolist(&op->reports->list, &opm->reports->list);
372 
373  if (retval & OPERATOR_FINISHED) {
374  MacroData *md = op->customdata;
375  md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
376  }
377  else {
378  break; /* operator didn't finish, end macro */
379  }
380  }
381 
382  return wm_macro_end(op, retval);
383 }
384 
385 static int wm_macro_invoke(bContext *C, wmOperator *op, const wmEvent *event)
386 {
387  wm_macro_start(op);
388  return wm_macro_invoke_internal(C, op, event, op->macro.first);
389 }
390 
391 static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
392 {
393  wmOperator *opm = op->opm;
394  int retval = OPERATOR_FINISHED;
395 
396  if (opm == NULL) {
397  CLOG_ERROR(WM_LOG_OPERATORS, "macro error, calling NULL modal()");
398  }
399  else {
400  retval = opm->type->modal(C, opm, event);
401  OPERATOR_RETVAL_CHECK(retval);
402 
403  /* if we're halfway through using a tool and cancel it, clear the options T37149. */
404  if (retval & OPERATOR_CANCELLED) {
406  }
407 
408  /* if this one is done but it's not the last operator in the macro */
409  if ((retval & OPERATOR_FINISHED) && opm->next) {
410  MacroData *md = op->customdata;
411 
412  md->retval = OPERATOR_FINISHED; /* keep in mind that at least one operator finished */
413 
414  retval = wm_macro_invoke_internal(C, op, event, opm->next);
415 
416  /* if new operator is modal and also added its own handler */
417  if (retval & OPERATOR_RUNNING_MODAL && op->opm != opm) {
418  wmWindow *win = CTX_wm_window(C);
419  wmEventHandler_Op *handler;
420 
421  handler = BLI_findptr(&win->modalhandlers, op, offsetof(wmEventHandler_Op, op));
422  if (handler) {
423  BLI_remlink(&win->modalhandlers, handler);
424  wm_event_free_handler(&handler->head);
425  }
426 
427  /* If operator is blocking, grab cursor.
428  * This may end up grabbing twice, but we don't care. */
429  if (op->opm->type->flag & OPTYPE_BLOCKING) {
430  int bounds[4] = {-1, -1, -1, -1};
432 
433  if ((op->opm->flag & OP_IS_MODAL_GRAB_CURSOR) ||
434  (op->opm->type->flag & OPTYPE_GRAB_CURSOR_XY)) {
436  }
437  else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_X) {
439  }
440  else if (op->opm->type->flag & OPTYPE_GRAB_CURSOR_Y) {
442  }
443 
444  if (wrap) {
445  ARegion *region = CTX_wm_region(C);
446  if (region) {
447  bounds[0] = region->winrct.xmin;
448  bounds[1] = region->winrct.ymax;
449  bounds[2] = region->winrct.xmax;
450  bounds[3] = region->winrct.ymin;
451  }
452  }
453 
454  WM_cursor_grab_enable(win, wrap, false, bounds);
455  }
456  }
457  }
458  }
459 
460  return wm_macro_end(op, retval);
461 }
462 
464 {
465  /* call cancel on the current modal operator, if any */
466  if (op->opm && op->opm->type->cancel) {
467  op->opm->type->cancel(C, op->opm);
468  }
469 
471 }
472 
473 /* Names have to be static for now */
475  const char *name,
476  const char *description,
477  int flag)
478 {
480  const char *i18n_context;
481 
482  if (WM_operatortype_find(idname, true)) {
483  CLOG_ERROR(WM_LOG_OPERATORS, "operator %s exists, cannot create macro", idname);
484  return NULL;
485  }
486 
487  ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
489 
490  ot->idname = idname;
491  ot->name = name;
492  ot->description = description;
493  ot->flag = OPTYPE_MACRO | flag;
494 
495  ot->exec = wm_macro_exec;
499  ot->poll = NULL;
500 
501  if (!ot->description) {
502  /* XXX All ops should have a description but for now allow them not to. */
504  }
505 
508  /* Use i18n context from rna_ext.srna if possible (py operators). */
512  ot->translation_context = i18n_context;
513 
515 
516  return ot;
517 }
518 
519 void WM_operatortype_append_macro_ptr(void (*opfunc)(wmOperatorType *, void *), void *userdata)
520 {
522 
523  ot = MEM_callocN(sizeof(wmOperatorType), "operatortype");
525 
526  ot->flag = OPTYPE_MACRO;
527  ot->exec = wm_macro_exec;
531  ot->poll = NULL;
532 
533  if (!ot->description) {
535  }
536 
537  /* Set the default i18n context now, so that opfunc can redefine it if needed! */
540  opfunc(ot, userdata);
541 
544 
546 }
547 
549 {
550  wmOperatorTypeMacro *otmacro = MEM_callocN(sizeof(wmOperatorTypeMacro), "wmOperatorTypeMacro");
551 
552  BLI_strncpy(otmacro->idname, idname, OP_MAX_TYPENAME);
553 
554  /* do this on first use, since operatordefinitions might have been not done yet */
555  WM_operator_properties_alloc(&(otmacro->ptr), &(otmacro->properties), idname);
557 
558  BLI_addtail(&ot->macro, otmacro);
559 
560  {
561  /* operator should always be found but in the event its not. don't segfault */
562  wmOperatorType *otsub = WM_operatortype_find(idname, 0);
563  if (otsub) {
565  ot->srna, otsub->idname, otsub->srna, otsub->name, otsub->description);
566  }
567  }
568 
569  return otmacro;
570 }
571 
573 {
574  LISTBASE_FOREACH (wmOperatorTypeMacro *, otmacro, &ot->macro) {
575  if (otmacro->ptr) {
576  WM_operator_properties_free(otmacro->ptr);
577  MEM_freeN(otmacro->ptr);
578  }
579  }
581 }
582 
583 const char *WM_operatortype_name(struct wmOperatorType *ot, struct PointerRNA *properties)
584 {
585  const char *name = NULL;
586 
587  if (ot->get_name && properties) {
588  name = ot->get_name(ot, properties);
589  }
590 
591  return (name && name[0]) ? name : RNA_struct_ui_name(ot->srna);
592 }
593 
595  struct wmOperatorType *ot,
596  struct PointerRNA *properties)
597 {
598  if (ot->get_description && properties) {
599  char *description = ot->get_description(C, ot, properties);
600 
601  if (description) {
602  if (description[0]) {
603  return description;
604  }
605  MEM_freeN(description);
606  }
607  }
608 
609  const char *info = RNA_struct_ui_description(ot->srna);
610  if (info && info[0]) {
611  return BLI_strdup(info);
612  }
613  return NULL;
614 }
615 
620  struct wmOperatorType *ot,
621  struct PointerRNA *properties)
622 {
623  char *text = WM_operatortype_description(C, ot, properties);
624  if (text == NULL) {
625  const char *text_orig = WM_operatortype_name(ot, properties);
626  if (text_orig != NULL) {
627  text = BLI_strdup(text_orig);
628  }
629  }
630  return text;
631 }
632 
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:725
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:699
void IDP_FreeProperty(struct IDProperty *prop)
Definition: idprop.c:1040
#define BLI_assert(a)
Definition: BLI_assert.h:58
void BLI_ghashIterator_step(GHashIterator *ghi)
Definition: BLI_ghash.c:1086
BLI_INLINE bool BLI_ghashIterator_done(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.h:158
BLI_INLINE void * BLI_ghashIterator_getValue(GHashIterator *ghi) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.h:150
void(* GHashValFreeFP)(void *val)
Definition: BLI_ghash.h:50
GHash * BLI_ghash_str_new_ex(const char *info, const unsigned int nentries_reserve) ATTR_MALLOC ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:900
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition: BLI_ghash.c:756
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:1008
void BLI_ghashIterator_init(GHashIterator *ghi, GHash *gh)
Definition: BLI_ghash.c:1065
void * BLI_ghash_lookup(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:803
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
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:547
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:133
void * BLI_findptr(const struct ListBase *listbase, const void *ptr, const 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:70
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
#define BLT_I18NCONTEXT_OPERATOR_DEFAULT
#define CLOG_ERROR(clg_ref,...)
Definition: CLG_log.h:204
#define CLOG_WARN(clg_ref,...)
Definition: CLG_log.h:203
#define CLOG_INFO(clg_ref, level,...)
Definition: CLG_log.h:201
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:1274
#define RNA_STRUCT_END
Definition: RNA_access.h:1294
StructRNA RNA_OperatorProperties
#define C
Definition: RandGen.cpp:39
#define WM_operatortype_prop_tag(property, tags)
Definition: WM_api.h:578
@ OPTYPE_MACRO
Definition: WM_types.h:158
@ OPTYPE_BLOCKING
Definition: WM_types.h:157
@ OPTYPE_GRAB_CURSOR_XY
Definition: WM_types.h:161
@ OPTYPE_GRAB_CURSOR_X
Definition: WM_types.h:163
@ OPTYPE_GRAB_CURSOR_Y
Definition: WM_types.h:165
@ WM_CURSOR_WRAP_X
Definition: WM_types.h:186
@ WM_CURSOR_WRAP_XY
Definition: WM_types.h:188
@ WM_CURSOR_WRAP_Y
Definition: WM_types.h:187
@ WM_CURSOR_WRAP_NONE
Definition: WM_types.h:185
@ OP_PROP_TAG_ADVANCED
Definition: WM_types.h:214
struct CLG_LogRef * WM_LOG_OPERATORS
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
Definition: btDbvt.cpp:299
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:45
static GPUContext * wrap(Context *ctx)
const char * RNA_struct_ui_description(const StructRNA *type)
Definition: rna_access.c:746
const char * RNA_struct_ui_name(const StructRNA *type)
Definition: rna_access.c:728
unsigned int RNA_struct_count_properties(StructRNA *srna)
Definition: rna_access.c:930
const char * RNA_struct_translation_context(const StructRNA *type)
Definition: rna_access.c:756
void RNA_def_struct_property_tags(StructRNA *srna, const EnumPropertyItem *prop_tag_defines)
Definition: rna_define.c:1162
void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description)
Definition: rna_define.c:1259
void RNA_def_struct_identifier(BlenderRNA *brna, StructRNA *srna, const char *identifier)
Definition: rna_define.c:1224
StructRNA * RNA_def_struct_ptr(BlenderRNA *brna, const char *identifier, StructRNA *srnafrom)
Definition: rna_define.c:919
PropertyRNA * RNA_def_pointer_runtime(StructOrFunctionRNA *cont_, const char *identifier, StructRNA *type, const char *ui_name, const char *ui_description)
Definition: rna_define.c:4175
void RNA_struct_free(BlenderRNA *brna, StructRNA *srna)
Definition: rna_define.c:795
void RNA_def_struct_translation_context(StructRNA *srna, const char *context)
Definition: rna_define.c:1272
BlenderRNA BLENDER_RNA
const EnumPropertyItem rna_enum_operator_property_tags[]
Definition: rna_wm.c:498
CLG_LogType * type
Definition: CLG_log.h:120
StructRNA * srna
Definition: RNA_types.h:681
void * first
Definition: DNA_listBase.h:47
int ymin
Definition: DNA_vec_types.h:80
int ymax
Definition: DNA_vec_types.h:80
int xmin
Definition: DNA_vec_types.h:79
int xmax
Definition: DNA_vec_types.h:79
wmEventHandler head
struct IDProperty * properties
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
int(* modal)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:768
struct IDProperty * last_properties
Definition: WM_types.h:805
const char * idname
Definition: WM_types.h:723
char *(* get_description)(struct bContext *C, struct wmOperatorType *, struct PointerRNA *)
Definition: WM_types.h:799
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
void(* cancel)(struct bContext *, struct wmOperator *)
Definition: WM_types.h:760
struct StructRNA * srna
Definition: WM_types.h:802
ExtensionRNA rna_ext
Definition: WM_types.h:826
const char * translation_context
Definition: WM_types.h:724
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
const char *(* get_name)(struct wmOperatorType *, struct PointerRNA *)
Definition: WM_types.h:793
ListBase macro
Definition: WM_types.h:817
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:246
void wm_event_free_handler(wmEventHandler *handler)
wmOperatorType * ot
Definition: wm_files.c:3156
void WM_keyconfig_update_operatortype(void)
Definition: wm_keymap.c:1752
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)
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)
void WM_operator_properties_alloc(PointerRNA **ptr, IDProperty **properties, const char *opstring)
Definition: wm_operators.c:605
void WM_operator_bl_idname(char *to, const char *from)
Definition: wm_operators.c:144
void WM_operator_properties_create_ptr(PointerRNA *ptr, wmOperatorType *ot)
Definition: wm_operators.c:584
void WM_operator_properties_clear(PointerRNA *ptr)
Definition: wm_operators.c:702
void WM_operator_properties_free(PointerRNA *ptr)
Definition: wm_operators.c:711
void WM_operator_properties_sanitize(PointerRNA *ptr, const bool no_context)
Definition: wm_operators.c:620