openbox/otk/widget.hh

58 lines
1.3 KiB
C++
Raw Normal View History

#ifndef __widget_hh
#define __widget_hh
2002-12-04 13:07:40 +00:00
#include "basewidget.hh"
2002-11-10 13:33:34 +00:00
extern "C" {
#include <assert.h>
}
2002-11-10 13:33:34 +00:00
namespace otk {
class OtkWidget : public OtkBaseWidget {
2002-11-10 13:33:34 +00:00
public:
enum Direction { Horizontal, Vertical };
OtkWidget(OtkWidget *parent, Direction = Horizontal);
OtkWidget(OtkEventDispatcher *event_dispatcher, Style *style,
Direction direction = Horizontal, Cursor cursor = 0,
int bevel_width = 1);
2002-11-10 13:33:34 +00:00
virtual ~OtkWidget();
2002-11-14 11:42:38 +00:00
virtual void update(void);
inline bool isStretchableHorz(void) const { return _stretchable_horz; }
void setStretchableHorz(bool s_horz = true) { _stretchable_horz = s_horz; }
2002-11-10 13:33:34 +00:00
inline bool isStretchableVert(void) const { return _stretchable_vert; }
void setStretchableVert(bool s_vert = true) { _stretchable_vert = s_vert; }
2002-11-10 13:33:34 +00:00
inline Direction getDirection(void) const { return _direction; }
void setDirection(Direction dir) { _direction = dir; }
inline OtkEventDispatcher *getEventDispatcher(void)
{ return _event_dispatcher; }
void setEventDispatcher(OtkEventDispatcher *disp);
2002-11-10 13:33:34 +00:00
private:
void adjust(void);
void adjustHorz(void);
void adjustVert(void);
void internalResize(int width, int height);
Direction _direction;
2002-11-10 13:33:34 +00:00
bool _stretchable_vert;
bool _stretchable_horz;
OtkEventDispatcher *_event_dispatcher;
2002-11-10 13:33:34 +00:00
};
}
#endif // __widget_hh