Started planning out mouse events.

This commit is contained in:
Pietro Gagliardi 2015-09-10 23:00:29 -04:00
parent 95e0ca8f49
commit ddc81d1b2e
1 changed files with 27 additions and 22 deletions

View File

@ -3,6 +3,7 @@
typedef struct uiArea uiArea; typedef struct uiArea uiArea;
typedef struct uiAreaHandler uiAreaHandler; typedef struct uiAreaHandler uiAreaHandler;
typedef struct uiAreaDrawParams uiAreaDrawParams; typedef struct uiAreaDrawParams uiAreaDrawParams;
typedef struct uiAreaMouseEvent uiAreaMouseEvent;
typedef struct uiDrawContext uiDrawContext; typedef struct uiDrawContext uiDrawContext;
@ -11,6 +12,7 @@ struct uiAreaHandler {
uintmax_t (*HScrollMax)(uiAreaHandler *, uiArea *); uintmax_t (*HScrollMax)(uiAreaHandler *, uiArea *);
uintmax_t (*VScrollMax)(uiAreaHandler *, uiArea *); uintmax_t (*VScrollMax)(uiAreaHandler *, uiArea *);
int (*RedrawOnResize)(uiAreaHandler *, uiArea *); int (*RedrawOnResize)(uiAreaHandler *, uiArea *);
void (*MouseEvent)(uiAreaHandler *, uiArea *, uiAreaMouseEvent *);
}; };
struct uiAreaDrawParams { struct uiAreaDrawParams {
@ -115,25 +117,28 @@ void uiDrawFill(uiDrawContext *, uiDrawFillMode);
// - solid colors, arbitrary spaces // - solid colors, arbitrary spaces
// - shadows // - shadows
// arcs typedef enum uiModifiers uiModifiers;
// cairo_arc/arc_negative
// - parameters: center, radius, angle1 radians, angle2 radins enum uiModifiers {
// - if angle2 < angle1, TODO uiModifierCtrl = 1 << 0,
// - if angle2 > angle1, TODO uiModifierAlt = 1 << 1,
// - line segment from current point to beginning of arc uiModifierShift = 1 << 2,
// - arc: clockwise, arc_negative: counterclockwise uiModifierSuper = 1 << 3,
// - circular };
// GDI Arc/Pie
// - parameters: bounding box, start point, end point struct uiAreaMouseEvent {
// - current position not used/changed // notes:
// - either clockwise or counterclockwise // - relative to content rect
// - elliptical intmax_t X;
// GDI ArcTo intmax_t Y;
// - same as Arc except line segment from current point to beginning of arc
// - there does not appear to be a PieTo intmax_t HScrollPos;
// GDI AngleArc intmax_t VScrollPos;
// - parameters: center, radius, angle1 degrees, angle2 degrees
// - line segment from current position to beginning of arc uintmax_t Down;
// - counterclockwise uintmax_t Up;
// - circular
// - can be used to draw pies too; MSDN example demonstrates uiModifiers Modifiers;
uint64_t Held1To64;
};