diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2014-10-07 19:32:41 +0400 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2014-10-07 21:09:45 +0400 |
commit | b9b0495de9a0861cfb710a93d802cb660229001f (patch) | |
tree | b23c824035a485b8ffc5e30aa816fccd77c6e3a2 /source/blender/windowmanager/WM_api.h | |
parent | 6f0602ca17a3cbe361b219f88c7ec85a1c036916 (diff) |
WIP redesign of the system. Nothing functional (not even manipulator).
There is first code for display of an arrow widget. The manipulator will
use those when they are ready.
Basically the manipulator is now a WidgetGroup. WidgetGroups are a new entity and
they manage a group of related widgets. They should be responsible for state update,
drawing and polling of their widgets and can be bound to specific rules.
There is a big design plan on a whiteboard beside me, it will take a few
big commits still to take shape though. One thing at a time, I am first making
reusable arrow widgets that will allow us replace the translate widgets properly.
There are a few reusable widgets planned, more to come later.
Diffstat (limited to 'source/blender/windowmanager/WM_api.h')
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index e93c1f9ae5f..a5fcf9eaaa2 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -56,6 +56,7 @@ struct wmNotifier; struct wmOperatorType; struct wmOperator; struct wmWidget; +struct wmWidgetGroup; struct wmWidgetMap; struct rcti; struct PointerRNA; @@ -462,18 +463,23 @@ bool WM_event_is_tablet(const struct wmEvent *event); /* widget API */ -struct wmWidget *WM_widget_new(bool (*poll)(const struct bContext *, struct wmWidget *), - void (*draw)(const struct bContext *, struct wmWidget *), +struct wmWidgetGroup *WM_widgetgroup_new(bool (*poll)(struct wmWidgetGroup *, const struct bContext *), + void (*update)(struct wmWidgetGroup *, const struct bContext *)); + +struct wmWidget *WM_widget_new(void (*draw)(struct wmWidget *, const struct bContext *), void (*render_3d_intersection)(const struct bContext *, struct wmWidget *, int), int (*intersect)(struct bContext *C, const struct wmEvent *event, struct wmWidget *customdata), - int (*handler)(struct bContext *, const struct wmEvent *, struct wmWidget *, int active), + int (*handler)(struct bContext *, const struct wmEvent *, struct wmWidget *), void *customdata, bool free_data); void WM_widgets_draw(const struct bContext *C, struct ARegion *ar); void WM_event_add_widget_handler(struct ARegion *ar); -bool WM_widget_register(struct wmWidgetMap *wmap, struct wmWidget *widget); -void WM_widget_unregister(struct wmWidgetMap *wmap, struct wmWidget *widget); +bool WM_widget_register(struct wmWidgetGroup *wgroup, struct wmWidget *widget); +void WM_widget_unregister(struct wmWidgetGroup *wgroup, struct wmWidget *widget); + +bool WM_widgetgroup_register(struct wmWidgetMap *wmap, struct wmWidgetGroup *wgroup); +void WM_widgetgroup_unregister(struct wmWidgetMap *wmap, struct wmWidgetGroup *wgroup); struct wmWidgetMap *WM_widgetmap_find(const char *idname, int spaceid, int regionid, bool is_3d); void WM_widgetmaps_free(void); |