Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-16 23:03:28 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-16 23:03:28 +0300
commitc1379f6613d327a7604700007afd52e36f48080a (patch)
treedff5af25582f4e343b7c0a7399d760c9dff4d54a /source/blender/windowmanager
parent962870b2358775ebef96198da4efe61a4224b526 (diff)
UI:
* Added support for defining properties for operator buttons, with uiButGetOperatorPtrRNA. Needed to cleanup a hack that was there for operator properties in RNA, now a separate OperatorProperties type is used for storing operator properties, instead of being part of the Operator type itself. * Allow selecting menu items with mouse release instead of press again. * Fix some cases with hanging tooltips in the UI.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/WM_api.h3
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c12
-rw-r--r--source/blender/windowmanager/intern/wm_keymap.c2
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c2
4 files changed, 10 insertions, 9 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index a2b5049b8b5..ded0cb854b9 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -32,6 +32,7 @@
#include "DNA_windowmanager_types.h"
struct bContext;
+struct IDProperty;
struct wmEvent;
struct wmEventHandler;
struct wmGesture;
@@ -112,7 +113,7 @@ int WM_operator_winactive (struct bContext *C);
wmOperatorType *WM_operatortype_find(const char *idname);
void WM_operatortype_append (void (*opfunc)(wmOperatorType*));
-int WM_operator_call (struct bContext *C, const char *opstring, int context);
+int WM_operator_call (struct bContext *C, const char *opstring, int context, struct IDProperty *properties);
/* default operator callbacks for border/lasso */
int WM_border_select_invoke (struct bContext *C, wmOperator *op, struct wmEvent *event);
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 7bfda3437a9..74f3fd33f29 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -295,7 +295,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, I
BLI_strncpy(op->idname, ot->idname, OP_MAX_TYPENAME);
op->ptr= MEM_callocN(sizeof(PointerRNA), "wmOperatorPtrRNA");
- RNA_pointer_create(&RNA_WindowManager, &C->wm->id, ot->srna, op, op->ptr);
+ RNA_pointer_create(&RNA_WindowManager, &C->wm->id, ot->srna, &op->properties, op->ptr);
if(op->type->invoke)
retval= (*op->type->invoke)(C, op, event);
@@ -314,7 +314,7 @@ static int wm_operator_invoke(bContext *C, wmOperatorType *ot, wmEvent *event, I
}
/* invokes operator in context */
-int WM_operator_call(bContext *C, const char *opstring, int context)
+int WM_operator_call(bContext *C, const char *opstring, int context, IDProperty *properties)
{
wmOperatorType *ot= WM_operatortype_find(opstring);
int retval;
@@ -334,7 +334,7 @@ int WM_operator_call(bContext *C, const char *opstring, int context)
C->region= ar1;
}
- retval= wm_operator_invoke(C, ot, C->window->eventstate, NULL);
+ retval= wm_operator_invoke(C, ot, C->window->eventstate, properties);
/* set region back */
C->region= ar;
@@ -346,7 +346,7 @@ int WM_operator_call(bContext *C, const char *opstring, int context)
ARegion *ar= C->region;
C->region= NULL;
- retval= wm_operator_invoke(C, ot, C->window->eventstate, NULL);
+ retval= wm_operator_invoke(C, ot, C->window->eventstate, properties);
C->region= ar;
return retval;
@@ -358,14 +358,14 @@ int WM_operator_call(bContext *C, const char *opstring, int context)
C->region= NULL;
C->area= NULL;
- retval= wm_operator_invoke(C, ot, C->window->eventstate, NULL);
+ retval= wm_operator_invoke(C, ot, C->window->eventstate, properties);
C->region= ar;
C->area= area;
return retval;
}
else
- return wm_operator_invoke(C, ot, C->window->eventstate, NULL);
+ return wm_operator_invoke(C, ot, C->window->eventstate, properties);
}
return 0;
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c
index 9a231148c36..139fff45b48 100644
--- a/source/blender/windowmanager/intern/wm_keymap.c
+++ b/source/blender/windowmanager/intern/wm_keymap.c
@@ -84,7 +84,7 @@ static void keymap_properties_set(wmKeymapItem *kmi)
if(ot) {
kmi->ptr= MEM_callocN(sizeof(PointerRNA), "wmKeymapItemPtr");
- RNA_pointer_create(NULL, NULL, ot->srna, kmi, kmi->ptr);
+ RNA_pointer_create(NULL, NULL, ot->srna, &kmi->properties, kmi->ptr);
}
}
}
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index a7b54289616..e87451c2a8e 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -80,7 +80,7 @@ void WM_operatortype_append(void (*opfunc)(wmOperatorType*))
wmOperatorType *ot;
ot= MEM_callocN(sizeof(wmOperatorType), "operatortype");
- ot->srna= RNA_def_struct(&BLENDER_RNA, "", "Operator", "");
+ ot->srna= RNA_def_struct(&BLENDER_RNA, "", "OperatorProperties", "");
opfunc(ot);
RNA_def_struct_identifier(ot->srna, ot->idname, ot->name);
BLI_addtail(&global_ops, ot);