Example #1
0
wmDropBox *WM_dropbox_add(ListBase *lb, const char *idname, int (*poll)(bContext *, wmDrag *, wmEvent *),
						  void (*copy)(wmDrag *, wmDropBox *))
{
	wmDropBox *drop= MEM_callocN(sizeof(wmDropBox), "wmDropBox");
	
	drop->poll= poll;
	drop->copy= copy;
	drop->ot= WM_operatortype_find(idname, 0);
	drop->opcontext= WM_OP_INVOKE_DEFAULT;
	
	if(drop->ot==NULL) {
		MEM_freeN(drop);
		printf("Error: dropbox with unknown operator: %s\n", idname);
		return NULL;
	}
	WM_operator_properties_alloc(&(drop->ptr), &(drop->properties), idname);
	
	BLI_addtail(lb, drop);
	
	return drop;
}
Example #2
0
static void wm_keymap_item_properties_set(wmKeyMapItem *kmi)
{
	WM_operator_properties_alloc(&(kmi->ptr), &(kmi->properties), kmi->idname);
	WM_operator_properties_sanitize(kmi->ptr, 1);
}