362 lines
19 KiB
C
362 lines
19 KiB
C
// widgetInternal.h — Shared internal header for widget implementation files
|
|
#ifndef WIDGET_INTERNAL_H
|
|
#define WIDGET_INTERNAL_H
|
|
|
|
#include "../dvxWidget.h"
|
|
#include "../dvxApp.h"
|
|
#include "../dvxDraw.h"
|
|
#include "../dvxWm.h"
|
|
#include "../dvxVideo.h"
|
|
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
|
|
// ============================================================
|
|
// Widget class vtable
|
|
// ============================================================
|
|
|
|
#define WCLASS_FOCUSABLE 0x0001
|
|
#define WCLASS_BOX_CONTAINER 0x0002
|
|
#define WCLASS_HORIZ_CONTAINER 0x0004
|
|
#define WCLASS_PAINTS_CHILDREN 0x0008
|
|
#define WCLASS_NO_HIT_RECURSE 0x0010
|
|
|
|
typedef struct WidgetClassT {
|
|
uint32_t flags;
|
|
void (*paint)(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void (*paintOverlay)(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void (*calcMinSize)(WidgetT *w, const BitmapFontT *font);
|
|
void (*layout)(WidgetT *w, const BitmapFontT *font);
|
|
void (*onMouse)(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void (*onKey)(WidgetT *w, int32_t key, int32_t mod);
|
|
void (*destroy)(WidgetT *w);
|
|
const char *(*getText)(const WidgetT *w);
|
|
void (*setText)(WidgetT *w, const char *text);
|
|
} WidgetClassT;
|
|
|
|
extern const WidgetClassT *widgetClassTable[];
|
|
|
|
// ============================================================
|
|
// Validation macros
|
|
// ============================================================
|
|
|
|
#define VALIDATE_WIDGET(w, wtype, retval) \
|
|
do { if (!(w) || (w)->type != (wtype)) { return (retval); } } while (0)
|
|
|
|
#define VALIDATE_WIDGET_VOID(w, wtype) \
|
|
do { if (!(w) || (w)->type != (wtype)) { return; } } while (0)
|
|
|
|
// ============================================================
|
|
// Constants
|
|
// ============================================================
|
|
|
|
// Modifier flags (BIOS INT 16h shift state bits)
|
|
#define KEY_MOD_SHIFT 0x03
|
|
#define KEY_MOD_CTRL 0x04
|
|
#define KEY_MOD_ALT 0x08
|
|
|
|
#define DEFAULT_SPACING 4
|
|
#define DEFAULT_PADDING 4
|
|
#define SEPARATOR_THICKNESS 2
|
|
#define BUTTON_PAD_H 8
|
|
#define BUTTON_PAD_V 4
|
|
#define CHECKBOX_BOX_SIZE 12
|
|
#define CHECKBOX_GAP 4
|
|
#define FRAME_BEVEL_BORDER 2
|
|
#define FRAME_FLAT_BORDER 1
|
|
#define TEXT_INPUT_PAD 3
|
|
#define DROPDOWN_BTN_WIDTH 16
|
|
#define DROPDOWN_MAX_VISIBLE 8
|
|
#define SLIDER_TRACK_H 4
|
|
#define SLIDER_THUMB_W 11
|
|
#define TAB_PAD_H 8
|
|
#define TAB_PAD_V 4
|
|
#define TAB_BORDER 2
|
|
#define LISTBOX_BORDER 2
|
|
#define LISTVIEW_BORDER 2
|
|
#define TREE_INDENT 16
|
|
#define TREE_EXPAND_SIZE 9
|
|
#define TREE_ICON_GAP 4
|
|
#define TREE_BORDER 2
|
|
#define WGT_SB_W 14
|
|
#define TREE_MIN_ROWS 4
|
|
#define SB_MIN_THUMB 14
|
|
#define SPLITTER_BAR_W 5
|
|
#define SPLITTER_MIN_PANE 20
|
|
|
|
// ============================================================
|
|
// Inline helpers
|
|
// ============================================================
|
|
|
|
static inline int32_t clampInt(int32_t val, int32_t lo, int32_t hi) {
|
|
if (val < lo) { return lo; }
|
|
if (val > hi) { return hi; }
|
|
return val;
|
|
}
|
|
|
|
// Classic Windows 3.1 embossed (etched) text for disabled widgets:
|
|
// Draw text at +1,+1 in highlight, then at 0,0 in shadow.
|
|
static inline void drawTextEmbossed(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, int32_t x, int32_t y, const char *text, const ColorSchemeT *colors) {
|
|
drawText(d, ops, font, x + 1, y + 1, text, colors->windowHighlight, 0, false);
|
|
drawText(d, ops, font, x, y, text, colors->windowShadow, 0, false);
|
|
}
|
|
|
|
static inline void drawTextAccelEmbossed(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, int32_t x, int32_t y, const char *text, const ColorSchemeT *colors) {
|
|
drawTextAccel(d, ops, font, x + 1, y + 1, text, colors->windowHighlight, 0, false);
|
|
drawTextAccel(d, ops, font, x, y, text, colors->windowShadow, 0, false);
|
|
}
|
|
|
|
// ============================================================
|
|
// Shared state (defined in widgetCore.c)
|
|
// ============================================================
|
|
|
|
extern bool sDebugLayout;
|
|
extern WidgetT *sClosedPopup;
|
|
extern WidgetT *sFocusedWidget;
|
|
extern WidgetT *sKeyPressedBtn;
|
|
extern WidgetT *sOpenPopup;
|
|
extern WidgetT *sPressedButton;
|
|
extern WidgetT *sDragSlider;
|
|
extern WidgetT *sDrawingCanvas;
|
|
extern WidgetT *sDragTextSelect;
|
|
extern int32_t sDragOffset;
|
|
extern WidgetT *sResizeListView;
|
|
extern int32_t sResizeCol;
|
|
extern int32_t sResizeStartX;
|
|
extern int32_t sResizeOrigW;
|
|
extern WidgetT *sDragSplitter;
|
|
extern int32_t sDragSplitStart;
|
|
extern WidgetT *sDragReorder;
|
|
|
|
// ============================================================
|
|
// Core functions (widgetCore.c)
|
|
// ============================================================
|
|
|
|
void widgetAddChild(WidgetT *parent, WidgetT *child);
|
|
WidgetT *widgetAlloc(WidgetT *parent, WidgetTypeE type);
|
|
void widgetClearFocus(WidgetT *root);
|
|
int32_t widgetCountVisibleChildren(const WidgetT *w);
|
|
void widgetDestroyChildren(WidgetT *w);
|
|
void widgetDropdownPopupRect(WidgetT *w, const BitmapFontT *font, int32_t contentH, int32_t *popX, int32_t *popY, int32_t *popW, int32_t *popH);
|
|
WidgetT *widgetFindByAccel(WidgetT *root, char key);
|
|
WidgetT *widgetFindNextFocusable(WidgetT *root, WidgetT *after);
|
|
WidgetT *widgetFindPrevFocusable(WidgetT *root, WidgetT *before);
|
|
int32_t widgetFrameBorderWidth(const WidgetT *w);
|
|
WidgetT *widgetHitTest(WidgetT *w, int32_t x, int32_t y);
|
|
bool widgetIsFocusable(WidgetTypeE type);
|
|
bool widgetIsBoxContainer(WidgetTypeE type);
|
|
bool widgetIsHorizContainer(WidgetTypeE type);
|
|
int32_t widgetNavigateIndex(int32_t key, int32_t current, int32_t count, int32_t pageSize);
|
|
void widgetPaintPopupList(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, int32_t popX, int32_t popY, int32_t popW, int32_t popH, const char **items, int32_t itemCount, int32_t hoverIdx, int32_t scrollPos);
|
|
void widgetRemoveChild(WidgetT *parent, WidgetT *child);
|
|
void widgetScrollbarThumb(int32_t trackLen, int32_t totalSize, int32_t visibleSize, int32_t scrollPos, int32_t *thumbPos, int32_t *thumbSize);
|
|
|
|
// ============================================================
|
|
// Shared scrollbar functions (widgetScrollbar.c)
|
|
// ============================================================
|
|
|
|
typedef enum {
|
|
ScrollHitNoneE,
|
|
ScrollHitArrowDecE,
|
|
ScrollHitArrowIncE,
|
|
ScrollHitPageDecE,
|
|
ScrollHitPageIncE,
|
|
ScrollHitThumbE
|
|
} ScrollHitE;
|
|
|
|
void widgetDrawScrollbarH(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t sbX, int32_t sbY, int32_t sbW, int32_t totalSize, int32_t visibleSize, int32_t scrollPos);
|
|
void widgetDrawScrollbarV(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t sbX, int32_t sbY, int32_t sbH, int32_t totalSize, int32_t visibleSize, int32_t scrollPos);
|
|
ScrollHitE widgetScrollbarHitTest(int32_t sbLen, int32_t relPos, int32_t totalSize, int32_t visibleSize, int32_t scrollPos);
|
|
|
|
// ============================================================
|
|
// Layout functions (widgetLayout.c)
|
|
// ============================================================
|
|
|
|
void widgetCalcMinSizeBox(WidgetT *w, const BitmapFontT *font);
|
|
void widgetCalcMinSizeTree(WidgetT *w, const BitmapFontT *font);
|
|
void widgetLayoutBox(WidgetT *w, const BitmapFontT *font);
|
|
void widgetLayoutChildren(WidgetT *w, const BitmapFontT *font);
|
|
|
|
// ============================================================
|
|
// Event functions (widgetEvent.c)
|
|
// ============================================================
|
|
|
|
void widgetManageScrollbars(WindowT *win, AppContextT *ctx);
|
|
void widgetOnKey(WindowT *win, int32_t key, int32_t mod);
|
|
void widgetOnMouse(WindowT *win, int32_t x, int32_t y, int32_t buttons);
|
|
void widgetOnPaint(WindowT *win, RectT *dirtyArea);
|
|
void widgetOnResize(WindowT *win, int32_t newW, int32_t newH);
|
|
void widgetOnScroll(WindowT *win, ScrollbarOrientE orient, int32_t value);
|
|
|
|
// ============================================================
|
|
// Paint/ops functions (widgetOps.c)
|
|
// ============================================================
|
|
|
|
void widgetPaintOne(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetPaintOverlays(WidgetT *root, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
|
|
// ============================================================
|
|
// Per-widget paint functions
|
|
// ============================================================
|
|
|
|
void widgetAnsiTermPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetButtonPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetImageButtonPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetCanvasPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetCheckboxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetComboBoxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetComboBoxPaintPopup(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetDropdownPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetDropdownPaintPopup(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetFramePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetImagePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetLabelPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetListBoxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetListViewPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
bool widgetListViewColBorderHit(const WidgetT *w, int32_t vx, int32_t vy);
|
|
void widgetProgressBarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetRadioPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetSeparatorPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetScrollPanePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetSplitterPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetSliderPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetSpinnerPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetStatusBarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetTabControlPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetTextAreaPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetTextInputPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetToolbarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
void widgetTreeViewPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
|
|
|
// ============================================================
|
|
// Per-widget calcMinSize functions
|
|
// ============================================================
|
|
|
|
void widgetAnsiTermCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetButtonCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetImageButtonCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetCanvasCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetCheckboxCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetComboBoxCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetDropdownCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetImageCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetLabelCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetListBoxCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetListViewCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetProgressBarCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetRadioCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetSeparatorCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetScrollPaneCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetSplitterCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetSliderCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetSpinnerCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetSpacerCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetTabControlCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetTextAreaCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetTextInputCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
void widgetTreeViewCalcMinSize(WidgetT *w, const BitmapFontT *font);
|
|
|
|
// ============================================================
|
|
// Per-widget layout functions (for special containers)
|
|
// ============================================================
|
|
|
|
void widgetScrollPaneLayout(WidgetT *w, const BitmapFontT *font);
|
|
void widgetSplitterLayout(WidgetT *w, const BitmapFontT *font);
|
|
void widgetTabControlLayout(WidgetT *w, const BitmapFontT *font);
|
|
void widgetTreeViewLayout(WidgetT *w, const BitmapFontT *font);
|
|
|
|
// ============================================================
|
|
// Per-widget getText/setText functions
|
|
// ============================================================
|
|
|
|
const char *widgetButtonGetText(const WidgetT *w);
|
|
void widgetButtonSetText(WidgetT *w, const char *text);
|
|
const char *widgetCheckboxGetText(const WidgetT *w);
|
|
void widgetCheckboxSetText(WidgetT *w, const char *text);
|
|
const char *widgetComboBoxGetText(const WidgetT *w);
|
|
void widgetComboBoxSetText(WidgetT *w, const char *text);
|
|
const char *widgetDropdownGetText(const WidgetT *w);
|
|
const char *widgetLabelGetText(const WidgetT *w);
|
|
void widgetLabelSetText(WidgetT *w, const char *text);
|
|
const char *widgetRadioGetText(const WidgetT *w);
|
|
void widgetRadioSetText(WidgetT *w, const char *text);
|
|
const char *widgetTextAreaGetText(const WidgetT *w);
|
|
void widgetTextAreaSetText(WidgetT *w, const char *text);
|
|
const char *widgetTextInputGetText(const WidgetT *w);
|
|
void widgetTextInputSetText(WidgetT *w, const char *text);
|
|
const char *widgetTreeItemGetText(const WidgetT *w);
|
|
void widgetTreeItemSetText(WidgetT *w, const char *text);
|
|
|
|
// ============================================================
|
|
// Per-widget destroy functions
|
|
// ============================================================
|
|
|
|
void widgetAnsiTermDestroy(WidgetT *w);
|
|
void widgetCanvasDestroy(WidgetT *w);
|
|
void widgetComboBoxDestroy(WidgetT *w);
|
|
void widgetImageButtonDestroy(WidgetT *w);
|
|
void widgetImageDestroy(WidgetT *w);
|
|
void widgetListBoxDestroy(WidgetT *w);
|
|
void widgetListViewDestroy(WidgetT *w);
|
|
void widgetTextAreaDestroy(WidgetT *w);
|
|
void widgetTextInputDestroy(WidgetT *w);
|
|
|
|
// ============================================================
|
|
// Per-widget mouse/key functions
|
|
// ============================================================
|
|
|
|
void clearOtherSelections(WidgetT *except);
|
|
void clipboardCopy(const char *text, int32_t len);
|
|
const char *clipboardGet(int32_t *outLen);
|
|
bool isWordChar(char c);
|
|
int32_t multiClickDetect(int32_t vx, int32_t vy);
|
|
void widgetAnsiTermOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetAnsiTermOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetButtonOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetButtonOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetCanvasOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetCheckboxOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetCheckboxOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetComboBoxOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetComboBoxOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetDropdownOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetDropdownOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetImageButtonOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetImageButtonOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetImageOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetListBoxOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetListBoxOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetListViewOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetListViewOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetRadioOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetRadioOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetScrollPaneOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetScrollPaneOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetSplitterClampPos(WidgetT *w, int32_t *pos);
|
|
void widgetSplitterOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetSliderOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetSliderOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetSpinnerOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetSpinnerOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
const char *widgetSpinnerGetText(const WidgetT *w);
|
|
void widgetSpinnerSetText(WidgetT *w, const char *text);
|
|
void widgetTabControlOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetTabControlOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetTextAreaOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetTextAreaOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetTextDragUpdate(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
void widgetTextEditOnKey(WidgetT *w, int32_t key, int32_t mod, char *buf, int32_t bufSize, int32_t *pLen, int32_t *pCursor, int32_t *pScrollOff, int32_t *pSelStart, int32_t *pSelEnd, char *undoBuf, int32_t *pUndoLen, int32_t *pUndoCursor);
|
|
void widgetTextInputOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetTextInputOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
int32_t wordEnd(const char *buf, int32_t len, int32_t pos);
|
|
int32_t wordStart(const char *buf, int32_t pos);
|
|
void widgetTreeViewOnKey(WidgetT *w, int32_t key, int32_t mod);
|
|
void widgetTreeViewOnMouse(WidgetT *w, WidgetT *root, int32_t vx, int32_t vy);
|
|
|
|
// Drag-reorder helpers (dispatch to ListBox/ListView/TreeView)
|
|
void widgetReorderUpdate(WidgetT *w, WidgetT *root, int32_t x, int32_t y);
|
|
void widgetReorderDrop(WidgetT *w);
|
|
WidgetT *widgetTreeViewNextVisible(WidgetT *item, WidgetT *treeView);
|
|
|
|
#endif // WIDGET_INTERNAL_H
|