2008-04-24 11:07:47 -07:00
|
|
|
#ifndef WIDGET_H_
|
|
|
|
#define WIDGET_H_
|
|
|
|
|
2008-05-06 09:34:34 -07:00
|
|
|
// TODO: Make this cross platform (MSVC)
|
|
|
|
#include <stdint.h>
|
2008-07-02 16:18:32 -07:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <assert.h>
|
2008-05-06 09:34:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
#include <cairo.h>
|
|
|
|
|
2008-07-31 12:30:36 -07:00
|
|
|
#ifdef __APPLE__
|
|
|
|
# include <OpenGL/gl.h>
|
|
|
|
# include <OpenGL/glu.h>
|
|
|
|
#else
|
|
|
|
# include <GL/gl.h>
|
|
|
|
# include <GL/glu.h>
|
|
|
|
#endif
|
2008-07-18 15:21:54 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
#include "vector.h"
|
|
|
|
#include "geom.h"
|
|
|
|
|
2008-07-09 08:46:46 -07:00
|
|
|
#include "keycode.h"
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
2008-06-22 16:28:34 -07:00
|
|
|
* Forward declarations
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
2008-06-23 05:18:19 -07:00
|
|
|
typedef struct _classInfo classInfo;
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
typedef struct _widget widget;
|
|
|
|
typedef struct _widgetVtbl widgetVtbl;
|
|
|
|
|
2008-06-22 16:28:34 -07:00
|
|
|
typedef struct _event event;
|
|
|
|
typedef struct _eventMouse eventMouse;
|
|
|
|
typedef struct _eventMouseBtn eventMouseBtn;
|
|
|
|
typedef struct _eventKey eventKey;
|
2008-07-09 08:46:46 -07:00
|
|
|
typedef struct _eventText eventText;
|
2008-07-15 03:12:03 -07:00
|
|
|
typedef struct _eventTimer eventTimer;
|
2008-06-22 16:28:34 -07:00
|
|
|
typedef struct _eventMisc eventMisc;
|
2008-04-24 11:07:47 -07:00
|
|
|
|
2008-08-11 12:03:48 -07:00
|
|
|
/**
|
|
|
|
* Function signature for event handler callbacks. All callback functions must
|
|
|
|
* be of this form.
|
|
|
|
*
|
|
|
|
* @param self The widget that received/handled the event.
|
|
|
|
* @param evt A pointer to the event structure. Depending on the value of
|
|
|
|
* evt->type it may be necessary to cast this to derived event
|
|
|
|
* structure (e.g., evtMouse or evtMisc).
|
|
|
|
*
|
|
|
|
* All callback functions must be able to handle EVT_DESTRUCT
|
|
|
|
* events, which are generated when either self is destroyed or the
|
|
|
|
* event handler removed (widgetRemoveEventHandler). This allows
|
|
|
|
* for the callback to free any memory which it has allocated/is
|
|
|
|
* responsible for (e.g. userData).
|
|
|
|
* @param handlerId The (unique) id of this event handler. This can be used to:
|
|
|
|
* - Remove the event handler from the widgets event table;
|
|
|
|
* which can be done by calling widgetRemoveEventHandler. It
|
|
|
|
* is important to note that this will immediately generate
|
|
|
|
* an EVT_DESTRUCT event and dispatch it.
|
|
|
|
* - Set the *userData pointer by using
|
|
|
|
* widgetSetEventHandlerUserData.
|
|
|
|
* @param userData The user-data associated with the callback; this is stored
|
|
|
|
* and passed verbatim.
|
|
|
|
* @return True if the callback executed without error, otherwise false.
|
|
|
|
*/
|
|
|
|
typedef bool (*callback) (widget *self, const event *evt, int handlerId,
|
2008-07-13 08:40:58 -07:00
|
|
|
void *userData);
|
2008-04-24 11:07:47 -07:00
|
|
|
|
|
|
|
typedef struct _eventTableEntry eventTableEntry;
|
|
|
|
|
2008-06-23 05:18:19 -07:00
|
|
|
/*
|
|
|
|
* Information about the `type' (class) of a widget
|
|
|
|
*/
|
|
|
|
struct _classInfo
|
|
|
|
{
|
2008-06-24 03:11:03 -07:00
|
|
|
const struct _classInfo *parentType;
|
2008-06-23 05:18:19 -07:00
|
|
|
const char *ourType;
|
|
|
|
};
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* The valid event types
|
|
|
|
*/
|
2008-08-01 02:15:43 -07:00
|
|
|
typedef enum
|
2008-04-24 11:07:47 -07:00
|
|
|
{
|
|
|
|
// Mouse events
|
|
|
|
EVT_MOUSE_DOWN,
|
|
|
|
EVT_MOUSE_UP,
|
|
|
|
EVT_MOUSE_CLICK,
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
EVT_MOUSE_ENTER,
|
|
|
|
EVT_MOUSE_MOVE,
|
|
|
|
EVT_MOUSE_LEAVE,
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
// Keyboard events
|
|
|
|
EVT_KEY_DOWN,
|
|
|
|
EVT_KEY_UP,
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-09 08:46:46 -07:00
|
|
|
// Text input events
|
|
|
|
EVT_TEXT,
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-08-12 06:00:40 -07:00
|
|
|
// Drag events
|
|
|
|
EVT_DRAG_BEGIN,
|
|
|
|
EVT_DRAG_TRACK,
|
|
|
|
EVT_DRAG_END,
|
|
|
|
|
2008-07-15 03:12:03 -07:00
|
|
|
// Timer events
|
|
|
|
EVT_TIMER,
|
|
|
|
EVT_TIMER_SINGLE_SHOT,
|
|
|
|
EVT_TIMER_PERSISTENT,
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
// Misc
|
|
|
|
EVT_FOCUS,
|
2008-08-02 15:56:14 -07:00
|
|
|
EVT_BLUR,
|
|
|
|
|
|
|
|
EVT_DESTRUCT
|
2008-08-01 02:15:43 -07:00
|
|
|
} eventType;
|
2008-04-24 11:07:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* The possible mouse states as understood by the events system
|
|
|
|
*/
|
2008-08-01 02:15:43 -07:00
|
|
|
typedef enum
|
2008-04-24 11:07:47 -07:00
|
|
|
{
|
|
|
|
BUTTON_LEFT,
|
|
|
|
BUTTON_RIGHT,
|
2008-04-25 16:20:16 -07:00
|
|
|
BUTTON_WHEEL_UP,
|
2008-04-26 03:52:41 -07:00
|
|
|
BUTTON_WHEEL_DOWN,
|
2008-04-24 11:07:47 -07:00
|
|
|
BUTTON_OTHER
|
2008-08-01 02:15:43 -07:00
|
|
|
} mouseButton;
|
2008-04-24 11:07:47 -07:00
|
|
|
|
2008-08-12 06:00:40 -07:00
|
|
|
/*
|
|
|
|
* Possible drag states
|
|
|
|
*/
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
/// No active drag
|
|
|
|
DRAG_NONE,
|
|
|
|
|
|
|
|
/// Drag offer pending acceptance/declination
|
|
|
|
DRAG_PENDING,
|
|
|
|
|
|
|
|
/// Offer was accepted
|
|
|
|
DRAG_ACCEPTED,
|
|
|
|
|
|
|
|
/// Offer was declined
|
|
|
|
DRAG_DECLINED,
|
|
|
|
|
|
|
|
/// Drag is currently active
|
|
|
|
DRAG_ACTIVE
|
|
|
|
} dragStates;
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* Event structures
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The 'base' event structure. All events can be cast to this
|
|
|
|
*/
|
|
|
|
struct _event
|
|
|
|
{
|
|
|
|
// The time at which the event took place
|
|
|
|
int time;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
// The type of the event
|
|
|
|
eventType type;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The event structure used for mouse motion events
|
|
|
|
*/
|
|
|
|
struct _eventMouse
|
|
|
|
{
|
|
|
|
event event;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-08-11 10:18:26 -07:00
|
|
|
// Location of the mouse
|
2008-04-24 11:07:47 -07:00
|
|
|
point loc;
|
2008-08-11 10:18:26 -07:00
|
|
|
|
|
|
|
// Previous location of the mouse
|
|
|
|
point previousLoc;
|
2008-04-24 11:07:47 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The event structure used for mouse button events
|
|
|
|
*/
|
|
|
|
struct _eventMouseBtn
|
|
|
|
{
|
|
|
|
event event;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
// Location
|
|
|
|
point loc;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
// Button pressed
|
|
|
|
mouseButton button;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The event structure used for keyboard events
|
|
|
|
*/
|
|
|
|
struct _eventKey
|
|
|
|
{
|
|
|
|
event event;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-25 16:20:16 -07:00
|
|
|
// The keycode of the key which was pressed
|
2008-07-09 08:46:46 -07:00
|
|
|
eventKeycode keycode;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
// Active modifier keys
|
|
|
|
bool ctrl;
|
|
|
|
bool shift;
|
|
|
|
bool alt;
|
|
|
|
};
|
|
|
|
|
2008-07-09 08:46:46 -07:00
|
|
|
/*
|
|
|
|
* The event structure for text input events
|
|
|
|
*/
|
|
|
|
struct _eventText
|
|
|
|
{
|
|
|
|
event event;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-09 08:46:46 -07:00
|
|
|
// The text that was typed, UTF-8 encoded
|
|
|
|
const char *utf8;
|
|
|
|
};
|
|
|
|
|
2008-07-15 03:12:03 -07:00
|
|
|
/*
|
|
|
|
* The event structure for timer events
|
|
|
|
*/
|
|
|
|
struct _eventTimer
|
|
|
|
{
|
|
|
|
event event;
|
|
|
|
};
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
struct _eventMisc
|
|
|
|
{
|
|
|
|
event event;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Event table structure
|
|
|
|
*/
|
|
|
|
struct _eventTableEntry
|
|
|
|
{
|
2008-07-14 16:41:53 -07:00
|
|
|
/// The unique id of the event handler
|
|
|
|
int id;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-14 16:41:53 -07:00
|
|
|
/// The event for which the handler is registered for
|
2008-04-24 11:07:47 -07:00
|
|
|
eventType type;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-14 16:41:53 -07:00
|
|
|
/// The method to call
|
2008-04-24 11:07:47 -07:00
|
|
|
callback callback;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-14 16:41:53 -07:00
|
|
|
/// Pointer to user supplied data to pass to callback
|
2008-04-25 16:20:16 -07:00
|
|
|
void *userData;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-15 03:12:03 -07:00
|
|
|
/// The time when the event was last called (for debugging and timer events)
|
|
|
|
int lastCalled;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-15 03:12:03 -07:00
|
|
|
/// For timer events only; how often the event should fire; in ms
|
|
|
|
int interval;
|
2008-04-24 11:07:47 -07:00
|
|
|
};
|
|
|
|
|
2008-05-06 09:34:34 -07:00
|
|
|
/*
|
|
|
|
* The widget classes virtual method table
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
struct _widgetVtbl
|
|
|
|
{
|
2008-08-11 03:27:11 -07:00
|
|
|
bool (*handleEvent) (widget *self, const event *evt);
|
2008-06-22 16:28:34 -07:00
|
|
|
|
|
|
|
bool (*addChild) (widget *self, widget *child);
|
|
|
|
void (*removeChild) (widget *self, widget *child);
|
|
|
|
|
2008-08-11 03:27:11 -07:00
|
|
|
bool (*fireCallbacks) (widget *self, const event *evt);
|
|
|
|
bool (*fireTimerCallbacks) (widget *self, const event *evt);
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-06-22 16:28:34 -07:00
|
|
|
int (*addEventHandler) (widget *self, eventType type,
|
|
|
|
callback handler, void *userData);
|
2008-07-15 03:12:03 -07:00
|
|
|
int (*addTimerEventHandler) (widget *self, eventType type,
|
2008-08-02 08:47:41 -07:00
|
|
|
int interval, callback handler,
|
|
|
|
void *userData);
|
2008-06-22 16:28:34 -07:00
|
|
|
void (*removeEventHandler) (widget *self, int id);
|
|
|
|
|
|
|
|
void (*focus) (widget *self);
|
|
|
|
void (*blur) (widget *self);
|
|
|
|
|
2008-08-12 06:00:40 -07:00
|
|
|
void (*acceptDrag) (widget *self);
|
|
|
|
void (*declineDrag) (widget *self);
|
|
|
|
|
2008-06-22 16:28:34 -07:00
|
|
|
void (*enable) (widget *self);
|
|
|
|
void (*disable) (widget *self);
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-08-01 14:24:19 -07:00
|
|
|
void (*show) (widget *self);
|
|
|
|
void (*hide) (widget *self);
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-07-02 16:18:32 -07:00
|
|
|
size (*getMinSize) (widget *self);
|
|
|
|
size (*getMaxSize) (widget *self);
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-08-13 04:21:58 -07:00
|
|
|
void (*resize) (widget *self, int w, int h);
|
|
|
|
void (*reposition) (widget *self, int x, int y);
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-18 15:21:54 -07:00
|
|
|
void (*composite) (widget *self);
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-07-02 16:18:32 -07:00
|
|
|
void (*doDraw) (widget *self);
|
2008-07-07 12:10:23 -07:00
|
|
|
void (*doDrawMask) (widget *self);
|
2008-06-22 16:28:34 -07:00
|
|
|
bool (*doLayout) (widget *self);
|
|
|
|
|
|
|
|
void (*destroy) (widget *self);
|
2008-04-24 11:07:47 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
struct _widget
|
|
|
|
{
|
|
|
|
//--------------------------------------
|
|
|
|
// Private/protected members
|
|
|
|
//--------------------------------------
|
|
|
|
widgetVtbl *vtbl;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
2008-06-22 05:03:42 -07:00
|
|
|
* The list of registered event handlers
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
vector *eventVtbl;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
2008-06-22 05:03:42 -07:00
|
|
|
* The child widgets of ourself
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
vector *children;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
2008-06-22 05:03:42 -07:00
|
|
|
* The widgets parent widget
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
widget *parent;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-06-22 10:53:08 -07:00
|
|
|
/*
|
|
|
|
* If a mouse button is currently depressed on the widget
|
|
|
|
*/
|
|
|
|
bool hasMouseDown;
|
2008-08-12 06:00:40 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Current drag state
|
|
|
|
*/
|
|
|
|
dragStates dragState;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-02 16:18:32 -07:00
|
|
|
/*
|
|
|
|
* The widgets cairo drawing context
|
|
|
|
*/
|
|
|
|
cairo_t *cr;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-18 15:21:54 -07:00
|
|
|
/*
|
|
|
|
* The id of the OpenGL texture to which self->cr is mapped
|
|
|
|
*/
|
|
|
|
GLuint textureId;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-07 12:10:23 -07:00
|
|
|
/*
|
|
|
|
* The widgets mouse-event mask
|
|
|
|
*/
|
|
|
|
cairo_t *maskCr;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
//--------------------------------------
|
|
|
|
// Public members
|
|
|
|
//--------------------------------------
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* The id of the widget
|
|
|
|
*/
|
|
|
|
char *id;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-06-23 05:18:19 -07:00
|
|
|
/*
|
|
|
|
* The class (or subclass) that widget is (used for type checking)
|
|
|
|
*/
|
2008-06-24 03:11:03 -07:00
|
|
|
const classInfo *classInfo;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
2008-08-02 08:47:41 -07:00
|
|
|
* Arbitrary user-defined data
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void *pUserData;
|
2008-05-06 09:34:34 -07:00
|
|
|
int32_t userData;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
2008-04-27 08:14:42 -07:00
|
|
|
* The offset of the widget relative to its parent
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
2008-04-27 08:14:42 -07:00
|
|
|
point offset;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-27 08:14:42 -07:00
|
|
|
/*
|
|
|
|
* The size of the widget
|
|
|
|
*/
|
2008-07-02 16:18:32 -07:00
|
|
|
size size;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* If the widget currently has keyboard focus
|
|
|
|
*/
|
|
|
|
bool hasFocus;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* If the mouse is currently over the widget
|
|
|
|
*/
|
|
|
|
bool hasMouse;
|
2008-06-22 16:28:34 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* If the widget is currently enabled or not
|
|
|
|
*/
|
|
|
|
bool isEnabled;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-08-01 14:24:19 -07:00
|
|
|
/*
|
|
|
|
* If the widget is visible or not
|
|
|
|
*/
|
|
|
|
bool isVisible;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-02 16:18:32 -07:00
|
|
|
/*
|
|
|
|
* If the widget is dirty (i.e., needs to be re-drawn)
|
|
|
|
*/
|
|
|
|
bool needsRedraw;
|
2008-08-02 08:47:41 -07:00
|
|
|
|
2008-07-07 12:10:23 -07:00
|
|
|
/*
|
|
|
|
* If the widget uses an mouse event mask
|
|
|
|
*/
|
|
|
|
bool maskEnabled;
|
2008-04-24 11:07:47 -07:00
|
|
|
};
|
|
|
|
|
2008-06-23 05:18:19 -07:00
|
|
|
/*
|
|
|
|
* Type information
|
|
|
|
*/
|
2008-07-02 16:18:32 -07:00
|
|
|
extern const classInfo widgetClassInfo;
|
2008-06-23 05:18:19 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* Helper macros
|
|
|
|
*/
|
|
|
|
#define WIDGET(self) ((widget *) (self))
|
|
|
|
#define WIDGET_GET_VTBL(self) ((WIDGET(self))->vtbl)
|
2008-05-06 09:34:34 -07:00
|
|
|
#define WIDGET_CHECK_METHOD(self, method) (assert(WIDGET_GET_VTBL(self)->method))
|
2008-04-24 11:07:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Protected methods
|
|
|
|
*/
|
|
|
|
void widgetInit(widget *instance, const char *id);
|
|
|
|
void widgetDestroyImpl(widget *instance);
|
|
|
|
bool widgetAddChildImpl(widget *self, widget *child);
|
|
|
|
void widgetRemoveChildImpl(widget *self, widget *child);
|
2008-08-11 03:27:11 -07:00
|
|
|
bool widgetFireCallbacksImpl(widget *self, const event *evt);
|
|
|
|
bool widgetFireTimerCallbacksImpl(widget *self, const event *evt);
|
2008-04-25 16:20:16 -07:00
|
|
|
int widgetAddEventHandlerImpl(widget *self, eventType type,
|
|
|
|
callback handler, void *userData);
|
2008-07-15 03:12:03 -07:00
|
|
|
int widgetAddTimerEventHandlerImpl(widget *self, eventType type, int interval,
|
|
|
|
callback handler, void *userData);
|
2008-04-24 11:07:47 -07:00
|
|
|
void widgetRemoveEventHandlerImpl(widget *self, int id);
|
2008-08-12 06:00:40 -07:00
|
|
|
void widgetAcceptDragImpl(widget *self);
|
|
|
|
void widgetDeclineDragImpl(widget *self);
|
2008-04-24 11:07:47 -07:00
|
|
|
void widgetEnableImpl(widget *self);
|
|
|
|
void widgetDisableImpl(widget *self);
|
2008-08-01 14:24:19 -07:00
|
|
|
void widgetShowImpl(widget *self);
|
|
|
|
void widgetHideImpl(widget *self);
|
2008-04-24 11:07:47 -07:00
|
|
|
void widgetFocusImpl(widget *self);
|
|
|
|
void widgetBlurImpl(widget *self);
|
2008-07-02 16:18:32 -07:00
|
|
|
void widgetResizeImpl(widget *self, int w, int h);
|
2008-08-13 04:21:58 -07:00
|
|
|
void widgetRepositionImpl(widget *self, int x, int y);
|
2008-08-11 03:27:11 -07:00
|
|
|
bool widgetHandleEventImpl(widget *self, const event *evt);
|
2008-07-18 15:21:54 -07:00
|
|
|
void widgetCompositeImpl(widget *self);
|
2008-04-24 11:07:47 -07:00
|
|
|
|
2008-06-23 05:18:19 -07:00
|
|
|
/*
|
|
|
|
* Public static methods
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks to see if it is legal to cast self to instanceOf. Or, put in OO terms
|
|
|
|
* checks if self `is a' instanceOf instance.
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-06-23 05:18:19 -07:00
|
|
|
* @param self The widget to check the class of.
|
|
|
|
* @param instanceOf The class we are interested in.
|
|
|
|
* @return True if it is legal to cast, false otherwise.
|
|
|
|
*/
|
2008-08-10 15:51:12 -07:00
|
|
|
bool widgetIsA(const widget *self, const classInfo *instanceOf);
|
2008-06-23 05:18:19 -07:00
|
|
|
|
2008-08-10 05:43:45 -07:00
|
|
|
/*
|
|
|
|
* Public static, implementation defined methods
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This method should return the number of milliseconds since an undefined
|
|
|
|
* epoch.
|
|
|
|
*
|
|
|
|
* @return The number of milliseconds since the epoch.
|
|
|
|
*/
|
|
|
|
int widgetGetTime(void);
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/*
|
|
|
|
* Public methods
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Draws the widget along with its child widgets.
|
2008-04-25 16:20:16 -07:00
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to be drawn.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
2008-07-02 16:18:32 -07:00
|
|
|
void widgetDraw(widget *self);
|
|
|
|
|
|
|
|
/**
|
2008-08-10 04:12:42 -07:00
|
|
|
* Composites the widget self onto the frame-buffer. In addition this method is
|
|
|
|
* also responsible for transforming the widget for the purposes of animation.
|
|
|
|
* Finally this method will loop over the child widgets of self and call
|
|
|
|
* widgetComposite on each one.
|
|
|
|
*
|
|
|
|
* @param self The widget (along with its children to composite.
|
2008-07-02 16:18:32 -07:00
|
|
|
*/
|
2008-07-18 15:21:54 -07:00
|
|
|
void widgetComposite(widget *self);
|
2008-04-24 11:07:47 -07:00
|
|
|
|
2008-07-07 12:10:23 -07:00
|
|
|
/**
|
|
|
|
* Enables the widgets mask.
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-07 12:10:23 -07:00
|
|
|
* @param self The widget whose mask to enable.
|
|
|
|
*/
|
|
|
|
void widgetEnableMask(widget *self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disables the widgets mouse-event mask.
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-07 12:10:23 -07:00
|
|
|
* @param self The widget whose mask to disable.
|
|
|
|
*/
|
|
|
|
void widgetDisableMask(widget *self);
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/**
|
|
|
|
* Recursively searches the child widgets of self for a widget whose ->id is
|
|
|
|
* id. If no widget with such an id exists NULL is returned.
|
2008-04-25 16:20:16 -07:00
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to start the search from.
|
|
|
|
* @param id The id of the desired widget.
|
2008-04-25 16:20:16 -07:00
|
|
|
* @return A pointer to the widget if found, NULL otherwise.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
widget *widgetFindById(widget *self, const char *id);
|
|
|
|
|
2008-04-27 08:14:42 -07:00
|
|
|
/**
|
|
|
|
* Returns the absolute position of the widget (ie, a position that is not
|
|
|
|
* relative to any other widget.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to get the position of.
|
2008-04-27 08:14:42 -07:00
|
|
|
* @return The absolute position of self.
|
|
|
|
*/
|
2008-08-10 15:51:12 -07:00
|
|
|
point widgetAbsolutePosition(const widget *self);
|
2008-04-27 08:14:42 -07:00
|
|
|
|
2008-06-21 10:23:00 -07:00
|
|
|
/**
|
|
|
|
* Returns the absolute bounding rectangle of the widget.
|
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to get the bounds of.
|
2008-06-21 10:23:00 -07:00
|
|
|
* @return The absolute bounds of self.
|
|
|
|
*/
|
2008-08-10 15:51:12 -07:00
|
|
|
rect widgetAbsoluteBounds(const widget *self);
|
2008-06-21 10:23:00 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/**
|
|
|
|
* Transverses up the hierarchy until it finds parent-less widget (known as
|
|
|
|
* the root widget). A pointer to this widget is returned.
|
2008-04-25 16:20:16 -07:00
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to find the root widget of.
|
2008-04-25 16:20:16 -07:00
|
|
|
* @return A pointer to the root widget.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
2008-06-22 05:03:42 -07:00
|
|
|
widget *widgetGetRoot(widget *self);
|
2008-04-24 11:07:47 -07:00
|
|
|
|
|
|
|
/**
|
2008-04-25 16:20:16 -07:00
|
|
|
* Attempts to add child as a child widget of self. The exact location of the
|
2008-05-06 09:34:34 -07:00
|
|
|
* widget (as well as its dimensions) are decided based off of the min & max
|
|
|
|
* sizes of the child.
|
2008-04-24 11:07:47 -07:00
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to add the child widget to.
|
|
|
|
* @param child The widget to be added.
|
2008-04-25 16:20:16 -07:00
|
|
|
* @return true if child was successfully added, false otherwise.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
bool widgetAddChild(widget *self, widget *child);
|
|
|
|
|
|
|
|
/**
|
2008-04-25 16:20:16 -07:00
|
|
|
* Attempts to remove child from the list of child widgets. If the child widget
|
|
|
|
* is found anywhere in the hierarchy it is removed and its destructor called.
|
2008-04-24 11:07:47 -07:00
|
|
|
*
|
2008-04-25 16:20:16 -07:00
|
|
|
* A convenient way of using this methid is as follows:
|
|
|
|
* widgetRemoveChild(self, widgetFindById(self, "id_to_remove"));
|
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to remove child from.
|
|
|
|
* @param child The child widget to remove.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void widgetRemoveChild(widget *self, widget *child);
|
|
|
|
|
|
|
|
/**
|
2008-04-25 16:20:16 -07:00
|
|
|
* Adds handler to self's event handler table, registering it to respond to
|
|
|
|
* events of type. An unique id is assigned to the event when it is added. This
|
|
|
|
* id can be used at a later date to widgetRemoveEventHandler to remove the
|
|
|
|
* event.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
2008-04-25 16:20:16 -07:00
|
|
|
* The userData pointer is passed verbatim to handler via the userData
|
|
|
|
* parameter. If no user data is required then NULL can be passed.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
2008-04-25 16:20:16 -07:00
|
|
|
* It is perfectly legal for there to be multiple event handlers installed for
|
|
|
|
* a single event type. When this is the case the event handlers are fired in
|
|
|
|
* the order in which they were added.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to add the event handler to.
|
|
|
|
* @param type The type of event that handler should respond to.
|
|
|
|
* @param handler The function to call when the event type fires.
|
2008-07-18 05:10:47 -07:00
|
|
|
* @param userData User specified data pointer to pass to handler.
|
2008-04-25 16:20:16 -07:00
|
|
|
* @return The id of the newly added event.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
2008-04-25 16:20:16 -07:00
|
|
|
int widgetAddEventHandler(widget *self, eventType type,
|
|
|
|
callback handler, void *userData);
|
2008-04-24 11:07:47 -07:00
|
|
|
|
2008-07-18 05:10:47 -07:00
|
|
|
/**
|
|
|
|
* Similar to widgetAddEventHandler in many respects, except that it is designed
|
|
|
|
* to add timer event handlers (EVT_TIMER_ONE_SHOT and EVT_TIMER_PERSISTENT).
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-18 05:10:47 -07:00
|
|
|
* @param self The widget to add the timer event handler to.
|
|
|
|
* @param type The tyoe of the timer to register the handler for.
|
|
|
|
* @param interval The duration in ms to wait.
|
|
|
|
* @param handler The function to call when the event fires.
|
|
|
|
* @param userData User specified data pointer to pass to handler.
|
|
|
|
* @return The id of the newly added event.
|
|
|
|
*/
|
|
|
|
int widgetAddTimerEventHandler(widget *self, eventType type, int interval,
|
|
|
|
callback handler, void *userData);
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/**
|
2008-04-25 16:20:16 -07:00
|
|
|
* Removes the event from the events table at offset id.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to remove the event handler from.
|
|
|
|
* @param id The id of the event to be removed.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void widgetRemoveEventHandler(widget *self, int id);
|
|
|
|
|
2008-08-08 11:15:50 -07:00
|
|
|
/**
|
|
|
|
* Returns the user-data for the event whose id is id.
|
|
|
|
*
|
|
|
|
* @param self The widget to whom the event handler is registered to.
|
|
|
|
* @param id The id of the event handler to fetch the user-data for.
|
|
|
|
* @returm The user-data for the event handler, or NULL if the eventId is
|
|
|
|
* invalid.
|
|
|
|
*/
|
2008-08-10 15:51:12 -07:00
|
|
|
void *widgetGetEventHandlerUserData(const widget *self, int id);
|
2008-08-08 11:15:50 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the user-data for the event handler with an id of id registered to self
|
|
|
|
* to userData.
|
|
|
|
*
|
|
|
|
* @param self The widget to whom the event handler is registered to.
|
|
|
|
* @param id The id of the widget to set the user-data for.
|
|
|
|
* @param userData The new user-data for the event handler
|
|
|
|
*/
|
|
|
|
void widgetSetEventHandlerUserData(widget *self, int id, void *userData);
|
|
|
|
|
2008-08-12 06:00:40 -07:00
|
|
|
/**
|
|
|
|
* Accepts the current drag offer, if any. Should no drag offer be on the table
|
|
|
|
* then the results are undefined.
|
|
|
|
*
|
|
|
|
* @param self The widget to accept the drag offer for.
|
|
|
|
*/
|
|
|
|
void widgetAcceptDrag(widget *self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Declines the current drag offer. Like with widgetAcceptDrag the results are
|
|
|
|
* undefined if there is no drag offer .
|
|
|
|
*
|
|
|
|
* @param self The widget to decline the drag offer for.
|
|
|
|
*/
|
|
|
|
void widgetDeclineDrag(widget *self);
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/**
|
|
|
|
* Enables the current widget along with all of its child widgets. If the
|
|
|
|
* widget is currently enabled but one or more of its child widgets are not
|
|
|
|
* then they will also be enabled.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
2008-04-24 11:07:47 -07:00
|
|
|
* If, however, the parent widget is disabled then this method is effectively
|
|
|
|
* a no-op.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to enable.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void widgetEnable(widget *self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disables the current widget along with all of its child widgets. If the
|
|
|
|
* widget is currently disabled then this method is a no-op.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to disable.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void widgetDisable(widget *self);
|
|
|
|
|
2008-08-01 14:24:19 -07:00
|
|
|
/**
|
|
|
|
* Shows the current widget (makes it visible). This is a no-op if the widget is
|
|
|
|
* already shown.
|
|
|
|
*
|
|
|
|
* @param self The widget to show.
|
|
|
|
*/
|
|
|
|
void widgetShow(widget *self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Hides the current widget. Again, this is a no-op if the widget is already
|
|
|
|
* hidden.
|
|
|
|
*
|
|
|
|
* @param self The widget to hide.
|
|
|
|
*/
|
|
|
|
void widgetHide(widget *self);
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/**
|
|
|
|
* Destroys the widget and frees *all* memory associated with it.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to destroy.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void widgetDestroy(widget *self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns a pointer to the widget furthest down the hierarchy which currently
|
|
|
|
* has focus. If self does not currently have focus then NULL is returned.
|
|
|
|
* Should none of self's child widgets have focus (but it does) then self is
|
|
|
|
* returned.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to get the further down focused child of.
|
2008-04-25 16:20:16 -07:00
|
|
|
* @return A pointer to the widget, or NULL if self is not focused.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
widget *widgetGetCurrentlyFocused(widget *self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If the widget is capable of holding keyboard focus and does not currently
|
2008-04-25 16:20:16 -07:00
|
|
|
* hold it then this method will bring it into focus. Should ->parent not be
|
|
|
|
* focused then widgetFocus(self->parent) will be called to focus it.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
2008-04-25 16:20:16 -07:00
|
|
|
* This method will also blur any widgets which will no longer be in focus as a
|
|
|
|
* result of self being focued. In addition it takes responsibility for firing
|
|
|
|
* the EVT_FOCUS callbacks for self.
|
2008-04-24 11:07:47 -07:00
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to focus.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void widgetFocus(widget *self);
|
|
|
|
|
|
|
|
/**
|
2008-05-06 09:34:34 -07:00
|
|
|
* Blurs the current widget (removes keyboard focus from it). Before self is
|
2008-04-25 16:20:16 -07:00
|
|
|
* blurred any child widget with focus is blurred first. Finally the EVT_BLUR
|
|
|
|
* event handlers for self are fired.
|
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to blur.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
|
|
|
void widgetBlur(widget *self);
|
|
|
|
|
2008-05-06 09:34:34 -07:00
|
|
|
/**
|
|
|
|
* Returns the minimum size that the widget can be.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget to return the miniumum size of.
|
2008-05-06 09:34:34 -07:00
|
|
|
* @return The miniumum (x,y) size of the widget.
|
|
|
|
*/
|
2008-07-02 16:18:32 -07:00
|
|
|
size widgetGetMinSize(widget *self);
|
2008-05-06 09:34:34 -07:00
|
|
|
|
|
|
|
/**
|
2008-07-02 16:18:32 -07:00
|
|
|
* Returns the maxiumum size that the widget can be.
|
2008-05-06 09:34:34 -07:00
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to return the maximum size of.
|
2008-05-06 09:34:34 -07:00
|
|
|
* @return The maximum (x,y) size of the widget.
|
|
|
|
*/
|
2008-07-02 16:18:32 -07:00
|
|
|
size widgetGetMaxSize(widget *self);
|
2008-05-06 09:34:34 -07:00
|
|
|
|
|
|
|
/**
|
2008-07-02 16:18:32 -07:00
|
|
|
* Sets the size of the widget to (x,y). x and y are subject to the following
|
|
|
|
* conditions:
|
|
|
|
* widgetGetMinSize().x <= x <= widgetGetMaxSize().x and
|
|
|
|
* widgetGetMinSize().y <= y <= widgetGetMaxSize().y.
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-02 16:18:32 -07:00
|
|
|
* @param self The widget to resize.
|
|
|
|
* @param w The new size of the widget in the x-axis.
|
|
|
|
* @param h The new size of the widget in the y-axis.
|
2008-05-06 09:34:34 -07:00
|
|
|
*/
|
2008-07-02 16:18:32 -07:00
|
|
|
void widgetResize(widget *self, int w, int h);
|
2008-05-06 09:34:34 -07:00
|
|
|
|
2008-08-13 04:21:58 -07:00
|
|
|
/**
|
|
|
|
* Sets the offset of the widget, relative to its parent widget to (x,y).
|
|
|
|
*
|
|
|
|
* @param self The widget to reposition.
|
|
|
|
* @param w The new x-offset of the widget.
|
|
|
|
* @param h The new y-offset of the widget.
|
|
|
|
*/
|
|
|
|
void widgetReposition(widget *self, int x, int y);
|
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
/**
|
2008-08-10 04:12:42 -07:00
|
|
|
* This is the main event dispatching function. Its purpose is to take an event,
|
|
|
|
* evt and decide what course of action needs to be taken (if any). It is
|
|
|
|
* responsible for setting widget-states such as hasMouse and hasFocus and for
|
|
|
|
* deciding if evt is relevant to any child widgets of self.
|
|
|
|
*
|
|
|
|
* @param self The widget to handle the event.
|
|
|
|
* @param evt The event itself.
|
|
|
|
* @param True if the event was `handled', false otherwise.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
2008-08-11 03:27:11 -07:00
|
|
|
bool widgetHandleEvent(widget *self, const event *evt);
|
2008-04-24 11:07:47 -07:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Protected methods
|
|
|
|
*/
|
|
|
|
|
2008-06-22 05:03:42 -07:00
|
|
|
/**
|
2008-07-02 16:18:32 -07:00
|
|
|
* A protected `pure virtual' method which is called to draw the widget.
|
2008-06-22 16:28:34 -07:00
|
|
|
*
|
|
|
|
* @param self The widget that should draw itself.
|
2008-04-24 11:07:47 -07:00
|
|
|
*/
|
2008-07-02 16:18:32 -07:00
|
|
|
void widgetDoDraw(widget *self);
|
2008-04-24 11:07:47 -07:00
|
|
|
|
2008-07-07 12:10:23 -07:00
|
|
|
/**
|
|
|
|
* Configures the mask context (self->maskCr) for drawing and then delegates the
|
|
|
|
* drawing to widgetDoDrawMask. This method is required as the mask context
|
|
|
|
* requires some additional initialisation to a regular Cairo context.
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-07 12:10:23 -07:00
|
|
|
* @param self The widget whose mask to draw.
|
|
|
|
*/
|
|
|
|
void widgetDrawMask(widget *self);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A protected `pure virtual` method which is called to draw the widgets mouse-
|
|
|
|
* event mask.
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-07 12:10:23 -07:00
|
|
|
* @param self The widget that should draw its mask.
|
|
|
|
*/
|
|
|
|
void widgetDoDrawMask(widget *self);
|
|
|
|
|
2008-05-06 09:34:34 -07:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
bool widgetDoLayout(widget *self);
|
|
|
|
|
2008-04-25 16:20:16 -07:00
|
|
|
/**
|
|
|
|
* Fires all of the event handlers registered for evt->type on the widger self.
|
|
|
|
*
|
2008-06-22 16:28:34 -07:00
|
|
|
* @param self The widget to fire the callbacks on.
|
|
|
|
* @param evt The event to fire the callbacks for.
|
2008-04-25 16:20:16 -07:00
|
|
|
*/
|
2008-08-11 03:27:11 -07:00
|
|
|
bool widgetFireCallbacks(widget *self, const event *evt);
|
2008-04-25 16:20:16 -07:00
|
|
|
|
2008-07-15 03:12:03 -07:00
|
|
|
/**
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-15 03:12:03 -07:00
|
|
|
*/
|
2008-08-11 03:27:11 -07:00
|
|
|
bool widgetFireTimerCallbacks(widget *self, const event *evt);
|
2008-07-15 03:12:03 -07:00
|
|
|
|
2008-07-07 12:10:23 -07:00
|
|
|
/**
|
|
|
|
* Checks to see if the point loc is masked or not by the widgets mouse-event
|
|
|
|
* mask.
|
2008-08-02 08:47:41 -07:00
|
|
|
*
|
2008-07-07 12:10:23 -07:00
|
|
|
* @param self The widget to check the mask of.
|
|
|
|
* @param loc The point (x,y) to check the mask status of.
|
|
|
|
* @return true if loc is masked; false otherwise;
|
|
|
|
*/
|
2008-08-10 15:51:12 -07:00
|
|
|
bool widgetPointMasked(const widget *self, point loc);
|
2008-07-07 12:10:23 -07:00
|
|
|
|
2008-04-24 11:07:47 -07:00
|
|
|
#endif /*WIDGET_H_*/
|