Renamed enums in osgWidget from ALLCAPITALS to normal OSG conventional of AllCapital

This commit is contained in:
Robert Osfield
2008-07-25 20:50:42 +00:00
parent eed365aef4
commit 5cac386fa6
12 changed files with 192 additions and 192 deletions

View File

@@ -29,7 +29,7 @@ class WindowManager;
class Window;
class Widget;
enum EVENT_TYPE
enum EventType
{
EVENT_NONE = 0x0000,
EVENT_FOCUS = 0x0001,
@@ -48,7 +48,7 @@ enum EVENT_TYPE
// Helpful wrapper around using the raw types, since it often doesn't make sense to
// use some without the others.
enum EVENT_MASK
enum EventMask
{
EVENT_MASK_FOCUS = EVENT_FOCUS | EVENT_UNFOCUS,
EVENT_MASK_MOUSE_MOVE = EVENT_MOUSE_ENTER | EVENT_MOUSE_OVER | EVENT_MOUSE_LEAVE,
@@ -60,13 +60,13 @@ enum EVENT_MASK
class OSGWIDGET_EXPORT Event
{
public:
EVENT_TYPE type;
EventType type;
double x;
double y;
int key;
int keyMask;
Event(WindowManager* wm, EVENT_TYPE _type = EVENT_NONE):
Event(WindowManager* wm, EventType _type = EVENT_NONE):
_wm (wm),
_window (0),
_widget (0),
@@ -78,13 +78,13 @@ class OSGWIDGET_EXPORT Event
keyMask (-1) {
}
Event& makeType(EVENT_TYPE _type) {
Event& makeType(EventType _type) {
if(_type != EVENT_NONE) type = _type;
return *this;
}
Event& makeMouse(double _x, double _y, EVENT_TYPE _type = EVENT_NONE) {
Event& makeMouse(double _x, double _y, EventType _type = EVENT_NONE) {
x = _x;
y = _y;
@@ -93,7 +93,7 @@ class OSGWIDGET_EXPORT Event
return *this;
}
Event& makeKey(int _key, int _keyMask, EVENT_TYPE _type = EVENT_NONE) {
Event& makeKey(int _key, int _keyMask, EventType _type = EVENT_NONE) {
key = _key;
keyMask = _keyMask;
@@ -208,7 +208,7 @@ class OSGWIDGET_EXPORT Callback
public:
// Creates a Callback that is bound to a member function.
template<typename T>
Callback(bool (T::*function)(Event&), T* obj, EVENT_TYPE type, void* data=0):
Callback(bool (T::*function)(Event&), T* obj, EventType type, void* data=0):
_type (type),
_data (data),
_callback (new ObjectCallback<T>(function, obj)) {
@@ -216,7 +216,7 @@ class OSGWIDGET_EXPORT Callback
// Creates a Callback that is bound to a functor pointer.
template<typename T>
Callback(T* functor, EVENT_TYPE type, void* data=0):
Callback(T* functor, EventType type, void* data=0):
_type (type),
_data (data),
_callback (new FunctionCallback<T>(functor)) {
@@ -226,7 +226,7 @@ class OSGWIDGET_EXPORT Callback
return (*_callback)(ev);
}
EVENT_TYPE getType() const {
EventType getType() const {
return _type;
}
@@ -238,7 +238,7 @@ class OSGWIDGET_EXPORT Callback
return _data;
}
protected:
EVENT_TYPE _type;
EventType _type;
void* _data;
// We use a ref_ptr here so that we don't have to worry about memory.

View File

@@ -57,10 +57,10 @@ class OSGWIDGET_EXPORT Style: public osg::Object
return _style;
}
static Widget::LAYER strToLayer (const std::string&);
static Widget::VERTICAL_ALIGNMENT strToVAlign (const std::string&);
static Widget::HORIZONTAL_ALIGNMENT strToHAlign (const std::string&);
static Widget::COORDINATE_MODE strToCoordMode (const std::string&);
static Widget::Layer strToLayer (const std::string&);
static Widget::VerticalAlignment strToVAlign (const std::string&);
static Widget::HorizontalAlignment strToHAlign (const std::string&);
static Widget::CoordinateMode strToCoordMode (const std::string&);
static bool strToFill (const std::string&);
protected:

View File

@@ -35,7 +35,7 @@ class WindowManager;
// or relative).
class OSGWIDGET_EXPORT Widget: public osg::Geometry, public EventInterface, public StyleInterface {
public:
enum POINT {
enum Corner {
LOWER_LEFT = 0,
LOWER_RIGHT = 1,
UPPER_RIGHT = 2,
@@ -44,10 +44,10 @@ public:
LR = LOWER_RIGHT,
UR = UPPER_RIGHT,
UL = UPPER_LEFT,
ALL_POINTS = 4
ALL_CORNERS = 4
};
enum LAYER {
enum Layer {
LAYER_TOP = 20,
LAYER_HIGH = 15,
LAYER_MIDDLE = 10,
@@ -55,19 +55,19 @@ public:
LAYER_BG = 0
};
enum VERTICAL_ALIGNMENT {
enum VerticalAlignment {
VA_CENTER,
VA_TOP,
VA_BOTTOM
};
enum HORIZONTAL_ALIGNMENT {
enum HorizontalAlignment {
HA_CENTER,
HA_LEFT,
HA_RIGHT
};
enum COORDINATE_MODE {
enum CoordinateMode {
CM_ABSOLUTE,
CM_RELATIVE
};
@@ -116,9 +116,9 @@ public:
);
void setPadding (point_type);
void setColor (color_type, color_type, color_type, color_type, POINT = ALL_POINTS);
void addColor (color_type, color_type, color_type, color_type, POINT = ALL_POINTS);
void setTexCoord (texcoord_type, texcoord_type, POINT = ALL_POINTS);
void setColor (color_type, color_type, color_type, color_type, Corner = ALL_CORNERS);
void addColor (color_type, color_type, color_type, color_type, Corner = ALL_CORNERS);
void setTexCoord (texcoord_type, texcoord_type, Corner = ALL_CORNERS);
// These are additional texture coordinate setting methods.
// This method will use a given origin as the LOWER_LEFT point and texture the
@@ -147,11 +147,11 @@ public:
point_type getPadHorizontal () const;
point_type getPadVertical () const;
const Point& getPoint (POINT = ALL_POINTS) const;
const Color& getColor (POINT = ALL_POINTS) const;
const TexCoord& getTexCoord (POINT = ALL_POINTS) const;
const Point& getPoint (Corner = ALL_CORNERS) const;
const Color& getColor (Corner = ALL_CORNERS) const;
const TexCoord& getTexCoord (Corner = ALL_CORNERS) const;
POINT convertPoint (POINT) const;
Corner convertCorner (Corner) const;
Color getImageColorAtXY (point_type x, point_type y) const;
XYCoord localXY (double, double) const;
@@ -206,11 +206,11 @@ public:
setSize(xy.x(), xy.y());
}
void setColor(const Color& col, POINT p = ALL_POINTS) {
void setColor(const Color& col, Corner p = ALL_CORNERS) {
setColor(col.r(), col.g(), col.b(), col.a(), p);
}
void setTexCoord(const XYCoord& xy, POINT p = ALL_POINTS) {
void setTexCoord(const XYCoord& xy, Corner p = ALL_CORNERS) {
setTexCoord(xy.x(), xy.y(), p);
}
@@ -218,7 +218,7 @@ public:
setTexCoordRegion(xy.x(), xy.y(), w, h);
}
void addColor(const Color& col, POINT p = ALL_POINTS) {
void addColor(const Color& col, Corner p = ALL_CORNERS) {
addColor(col.r(), col.g(), col.b(), col.a(), p);
}
@@ -240,7 +240,7 @@ public:
}
// TODO: Refine this...
void setLayer(LAYER l, unsigned int offset = 0) {
void setLayer(Layer l, unsigned int offset = 0) {
_layer = l + offset;
}
@@ -260,15 +260,15 @@ public:
_padBottom = p;
}
void setAlignHorizontal(HORIZONTAL_ALIGNMENT h) {
void setAlignHorizontal(HorizontalAlignment h) {
_halign = h;
}
void setAlignVertical(VERTICAL_ALIGNMENT v) {
void setAlignVertical(VerticalAlignment v) {
_valign = v;
}
void setCoordinateMode(COORDINATE_MODE cm) {
void setCoordinateMode(CoordinateMode cm) {
_coordMode = cm;
}
@@ -340,15 +340,15 @@ public:
return _padBottom;
}
HORIZONTAL_ALIGNMENT getAlignHorizontal() const {
HorizontalAlignment getAlignHorizontal() const {
return _halign;
}
VERTICAL_ALIGNMENT getAlignVertical() const {
VerticalAlignment getAlignVertical() const {
return _valign;
}
COORDINATE_MODE getCoordinateMode() const {
CoordinateMode getCoordinateMode() const {
return _coordMode;
}
@@ -461,11 +461,11 @@ public:
point_type _padBottom;
// The alignments are used in conjuction when the widget is NOT set to fill.
VERTICAL_ALIGNMENT _valign;
HORIZONTAL_ALIGNMENT _halign;
VerticalAlignment _valign;
HorizontalAlignment _halign;
// This flag determines how sizing values are interpretted by setDimensions().
COORDINATE_MODE _coordMode;
CoordinateMode _coordMode;
// These are the relative values, which are not stored directly in our verts
// array but kept around for calculation later.

View File

@@ -88,18 +88,18 @@ class OSGWIDGET_EXPORT Window:
// These correspond to special regions honored by the WindowManager. Most Windows
// will want to be NONE, unless they need to exist in the foreground or background
// for some reason.
enum STRATA {
enum Strata {
STRATA_NONE,
STRATA_BACKGROUND,
STRATA_FOREGROUND
};
// If you only want to display a portion of a Window (such as when it is embedded),
// you will need to set the VISIBILITY_MODE to WM_PARTIAL. Otherwise, the entire
// you will need to set the VisibilityMode to WM_PARTIAL. Otherwise, the entire
// Window is visible by default. The final enum, VM_ENTIRE, says that no Scissoring
// should take place at all, and is useful in cases where you want to properly
// scale or rotate Windows.
enum VISIBILITY_MODE {
enum VisibilityMode {
VM_FULL,
VM_PARTIAL,
VM_ENTIRE
@@ -109,14 +109,14 @@ class OSGWIDGET_EXPORT Window:
// call to Window::update() that allow us to position a Window somewhere relative
// to the WindowManger's viewable area. However, unlike the ALIGNMENT enums, these
// are totally optional (whereas a Widget must always have some ALIGNMENT value set.
enum VERTICAL_ANCHOR {
enum VerticalAnchor {
VA_NONE,
VA_CENTER,
VA_TOP,
VA_BOTTOM
};
enum HORIZONTAL_ANCHOR {
enum HorizontalAnchor {
HA_NONE,
HA_CENTER,
HA_LEFT,
@@ -256,11 +256,11 @@ class OSGWIDGET_EXPORT Window:
return _height.min;
}
VERTICAL_ANCHOR getAnchorVertical() const {
VerticalAnchor getAnchorVertical() const {
return _vAnchor;
}
HORIZONTAL_ANCHOR getAnchorHorizontal() const {
HorizontalAnchor getAnchorHorizontal() const {
return _hAnchor;
}
@@ -280,7 +280,7 @@ class OSGWIDGET_EXPORT Window:
return _zRange;
}
STRATA getStrata() const {
Strata getStrata() const {
return _strata;
}
@@ -288,7 +288,7 @@ class OSGWIDGET_EXPORT Window:
return _visibleArea;
}
VISIBILITY_MODE getVisibilityMode() const {
VisibilityMode getVisibilityMode() const {
return _vis;
}
@@ -343,19 +343,19 @@ class OSGWIDGET_EXPORT Window:
_scaleDenom = sd;
}
void setAnchorVertical(VERTICAL_ANCHOR va) {
void setAnchorVertical(VerticalAnchor va) {
_vAnchor = va;
}
void setAnchorHorizontal(HORIZONTAL_ANCHOR ha) {
void setAnchorHorizontal(HorizontalAnchor ha) {
_hAnchor = ha;
}
void setStrata(STRATA s) {
void setStrata(Strata s) {
_strata = s;
}
void setVisibilityMode(VISIBILITY_MODE v) {
void setVisibilityMode(VisibilityMode v) {
_vis = v;
}
@@ -429,11 +429,11 @@ class OSGWIDGET_EXPORT Window:
// This is a special value that can be used to "force" a Window not to be
// focusable and instead always exist in the foreground or background.
STRATA _strata;
Strata _strata;
// A flag determining whether our visible area is the full Window or rather
// a portion of the Window.
VISIBILITY_MODE _vis;
VisibilityMode _vis;
// A rotation value in degrees.
matrix_type _r;
@@ -446,8 +446,8 @@ class OSGWIDGET_EXPORT Window:
Sizes _width;
Sizes _height;
VERTICAL_ANCHOR _vAnchor;
HORIZONTAL_ANCHOR _hAnchor;
VerticalAnchor _vAnchor;
HorizontalAnchor _hAnchor;
// Not all windows have widgets that can focus, but if they do this should
// be a pointer to it.

View File

@@ -39,7 +39,7 @@ typedef osgUtil::LineSegmentIntersector::Intersections Intersections;
// and performs keyboard input on the currently focused Window->Widget.
class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<Window> {
public:
enum WM_FLAGS {
enum WmFlags {
WM_USE_LUA = 0x00000001,
WM_USE_PYTHON = 0x00000002,
WM_PICK_DEBUG = 0x00000004,
@@ -47,7 +47,7 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<
WM_NO_BETA_WARN = 0x00000010
};
enum POINTER_DIRECTION {
enum PointerDirection {
PD_NONE = 0x00000000,
PD_LEFT = 0x00000001,
PD_RIGHT = 0x00000002,
@@ -55,7 +55,7 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<
PD_DOWN = 0x00000008
};
enum POINTER_FOCUS_MODE {
enum PointerFocusMode {
PFM_FOCUS = 0x00000000,
PFM_UNFOCUS = 0x00000001,
PFM_SLOPPY = 0x00000002
@@ -157,15 +157,15 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<
return _styleManager.get();
}
POINTER_DIRECTION getPointerVerticalDirection() const {
PointerDirection getPointerVerticalDirection() const {
return _lastVertical;
}
POINTER_DIRECTION getPointerHorizontalDirection() const {
PointerDirection getPointerHorizontalDirection() const {
return _lastHorizontal;
}
POINTER_FOCUS_MODE getPointerFocusMode() const {
PointerFocusMode getPointerFocusMode() const {
return _focusMode;
}
@@ -225,7 +225,7 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<
_scrolling = sm;
}
void setPointerFocusMode(POINTER_FOCUS_MODE pfm) {
void setPointerFocusMode(PointerFocusMode pfm) {
_focusMode = pfm;
}
@@ -295,9 +295,9 @@ class OSGWIDGET_EXPORT WindowManager: public osg::Switch, public UIObjectParent<
float _lastY;
EventInterface* _lastEvent;
EventInterface* _lastPush;
POINTER_DIRECTION _lastVertical;
POINTER_DIRECTION _lastHorizontal;
POINTER_FOCUS_MODE _focusMode;
PointerDirection _lastVertical;
PointerDirection _lastHorizontal;
PointerFocusMode _focusMode;
bool _leftDown;
bool _middleDown;
bool _rightDown;