Set up a new infrastruture which allows both scrolling and non-scrolling areas AND mouse entered/exited events.
This commit is contained in:
parent
4e256dfc95
commit
12a94404aa
14
ui.h
14
ui.h
|
@ -279,26 +279,30 @@ typedef struct uiDrawContext uiDrawContext;
|
||||||
|
|
||||||
struct uiAreaHandler {
|
struct uiAreaHandler {
|
||||||
void (*Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *);
|
void (*Draw)(uiAreaHandler *, uiArea *, uiAreaDrawParams *);
|
||||||
uintmax_t (*HScrollMax)(uiAreaHandler *, uiArea *);
|
// TODO document that resizes cause a full redraw for non-scrolling areas; implementation-defined for scrolling areas
|
||||||
uintmax_t (*VScrollMax)(uiAreaHandler *, uiArea *);
|
|
||||||
// TODO document that resizes cause a full redraw
|
|
||||||
// TODO if the scrollbars disappear the histogram example won't recognize points in the correct spot until the area is resized
|
// TODO if the scrollbars disappear the histogram example won't recognize points in the correct spot until the area is resized
|
||||||
// TODO mouse leave event?
|
|
||||||
void (*MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *);
|
void (*MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *);
|
||||||
|
// TODO document that on first show if the mouse is already in the uiArea then one gets sent with left=0
|
||||||
|
// TODO what about when the area is hidden and then shown again?
|
||||||
|
void (*MouseCrossed)(uiAreaHandler *, int left);
|
||||||
void (*DragBroken)(uiAreaHandler *, uiArea *);
|
void (*DragBroken)(uiAreaHandler *, uiArea *);
|
||||||
int (*KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *);
|
int (*KeyEvent)(uiAreaHandler *, uiArea *, uiAreaKeyEvent *);
|
||||||
};
|
};
|
||||||
|
|
||||||
_UI_EXTERN uintmax_t uiMenuItemType(void);
|
_UI_EXTERN uintmax_t uiMenuItemType(void);
|
||||||
#define uiArea(this) ((uiArea *) uiIsA((this), uiAreaType(), 1))
|
#define uiArea(this) ((uiArea *) uiIsA((this), uiAreaType(), 1))
|
||||||
_UI_EXTERN void uiAreaUpdateScroll(uiArea *a);
|
// TODO give a better name
|
||||||
|
_UI_EXTERN void uiAreaSetSize(uiArea *a, intmax_t width, intmax_t height);
|
||||||
// TODO uiAreaQueueRedraw()
|
// TODO uiAreaQueueRedraw()
|
||||||
_UI_EXTERN void uiAreaQueueRedrawAll(uiArea *a);
|
_UI_EXTERN void uiAreaQueueRedrawAll(uiArea *a);
|
||||||
_UI_EXTERN uiArea *uiNewArea(uiAreaHandler *ah);
|
_UI_EXTERN uiArea *uiNewArea(uiAreaHandler *ah);
|
||||||
|
_UI_EXTERN uiArea *uiNewScrollingArea(uiAreaHandler *ah, intmax_t width, intmax_t height);
|
||||||
|
|
||||||
struct uiAreaDrawParams {
|
struct uiAreaDrawParams {
|
||||||
uiDrawContext *Context;
|
uiDrawContext *Context;
|
||||||
|
|
||||||
|
// TODO document that this is only defined for nonscrolling areas
|
||||||
|
// TODO rename to AreaWidth/Height?
|
||||||
double ClientWidth;
|
double ClientWidth;
|
||||||
double ClientHeight;
|
double ClientHeight;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue