[Bf-blender-cvs] [d99b1ba] temp_widgets_c++_experiment: Cleanup: Move around enums & declarations, comments, ...
Julian Eisel
noreply at git.blender.org
Wed Dec 23 23:06:23 CET 2015
Commit: d99b1ba5d3c22b7f4fb37f7ac56d7eddb8173b0e
Author: Julian Eisel
Date: Wed Dec 23 22:16:11 2015 +0100
Branches: temp_widgets_c++_experiment
https://developer.blender.org/rBd99b1ba5d3c22b7f4fb37f7ac56d7eddb8173b0e
Cleanup: Move around enums & declarations, comments, ...
===================================================================
M source/blender/editors/interface/interface_intern.h
M source/blender/windowmanager/WM_api.h
M source/blender/windowmanager/intern/widgets/wm_widget.h
M source/blender/windowmanager/intern/widgets/wm_widgetgroup.cc
M source/blender/windowmanager/intern/widgets/wm_widgets_c_api.h
M source/blender/windowmanager/wm_event_types.h
===================================================================
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 0cfcbee..158497b 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -727,8 +727,4 @@ void UI_OT_eyedropper_color(struct wmOperatorType *ot);
void UI_OT_eyedropper_id(struct wmOperatorType *ot);
void UI_OT_eyedropper_depth(struct wmOperatorType *ot);
-
-/* interface_generic_widgets.c */
-void UI_OT_lamp_position(struct wmOperatorType *ot);
-
#endif /* __INTERFACE_INTERN_H__ */
diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h
index ece3ed4..61fe583 100644
--- a/source/blender/windowmanager/WM_api.h
+++ b/source/blender/windowmanager/WM_api.h
@@ -499,10 +499,10 @@ float WM_event_tablet_data(const struct wmEvent *event, int *pen_flip, flo
bool WM_event_is_tablet(const struct wmEvent *event);
-/* *************** Widget API ******************** */
+/* *************** Widget API *************** */
/* wmWidget->flag */
-enum widgetflags {
+enum {
/* states */
WM_WIDGET_HIGHLIGHT = (1 << 0),
WM_WIDGET_ACTIVE = (1 << 1),
@@ -516,28 +516,6 @@ enum widgetflags {
WM_WIDGET_SELECTABLE = (1 << 8),
};
-/**
- * \brief Widget tweak flag.
- * Bitflag passed to widget while tweaking.
- */
-enum {
- /* drag with extra precision (shift)
- * NOTE: Widgets are responsible for handling this (widget->handler callback)! */
- WM_WIDGET_TWEAK_PRECISE = (1 << 0),
-};
-
-void WM_widget_set_property(struct wmWidget *, int slot, struct PointerRNA *ptr, const char *propname);
-struct PointerRNA *WM_widget_set_operator(struct wmWidget *, const char *opname);
-void WM_widget_set_func_select(
- struct wmWidget *widget,
- void (*select)(struct bContext *, struct wmWidget *, const int action));
-void WM_widget_set_origin(struct wmWidget *widget, const float origin[3]);
-void WM_widget_set_offset(struct wmWidget *widget, const float offset[3]);
-void WM_widget_set_flag(struct wmWidget *widget, const int flag, const bool enable);
-void WM_widget_set_scale(struct wmWidget *widget, float scale);
-void WM_widget_set_line_width(struct wmWidget *widget, const float line_width);
-void WM_widget_set_colors(struct wmWidget *widget, const float col[4], const float col_hi[4]);
-
wmKeyMap *WM_widgetgroup_keymap_common(wmKeyConfig *config, const char *wgroupname);
/* wm_generic_widgets.c */
diff --git a/source/blender/windowmanager/intern/widgets/wm_widget.h b/source/blender/windowmanager/intern/widgets/wm_widget.h
index 2e16642..798e0e8 100644
--- a/source/blender/windowmanager/intern/widgets/wm_widget.h
+++ b/source/blender/windowmanager/intern/widgets/wm_widget.h
@@ -30,28 +30,6 @@
#ifndef __WM_WIDGET_H__
#define __WM_WIDGET_H__
-
-// Workaround until we can remove widgetflags from WM_api.h. We could also
-// simply include it, but would like to avoid that for various reasons.
-#ifndef __WM_API_H__
-
-/* wmWidget->flag */
-enum widgetflags {
- /* states */
- WM_WIDGET_HIGHLIGHT = (1 << 0),
- WM_WIDGET_ACTIVE = (1 << 1),
- WM_WIDGET_SELECTED = (1 << 2),
- /* settings */
- WM_WIDGET_DRAW_HOVER = (1 << 3),
- WM_WIDGET_DRAW_ACTIVE = (1 << 4), /* draw while dragging */
- WM_WIDGET_SCALE_3D = (1 << 5),
- WM_WIDGET_SCENE_DEPTH = (1 << 6), /* widget is depth culled with scene objects*/
- WM_WIDGET_HIDDEN = (1 << 7),
- WM_WIDGET_SELECTABLE = (1 << 8),
-};
-
-#endif // __WM_API_H__
-
#if 0
class wmWidget
{
diff --git a/source/blender/windowmanager/intern/widgets/wm_widgetgroup.cc b/source/blender/windowmanager/intern/widgets/wm_widgetgroup.cc
index 09b2ab3..cbe1857 100644
--- a/source/blender/windowmanager/intern/widgets/wm_widgetgroup.cc
+++ b/source/blender/windowmanager/intern/widgets/wm_widgetgroup.cc
@@ -40,6 +40,7 @@
#include "RNA_types.h"
#include "BPY_extern.h"
+#include "WM_api.h"
#include "wm.h" // tmp
#include "wm_widget.h"
diff --git a/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.h b/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.h
index 2fda017..7d761f5 100644
--- a/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.h
+++ b/source/blender/windowmanager/intern/widgets/wm_widgets_c_api.h
@@ -100,6 +100,17 @@ wmOperator *WM_widgetgrouptype_operator_get(struct wmWidgetGroupType *wgrouptype
wmKeyMap *WM_widgetgrouptype_user_keymap_get(struct wmWidgetGroupType *wgrouptype);
bool wm_widget_register(struct wmWidgetGroup *wgroup, struct wmWidget *widget, const char *name);
+void WM_widget_set_property(struct wmWidget *, int slot, struct PointerRNA *ptr, const char *propname);
+struct PointerRNA *WM_widget_set_operator(struct wmWidget *, const char *opname);
+void WM_widget_set_func_select(
+ struct wmWidget *widget,
+ void (*select)(struct bContext *, struct wmWidget *, const int action));
+void WM_widget_set_origin(struct wmWidget *widget, const float origin[3]);
+void WM_widget_set_offset(struct wmWidget *widget, const float offset[3]);
+void WM_widget_set_flag(struct wmWidget *widget, const int flag, const bool enable);
+void WM_widget_set_scale(struct wmWidget *widget, float scale);
+void WM_widget_set_line_width(struct wmWidget *widget, const float line_width);
+void WM_widget_set_colors(struct wmWidget *widget, const float col[4], const float col_hi[4]);
void fix_linking_widget_lib(void);
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index 0aa0922..80b05bb 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -444,6 +444,9 @@ enum {
GESTURE_MODAL_CIRCLE_SIZE = 11, /* circle sel: size brush (for trackpad event) */
};
+
+/* ********** widget stuff ********** */
+
enum {
WIDGET_TWEAK_MODAL_CANCEL = 1,
WIDGET_TWEAK_MODAL_CONFIRM,
@@ -451,6 +454,16 @@ enum {
WIDGET_TWEAK_MODAL_PRECISION_OFF,
};
+/**
+ * \brief Widget tweak flag.
+ * Bitflag passed to widget while tweaking.
+ */
+enum {
+ /* drag with extra precision (shift)
+ * NOTE: Widgets are responsible for handling this (widget->handler callback)! */
+ WM_WIDGET_TWEAK_PRECISE = (1 << 0),
+};
+
#endif /* __WM_EVENT_TYPES_H__ */
More information about the Bf-blender-cvs
mailing list