2015-12-18 11:00:46 -06:00
|
|
|
// 18 december 2015
|
|
|
|
|
|
|
|
// TODOs
|
|
|
|
// - things look very wrong on initial draw
|
|
|
|
// - initial scrolling is not set properly
|
|
|
|
// - should background be inherited from parent control?
|
|
|
|
|
|
|
|
struct uiArea {
|
|
|
|
uiWindowsControl c;
|
|
|
|
HWND hwnd;
|
|
|
|
uiAreaHandler *ah;
|
|
|
|
|
|
|
|
BOOL scrolling;
|
|
|
|
intmax_t scrollWidth;
|
|
|
|
intmax_t scrollHeight;
|
|
|
|
intmax_t hscrollpos;
|
|
|
|
intmax_t vscrollpos;
|
|
|
|
int hwheelCarry;
|
|
|
|
int vwheelCarry;
|
|
|
|
|
|
|
|
clickCounter cc;
|
|
|
|
BOOL capturing;
|
|
|
|
|
2015-12-18 17:06:45 -06:00
|
|
|
BOOL inside;
|
2015-12-18 18:38:21 -06:00
|
|
|
BOOL tracking;
|
2015-12-18 17:06:45 -06:00
|
|
|
|
2015-12-18 11:00:46 -06:00
|
|
|
ID2D1HwndRenderTarget *rt;
|
|
|
|
};
|
|
|
|
|
|
|
|
// areadraw.h
|
|
|
|
extern BOOL areaDoDraw(uiArea *a, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
|
|
|
|
extern void areaDrawOnResize(uiArea *, RECT *);
|
|
|
|
|
|
|
|
// areascroll.c
|
|
|
|
extern BOOL areaDoScroll(uiArea *a, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
|
|
|
|
extern void areaUpdateScroll(uiArea *a);
|
|
|
|
|
|
|
|
// areaevents.c
|
|
|
|
extern BOOL areaDoEvents(uiArea *a, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *lResult);
|
|
|
|
extern void unregisterAreaFilter(void);
|
2015-12-18 20:15:40 -06:00
|
|
|
|
|
|
|
// areautil.c
|
|
|
|
extern void renderTargetGetSize(ID2D1RenderTarget *rt, D2D1_SIZE_F *size);
|
2015-12-18 20:38:27 -06:00
|
|
|
extern void loadAreaSize(uiArea *a, ID2D1RenderTarget *rt, double *width, double *height);
|
|
|
|
extern void pixelsToDIP(uiArea *a, double *x, double *y);
|
|
|
|
extern void dipToPixels(uiArea *a, double *x, double *y);
|