Reformatted wrapped lines of code.
This commit is contained in:
parent
90c6ab68e3
commit
10b49868cd
27 changed files with 73 additions and 159 deletions
16
dvx/dvxApp.c
16
dvx/dvxApp.c
|
|
@ -316,11 +316,7 @@ static void dispatchEvents(AppContextT *ctx) {
|
||||||
static void drawCursorAt(AppContextT *ctx, int32_t x, int32_t y) {
|
static void drawCursorAt(AppContextT *ctx, int32_t x, int32_t y) {
|
||||||
const CursorT *cur = &ctx->cursors[ctx->cursorId];
|
const CursorT *cur = &ctx->cursors[ctx->cursorId];
|
||||||
|
|
||||||
drawMaskedBitmap(&ctx->display, &ctx->blitOps,
|
drawMaskedBitmap(&ctx->display, &ctx->blitOps, x - cur->hotX, y - cur->hotY, cur->width, cur->height, cur->andMask, cur->xorData, ctx->cursorFg, ctx->cursorBg);
|
||||||
x - cur->hotX, y - cur->hotY,
|
|
||||||
cur->width, cur->height,
|
|
||||||
cur->andMask, cur->xorData,
|
|
||||||
ctx->cursorFg, ctx->cursorBg);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -328,11 +324,8 @@ static void drawCursorAt(AppContextT *ctx, int32_t x, int32_t y) {
|
||||||
// dvxCreateWindow
|
// dvxCreateWindow
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
WindowT *dvxCreateWindow(AppContextT *ctx, const char *title,
|
WindowT *dvxCreateWindow(AppContextT *ctx, const char *title, int32_t x, int32_t y, int32_t w, int32_t h, bool resizable) {
|
||||||
int32_t x, int32_t y, int32_t w, int32_t h,
|
WindowT *win = wmCreateWindow(&ctx->stack, &ctx->display, title, x, y, w, h, resizable);
|
||||||
bool resizable) {
|
|
||||||
WindowT *win = wmCreateWindow(&ctx->stack, &ctx->display,
|
|
||||||
title, x, y, w, h, resizable);
|
|
||||||
|
|
||||||
if (win) {
|
if (win) {
|
||||||
// Raise and focus
|
// Raise and focus
|
||||||
|
|
@ -451,8 +444,7 @@ int32_t dvxInit(AppContextT *ctx, int32_t requestedW, int32_t requestedH, int32_
|
||||||
// dvxInvalidateRect
|
// dvxInvalidateRect
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void dvxInvalidateRect(AppContextT *ctx, WindowT *win,
|
void dvxInvalidateRect(AppContextT *ctx, WindowT *win, int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||||
int32_t x, int32_t y, int32_t w, int32_t h) {
|
|
||||||
// Convert from content-relative to screen coordinates
|
// Convert from content-relative to screen coordinates
|
||||||
int32_t screenX = win->x + win->contentX + x;
|
int32_t screenX = win->x + win->contentX + x;
|
||||||
int32_t screenY = win->y + win->contentY + y;
|
int32_t screenY = win->y + win->contentY + y;
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,7 @@ WindowT *dvxCreateWindow(AppContextT *ctx, const char *title,
|
||||||
void dvxDestroyWindow(AppContextT *ctx, WindowT *win);
|
void dvxDestroyWindow(AppContextT *ctx, WindowT *win);
|
||||||
|
|
||||||
// Invalidate a region of a window's content area (triggers repaint)
|
// Invalidate a region of a window's content area (triggers repaint)
|
||||||
void dvxInvalidateRect(AppContextT *ctx, WindowT *win,
|
void dvxInvalidateRect(AppContextT *ctx, WindowT *win, int32_t x, int32_t y, int32_t w, int32_t h);
|
||||||
int32_t x, int32_t y, int32_t w, int32_t h);
|
|
||||||
|
|
||||||
// Invalidate entire window content
|
// Invalidate entire window content
|
||||||
void dvxInvalidateWindow(AppContextT *ctx, WindowT *win);
|
void dvxInvalidateWindow(AppContextT *ctx, WindowT *win);
|
||||||
|
|
|
||||||
|
|
@ -11,31 +11,23 @@ void drawInit(BlitOpsT *ops, const DisplayT *d);
|
||||||
void rectFill(DisplayT *d, const BlitOpsT *ops, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color);
|
void rectFill(DisplayT *d, const BlitOpsT *ops, int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color);
|
||||||
|
|
||||||
// Copy rectangle from source buffer to backbuffer (clips to display clip rect)
|
// Copy rectangle from source buffer to backbuffer (clips to display clip rect)
|
||||||
void rectCopy(DisplayT *d, const BlitOpsT *ops, int32_t dstX, int32_t dstY,
|
void rectCopy(DisplayT *d, const BlitOpsT *ops, int32_t dstX, int32_t dstY, const uint8_t *srcBuf, int32_t srcPitch, int32_t srcX, int32_t srcY, int32_t w, int32_t h);
|
||||||
const uint8_t *srcBuf, int32_t srcPitch, int32_t srcX, int32_t srcY,
|
|
||||||
int32_t w, int32_t h);
|
|
||||||
|
|
||||||
// Draw a beveled frame
|
// Draw a beveled frame
|
||||||
void drawBevel(DisplayT *d, const BlitOpsT *ops, int32_t x, int32_t y, int32_t w, int32_t h,
|
void drawBevel(DisplayT *d, const BlitOpsT *ops, int32_t x, int32_t y, int32_t w, int32_t h, const BevelStyleT *style);
|
||||||
const BevelStyleT *style);
|
|
||||||
|
|
||||||
// Draw a single character, returns advance width
|
// Draw a single character, returns advance width
|
||||||
int32_t drawChar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
int32_t drawChar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, int32_t x, int32_t y, char ch, uint32_t fg, uint32_t bg, bool opaque);
|
||||||
int32_t x, int32_t y, char ch, uint32_t fg, uint32_t bg, bool opaque);
|
|
||||||
|
|
||||||
// Draw a null-terminated string
|
// Draw a null-terminated string
|
||||||
void drawText(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
void drawText(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, int32_t x, int32_t y, const char *text, uint32_t fg, uint32_t bg, bool opaque);
|
||||||
int32_t x, int32_t y, const char *text, uint32_t fg, uint32_t bg, bool opaque);
|
|
||||||
|
|
||||||
// Measure text width in pixels
|
// Measure text width in pixels
|
||||||
int32_t textWidth(const BitmapFontT *font, const char *text);
|
int32_t textWidth(const BitmapFontT *font, const char *text);
|
||||||
|
|
||||||
// Draw a 1-bit bitmap with mask (for cursors, icons)
|
// Draw a 1-bit bitmap with mask (for cursors, icons)
|
||||||
// andMask/xorData are arrays of uint16_t, one per row
|
// andMask/xorData are arrays of uint16_t, one per row
|
||||||
void drawMaskedBitmap(DisplayT *d, const BlitOpsT *ops,
|
void drawMaskedBitmap(DisplayT *d, const BlitOpsT *ops, int32_t x, int32_t y, int32_t w, int32_t h, const uint16_t *andMask, const uint16_t *xorData, uint32_t fgColor, uint32_t bgColor);
|
||||||
int32_t x, int32_t y, int32_t w, int32_t h,
|
|
||||||
const uint16_t *andMask, const uint16_t *xorData,
|
|
||||||
uint32_t fgColor, uint32_t bgColor);
|
|
||||||
|
|
||||||
// Horizontal line
|
// Horizontal line
|
||||||
void drawHLine(DisplayT *d, const BlitOpsT *ops, int32_t x, int32_t y, int32_t w, uint32_t color);
|
void drawHLine(DisplayT *d, const BlitOpsT *ops, int32_t x, int32_t y, int32_t w, uint32_t color);
|
||||||
|
|
|
||||||
|
|
@ -27,8 +27,7 @@ static int32_t setVesaMode(uint16_t mode);
|
||||||
// findBestMode
|
// findBestMode
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static int32_t findBestMode(int32_t requestedW, int32_t requestedH, int32_t preferredBpp,
|
static int32_t findBestMode(int32_t requestedW, int32_t requestedH, int32_t preferredBpp, uint16_t *outMode, DisplayT *d) {
|
||||||
uint16_t *outMode, DisplayT *d) {
|
|
||||||
__dpmi_regs r;
|
__dpmi_regs r;
|
||||||
uint16_t bestMode = 0;
|
uint16_t bestMode = 0;
|
||||||
int32_t bestScore = -1;
|
int32_t bestScore = -1;
|
||||||
|
|
@ -119,8 +118,7 @@ static int32_t findBestMode(int32_t requestedW, int32_t requestedH, int32_t pref
|
||||||
// getModeInfo
|
// getModeInfo
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void getModeInfo(uint16_t mode, DisplayT *d, int32_t *score,
|
static void getModeInfo(uint16_t mode, DisplayT *d, int32_t *score, int32_t requestedW, int32_t requestedH, int32_t preferredBpp) {
|
||||||
int32_t requestedW, int32_t requestedH, int32_t preferredBpp) {
|
|
||||||
__dpmi_regs r;
|
__dpmi_regs r;
|
||||||
|
|
||||||
*score = -1;
|
*score = -1;
|
||||||
|
|
|
||||||
|
|
@ -461,11 +461,9 @@ void wgtSetDebugLayout(bool enabled);
|
||||||
int32_t wgtResolveSize(int32_t taggedSize, int32_t parentSize, int32_t charWidth);
|
int32_t wgtResolveSize(int32_t taggedSize, int32_t parentSize, int32_t charWidth);
|
||||||
|
|
||||||
// Run layout on the entire widget tree
|
// Run layout on the entire widget tree
|
||||||
void wgtLayout(WidgetT *root, int32_t availW, int32_t availH,
|
void wgtLayout(WidgetT *root, int32_t availW, int32_t availH, const BitmapFontT *font);
|
||||||
const BitmapFontT *font);
|
|
||||||
|
|
||||||
// Paint the entire widget tree
|
// Paint the entire widget tree
|
||||||
void wgtPaint(WidgetT *root, DisplayT *d, const BlitOpsT *ops,
|
void wgtPaint(WidgetT *root, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors);
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors);
|
|
||||||
|
|
||||||
#endif // DVX_WIDGET_H
|
#endif // DVX_WIDGET_H
|
||||||
|
|
|
||||||
75
dvx/dvxWm.c
75
dvx/dvxWm.c
|
|
@ -15,23 +15,14 @@
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void computeMenuBarPositions(WindowT *win, const BitmapFontT *font);
|
static void computeMenuBarPositions(WindowT *win, const BitmapFontT *font);
|
||||||
static void drawBorderFrame(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
static void drawBorderFrame(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t x, int32_t y, int32_t w, int32_t h);
|
||||||
int32_t x, int32_t y, int32_t w, int32_t h);
|
static void drawMenuBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, WindowT *win);
|
||||||
static void drawMenuBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
static void drawResizeBreaks(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, WindowT *win);
|
||||||
const ColorSchemeT *colors, WindowT *win);
|
static void drawScaledRect(DisplayT *d, int32_t dstX, int32_t dstY, int32_t dstW, int32_t dstH, const uint8_t *src, int32_t srcW, int32_t srcH, int32_t srcPitch, int32_t bpp);
|
||||||
static void drawResizeBreaks(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
static void drawScrollbar(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, const ScrollbarT *sb, int32_t winX, int32_t winY);
|
||||||
WindowT *win);
|
static void drawScrollbarArrow(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t x, int32_t y, int32_t size, int32_t dir);
|
||||||
static void drawScaledRect(DisplayT *d, int32_t dstX, int32_t dstY, int32_t dstW, int32_t dstH,
|
static void drawTitleBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, WindowT *win);
|
||||||
const uint8_t *src, int32_t srcW, int32_t srcH, int32_t srcPitch,
|
static void drawTitleGadget(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t x, int32_t y, int32_t size);
|
||||||
int32_t bpp);
|
|
||||||
static void drawScrollbar(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
|
||||||
const ScrollbarT *sb, int32_t winX, int32_t winY);
|
|
||||||
static void drawScrollbarArrow(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
|
||||||
int32_t x, int32_t y, int32_t size, int32_t dir);
|
|
||||||
static void drawTitleBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
|
||||||
const ColorSchemeT *colors, WindowT *win);
|
|
||||||
static void drawTitleGadget(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
|
||||||
int32_t x, int32_t y, int32_t size);
|
|
||||||
static void minimizedIconPos(const DisplayT *d, int32_t index, int32_t *x, int32_t *y);
|
static void minimizedIconPos(const DisplayT *d, int32_t index, int32_t *x, int32_t *y);
|
||||||
static int32_t scrollbarThumbInfo(const ScrollbarT *sb, int32_t *thumbPos, int32_t *thumbSize);
|
static int32_t scrollbarThumbInfo(const ScrollbarT *sb, int32_t *thumbPos, int32_t *thumbSize);
|
||||||
static void wmMinWindowSize(const WindowT *win, int32_t *minW, int32_t *minH);
|
static void wmMinWindowSize(const WindowT *win, int32_t *minW, int32_t *minH);
|
||||||
|
|
@ -69,8 +60,7 @@ static void computeMenuBarPositions(WindowT *win, const BitmapFontT *font) {
|
||||||
// Top/Left, outside to inside: highlight, highlight, face, shadow
|
// Top/Left, outside to inside: highlight, highlight, face, shadow
|
||||||
// Bottom/Right, outside to inside: shadow, shadow, face, highlight
|
// Bottom/Right, outside to inside: shadow, shadow, face, highlight
|
||||||
|
|
||||||
static void drawBorderFrame(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
static void drawBorderFrame(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t x, int32_t y, int32_t w, int32_t h) {
|
||||||
int32_t x, int32_t y, int32_t w, int32_t h) {
|
|
||||||
uint32_t hi = colors->windowHighlight;
|
uint32_t hi = colors->windowHighlight;
|
||||||
uint32_t face = colors->windowFace;
|
uint32_t face = colors->windowFace;
|
||||||
uint32_t sh = colors->windowShadow;
|
uint32_t sh = colors->windowShadow;
|
||||||
|
|
@ -109,8 +99,7 @@ static void drawBorderFrame(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT
|
||||||
// ============================================================
|
// ============================================================
|
||||||
// Draws a small raised beveled square gadget (GEOS Motif style).
|
// Draws a small raised beveled square gadget (GEOS Motif style).
|
||||||
|
|
||||||
static void drawTitleGadget(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
static void drawTitleGadget(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t x, int32_t y, int32_t size) {
|
||||||
int32_t x, int32_t y, int32_t size) {
|
|
||||||
BevelStyleT bevel;
|
BevelStyleT bevel;
|
||||||
bevel.highlight = colors->windowHighlight;
|
bevel.highlight = colors->windowHighlight;
|
||||||
bevel.shadow = colors->windowShadow;
|
bevel.shadow = colors->windowShadow;
|
||||||
|
|
@ -124,8 +113,7 @@ static void drawTitleGadget(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT
|
||||||
// drawMenuBar
|
// drawMenuBar
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void drawMenuBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
static void drawMenuBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, WindowT *win) {
|
||||||
const ColorSchemeT *colors, WindowT *win) {
|
|
||||||
if (!win->menuBar) {
|
if (!win->menuBar) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -162,8 +150,7 @@ static void drawMenuBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *fon
|
||||||
// Each groove is a shadow+highlight line pair cutting across the
|
// Each groove is a shadow+highlight line pair cutting across the
|
||||||
// border width, perpendicular to the edge direction.
|
// border width, perpendicular to the edge direction.
|
||||||
|
|
||||||
static void drawResizeBreaks(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
static void drawResizeBreaks(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, WindowT *win) {
|
||||||
WindowT *win) {
|
|
||||||
if (!win->resizable) {
|
if (!win->resizable) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -213,9 +200,7 @@ static void drawResizeBreaks(DisplayT *d, const BlitOpsT *ops, const ColorScheme
|
||||||
// drawScaledRect
|
// drawScaledRect
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void drawScaledRect(DisplayT *d, int32_t dstX, int32_t dstY, int32_t dstW, int32_t dstH,
|
static void drawScaledRect(DisplayT *d, int32_t dstX, int32_t dstY, int32_t dstW, int32_t dstH, const uint8_t *src, int32_t srcW, int32_t srcH, int32_t srcPitch, int32_t bpp) {
|
||||||
const uint8_t *src, int32_t srcW, int32_t srcH, int32_t srcPitch,
|
|
||||||
int32_t bpp) {
|
|
||||||
for (int32_t dy = 0; dy < dstH; dy++) {
|
for (int32_t dy = 0; dy < dstH; dy++) {
|
||||||
int32_t sy = (dy * srcH) / dstH;
|
int32_t sy = (dy * srcH) / dstH;
|
||||||
int32_t screenY = dstY + dy;
|
int32_t screenY = dstY + dy;
|
||||||
|
|
@ -254,8 +239,7 @@ static void drawScaledRect(DisplayT *d, int32_t dstX, int32_t dstY, int32_t dstW
|
||||||
// drawScrollbar
|
// drawScrollbar
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void drawScrollbar(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
static void drawScrollbar(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, const ScrollbarT *sb, int32_t winX, int32_t winY) {
|
||||||
const ScrollbarT *sb, int32_t winX, int32_t winY) {
|
|
||||||
int32_t x = winX + sb->x;
|
int32_t x = winX + sb->x;
|
||||||
int32_t y = winY + sb->y;
|
int32_t y = winY + sb->y;
|
||||||
|
|
||||||
|
|
@ -328,8 +312,7 @@ static void drawScrollbar(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *
|
||||||
// Draws a small triangle arrow glyph inside a scrollbar button.
|
// Draws a small triangle arrow glyph inside a scrollbar button.
|
||||||
// dir: 0=up, 1=down, 2=left, 3=right
|
// dir: 0=up, 1=down, 2=left, 3=right
|
||||||
|
|
||||||
static void drawScrollbarArrow(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
static void drawScrollbarArrow(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, int32_t x, int32_t y, int32_t size, int32_t dir) {
|
||||||
int32_t x, int32_t y, int32_t size, int32_t dir) {
|
|
||||||
int32_t cx = x + size / 2;
|
int32_t cx = x + size / 2;
|
||||||
int32_t cy = y + size / 2;
|
int32_t cy = y + size / 2;
|
||||||
uint32_t fg = colors->contentFg;
|
uint32_t fg = colors->contentFg;
|
||||||
|
|
@ -361,8 +344,7 @@ static void drawScrollbarArrow(DisplayT *d, const BlitOpsT *ops, const ColorSche
|
||||||
// drawTitleBar
|
// drawTitleBar
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void drawTitleBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
static void drawTitleBar(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, WindowT *win) {
|
||||||
const ColorSchemeT *colors, WindowT *win) {
|
|
||||||
int32_t titleX = win->x + CHROME_BORDER_WIDTH;
|
int32_t titleX = win->x + CHROME_BORDER_WIDTH;
|
||||||
int32_t titleY = win->y + CHROME_BORDER_WIDTH;
|
int32_t titleY = win->y + CHROME_BORDER_WIDTH;
|
||||||
int32_t titleW = win->w - CHROME_BORDER_WIDTH * 2;
|
int32_t titleW = win->w - CHROME_BORDER_WIDTH * 2;
|
||||||
|
|
@ -621,9 +603,7 @@ ScrollbarT *wmAddVScrollbar(WindowT *win, int32_t min, int32_t max, int32_t page
|
||||||
// wmCreateWindow
|
// wmCreateWindow
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
WindowT *wmCreateWindow(WindowStackT *stack, DisplayT *d,
|
WindowT *wmCreateWindow(WindowStackT *stack, DisplayT *d, const char *title, int32_t x, int32_t y, int32_t w, int32_t h, bool resizable) {
|
||||||
const char *title, int32_t x, int32_t y,
|
|
||||||
int32_t w, int32_t h, bool resizable) {
|
|
||||||
if (stack->count >= MAX_WINDOWS) {
|
if (stack->count >= MAX_WINDOWS) {
|
||||||
fprintf(stderr, "WM: Maximum windows (%d) reached\n", MAX_WINDOWS);
|
fprintf(stderr, "WM: Maximum windows (%d) reached\n", MAX_WINDOWS);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -778,8 +758,7 @@ void wmDragMove(WindowStackT *stack, DirtyListT *dl, int32_t mouseX, int32_t mou
|
||||||
// wmDrawChrome
|
// wmDrawChrome
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wmDrawChrome(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
void wmDrawChrome(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, WindowT *win, const RectT *clipTo) {
|
||||||
const ColorSchemeT *colors, WindowT *win, const RectT *clipTo) {
|
|
||||||
// Save and set clip rect
|
// Save and set clip rect
|
||||||
int32_t savedClipX = d->clipX;
|
int32_t savedClipX = d->clipX;
|
||||||
int32_t savedClipY = d->clipY;
|
int32_t savedClipY = d->clipY;
|
||||||
|
|
@ -872,8 +851,7 @@ void wmDrawContent(DisplayT *d, const BlitOpsT *ops, WindowT *win, const RectT *
|
||||||
// wmDrawMinimizedIcons
|
// wmDrawMinimizedIcons
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wmDrawMinimizedIcons(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
void wmDrawMinimizedIcons(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, const WindowStackT *stack, const RectT *clipTo) {
|
||||||
const WindowStackT *stack, const RectT *clipTo) {
|
|
||||||
int32_t iconIdx = 0;
|
int32_t iconIdx = 0;
|
||||||
|
|
||||||
for (int32_t i = 0; i < stack->count; i++) {
|
for (int32_t i = 0; i < stack->count; i++) {
|
||||||
|
|
@ -927,8 +905,7 @@ void wmDrawMinimizedIcons(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *
|
||||||
// wmDrawScrollbars
|
// wmDrawScrollbars
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wmDrawScrollbars(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
void wmDrawScrollbars(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, WindowT *win, const RectT *clipTo) {
|
||||||
WindowT *win, const RectT *clipTo) {
|
|
||||||
int32_t savedClipX = d->clipX;
|
int32_t savedClipX = d->clipX;
|
||||||
int32_t savedClipY = d->clipY;
|
int32_t savedClipY = d->clipY;
|
||||||
int32_t savedClipW = d->clipW;
|
int32_t savedClipW = d->clipW;
|
||||||
|
|
@ -1162,8 +1139,7 @@ void wmMinimize(WindowStackT *stack, DirtyListT *dl, WindowT *win) {
|
||||||
// wmMinimizedIconHit
|
// wmMinimizedIconHit
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
int32_t wmMinimizedIconHit(const WindowStackT *stack, const DisplayT *d,
|
int32_t wmMinimizedIconHit(const WindowStackT *stack, const DisplayT *d, int32_t mx, int32_t my) {
|
||||||
int32_t mx, int32_t my) {
|
|
||||||
int32_t iconIdx = 0;
|
int32_t iconIdx = 0;
|
||||||
|
|
||||||
for (int32_t i = 0; i < stack->count; i++) {
|
for (int32_t i = 0; i < stack->count; i++) {
|
||||||
|
|
@ -1344,8 +1320,7 @@ int32_t wmReallocContentBuf(WindowT *win, const DisplayT *d) {
|
||||||
// wmResizeBegin
|
// wmResizeBegin
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wmResizeBegin(WindowStackT *stack, int32_t idx, int32_t edge,
|
void wmResizeBegin(WindowStackT *stack, int32_t idx, int32_t edge, int32_t mouseX, int32_t mouseY) {
|
||||||
int32_t mouseX, int32_t mouseY) {
|
|
||||||
stack->resizeWindow = idx;
|
stack->resizeWindow = idx;
|
||||||
stack->resizeEdge = edge;
|
stack->resizeEdge = edge;
|
||||||
stack->dragOffX = mouseX;
|
stack->dragOffX = mouseX;
|
||||||
|
|
@ -1395,8 +1370,7 @@ void wmResizeEnd(WindowStackT *stack) {
|
||||||
// wmResizeMove
|
// wmResizeMove
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wmResizeMove(WindowStackT *stack, DirtyListT *dl, const DisplayT *d,
|
void wmResizeMove(WindowStackT *stack, DirtyListT *dl, const DisplayT *d, int32_t mouseX, int32_t mouseY) {
|
||||||
int32_t mouseX, int32_t mouseY) {
|
|
||||||
if (stack->resizeWindow < 0 || stack->resizeWindow >= stack->count) {
|
if (stack->resizeWindow < 0 || stack->resizeWindow >= stack->count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -1567,8 +1541,7 @@ void wmRestoreMinimized(WindowStackT *stack, DirtyListT *dl, WindowT *win) {
|
||||||
// wmScrollbarClick
|
// wmScrollbarClick
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wmScrollbarClick(WindowStackT *stack, DirtyListT *dl, int32_t idx,
|
void wmScrollbarClick(WindowStackT *stack, DirtyListT *dl, int32_t idx, int32_t orient, int32_t mx, int32_t my) {
|
||||||
int32_t orient, int32_t mx, int32_t my) {
|
|
||||||
if (idx < 0 || idx >= stack->count) {
|
if (idx < 0 || idx >= stack->count) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
25
dvx/dvxWm.h
25
dvx/dvxWm.h
|
|
@ -8,9 +8,7 @@
|
||||||
void wmInit(WindowStackT *stack);
|
void wmInit(WindowStackT *stack);
|
||||||
|
|
||||||
// Create a new window and add it to the stack (raised to top)
|
// Create a new window and add it to the stack (raised to top)
|
||||||
WindowT *wmCreateWindow(WindowStackT *stack, DisplayT *d,
|
WindowT *wmCreateWindow(WindowStackT *stack, DisplayT *d, const char *title, int32_t x, int32_t y, int32_t w, int32_t h, bool resizable);
|
||||||
const char *title, int32_t x, int32_t y,
|
|
||||||
int32_t w, int32_t h, bool resizable);
|
|
||||||
|
|
||||||
// Destroy a window and remove from stack
|
// Destroy a window and remove from stack
|
||||||
void wmDestroyWindow(WindowStackT *stack, WindowT *win);
|
void wmDestroyWindow(WindowStackT *stack, WindowT *win);
|
||||||
|
|
@ -46,19 +44,16 @@ ScrollbarT *wmAddVScrollbar(WindowT *win, int32_t min, int32_t max, int32_t page
|
||||||
ScrollbarT *wmAddHScrollbar(WindowT *win, int32_t min, int32_t max, int32_t pageSize);
|
ScrollbarT *wmAddHScrollbar(WindowT *win, int32_t min, int32_t max, int32_t pageSize);
|
||||||
|
|
||||||
// Draw window chrome (frame, title bar, menu bar) clipped to a dirty rect
|
// Draw window chrome (frame, title bar, menu bar) clipped to a dirty rect
|
||||||
void wmDrawChrome(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font,
|
void wmDrawChrome(DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, WindowT *win, const RectT *clipTo);
|
||||||
const ColorSchemeT *colors, WindowT *win, const RectT *clipTo);
|
|
||||||
|
|
||||||
// Draw window content clipped to a dirty rect
|
// Draw window content clipped to a dirty rect
|
||||||
void wmDrawContent(DisplayT *d, const BlitOpsT *ops, WindowT *win, const RectT *clipTo);
|
void wmDrawContent(DisplayT *d, const BlitOpsT *ops, WindowT *win, const RectT *clipTo);
|
||||||
|
|
||||||
// Draw scrollbars for a window
|
// Draw scrollbars for a window
|
||||||
void wmDrawScrollbars(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
void wmDrawScrollbars(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, WindowT *win, const RectT *clipTo);
|
||||||
WindowT *win, const RectT *clipTo);
|
|
||||||
|
|
||||||
// Draw minimized window icons at bottom of screen
|
// Draw minimized window icons at bottom of screen
|
||||||
void wmDrawMinimizedIcons(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors,
|
void wmDrawMinimizedIcons(DisplayT *d, const BlitOpsT *ops, const ColorSchemeT *colors, const WindowStackT *stack, const RectT *clipTo);
|
||||||
const WindowStackT *stack, const RectT *clipTo);
|
|
||||||
|
|
||||||
// Hit test: which part of which window is at screen position (mx, my)?
|
// Hit test: which part of which window is at screen position (mx, my)?
|
||||||
// Returns stack index or -1 if no window hit
|
// Returns stack index or -1 if no window hit
|
||||||
|
|
@ -73,8 +68,7 @@ int32_t wmResizeEdgeHit(const WindowT *win, int32_t mx, int32_t my);
|
||||||
void wmDragMove(WindowStackT *stack, DirtyListT *dl, int32_t mouseX, int32_t mouseY);
|
void wmDragMove(WindowStackT *stack, DirtyListT *dl, int32_t mouseX, int32_t mouseY);
|
||||||
|
|
||||||
// Handle window resize (call each mouse move during resize)
|
// Handle window resize (call each mouse move during resize)
|
||||||
void wmResizeMove(WindowStackT *stack, DirtyListT *dl, const DisplayT *d,
|
void wmResizeMove(WindowStackT *stack, DirtyListT *dl, const DisplayT *d, int32_t mouseX, int32_t mouseY);
|
||||||
int32_t mouseX, int32_t mouseY);
|
|
||||||
|
|
||||||
// Begin dragging a window
|
// Begin dragging a window
|
||||||
void wmDragBegin(WindowStackT *stack, int32_t idx, int32_t mouseX, int32_t mouseY);
|
void wmDragBegin(WindowStackT *stack, int32_t idx, int32_t mouseX, int32_t mouseY);
|
||||||
|
|
@ -83,8 +77,7 @@ void wmDragBegin(WindowStackT *stack, int32_t idx, int32_t mouseX, int32_t mouse
|
||||||
void wmDragEnd(WindowStackT *stack);
|
void wmDragEnd(WindowStackT *stack);
|
||||||
|
|
||||||
// Begin resizing a window
|
// Begin resizing a window
|
||||||
void wmResizeBegin(WindowStackT *stack, int32_t idx, int32_t edge,
|
void wmResizeBegin(WindowStackT *stack, int32_t idx, int32_t edge, int32_t mouseX, int32_t mouseY);
|
||||||
int32_t mouseX, int32_t mouseY);
|
|
||||||
|
|
||||||
// End resizing
|
// End resizing
|
||||||
void wmResizeEnd(WindowStackT *stack);
|
void wmResizeEnd(WindowStackT *stack);
|
||||||
|
|
@ -93,8 +86,7 @@ void wmResizeEnd(WindowStackT *stack);
|
||||||
void wmSetTitle(WindowT *win, DirtyListT *dl, const char *title);
|
void wmSetTitle(WindowT *win, DirtyListT *dl, const char *title);
|
||||||
|
|
||||||
// Handle scrollbar click (arrow buttons, trough, or begin thumb drag)
|
// Handle scrollbar click (arrow buttons, trough, or begin thumb drag)
|
||||||
void wmScrollbarClick(WindowStackT *stack, DirtyListT *dl, int32_t idx,
|
void wmScrollbarClick(WindowStackT *stack, DirtyListT *dl, int32_t idx, int32_t orient, int32_t mx, int32_t my);
|
||||||
int32_t orient, int32_t mx, int32_t my);
|
|
||||||
|
|
||||||
// Handle ongoing scrollbar thumb drag
|
// Handle ongoing scrollbar thumb drag
|
||||||
void wmScrollbarDrag(WindowStackT *stack, DirtyListT *dl, int32_t mx, int32_t my);
|
void wmScrollbarDrag(WindowStackT *stack, DirtyListT *dl, int32_t mx, int32_t my);
|
||||||
|
|
@ -110,8 +102,7 @@ void wmMinimize(WindowStackT *stack, DirtyListT *dl, WindowT *win);
|
||||||
|
|
||||||
// Hit-test minimized icons at bottom of screen
|
// Hit-test minimized icons at bottom of screen
|
||||||
// Returns stack index of the minimized window, or -1
|
// Returns stack index of the minimized window, or -1
|
||||||
int32_t wmMinimizedIconHit(const WindowStackT *stack, const DisplayT *d,
|
int32_t wmMinimizedIconHit(const WindowStackT *stack, const DisplayT *d, int32_t mx, int32_t my);
|
||||||
int32_t mx, int32_t my);
|
|
||||||
|
|
||||||
// Restore a maximized window to its pre-maximize geometry
|
// Restore a maximized window to its pre-maximize geometry
|
||||||
void wmRestore(WindowStackT *stack, DirtyListT *dl, const DisplayT *d, WindowT *win);
|
void wmRestore(WindowStackT *stack, DirtyListT *dl, const DisplayT *d, WindowT *win);
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,7 @@
|
||||||
// widgetFramePaint
|
// widgetFramePaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetFramePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetFramePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
int32_t fb = widgetFrameBorderWidth(w);
|
int32_t fb = widgetFrameBorderWidth(w);
|
||||||
int32_t boxY = w->y + font->charHeight / 2;
|
int32_t boxY = w->y + font->charHeight / 2;
|
||||||
int32_t boxH = w->h - font->charHeight / 2;
|
int32_t boxH = w->h - font->charHeight / 2;
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,7 @@ void widgetButtonOnMouse(WidgetT *hit) {
|
||||||
// widgetButtonPaint
|
// widgetButtonPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetButtonPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetButtonPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
uint32_t bgFace = w->bgColor ? w->bgColor : colors->buttonFace;
|
uint32_t bgFace = w->bgColor ? w->bgColor : colors->buttonFace;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -441,8 +441,7 @@ void widgetCanvasOnMouse(WidgetT *hit, int32_t vx, int32_t vy) {
|
||||||
// widgetCanvasPaint
|
// widgetCanvasPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetCanvasPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetCanvasPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
(void)font;
|
(void)font;
|
||||||
|
|
||||||
if (!w->as.canvas.data) {
|
if (!w->as.canvas.data) {
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,7 @@ void widgetCheckboxOnMouse(WidgetT *hit) {
|
||||||
// widgetCheckboxPaint
|
// widgetCheckboxPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetCheckboxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetCheckboxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
int32_t boxY = w->y + (w->h - CHECKBOX_BOX_SIZE) / 2;
|
int32_t boxY = w->y + (w->h - CHECKBOX_BOX_SIZE) / 2;
|
||||||
|
|
|
||||||
|
|
@ -138,8 +138,7 @@ void widgetComboBoxOnMouse(WidgetT *hit, WidgetT *root, int32_t vx) {
|
||||||
// widgetComboBoxPaint
|
// widgetComboBoxPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetComboBoxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetComboBoxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
|
|
||||||
|
|
@ -202,8 +201,7 @@ void widgetComboBoxPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
||||||
// widgetComboBoxPaintPopup
|
// widgetComboBoxPaintPopup
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetComboBoxPaintPopup(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetComboBoxPaintPopup(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
int32_t popX;
|
int32_t popX;
|
||||||
int32_t popY;
|
int32_t popY;
|
||||||
int32_t popW;
|
int32_t popW;
|
||||||
|
|
|
||||||
|
|
@ -124,8 +124,7 @@ void widgetDestroyChildren(WidgetT *w) {
|
||||||
//
|
//
|
||||||
// Calculate the rectangle for a dropdown/combobox popup list.
|
// Calculate the rectangle for a dropdown/combobox popup list.
|
||||||
|
|
||||||
void widgetDropdownPopupRect(WidgetT *w, const BitmapFontT *font, int32_t contentH,
|
void widgetDropdownPopupRect(WidgetT *w, const BitmapFontT *font, int32_t contentH, int32_t *popX, int32_t *popY, int32_t *popW, int32_t *popH) {
|
||||||
int32_t *popX, int32_t *popY, int32_t *popW, int32_t *popH) {
|
|
||||||
int32_t itemCount = 0;
|
int32_t itemCount = 0;
|
||||||
|
|
||||||
if (w->type == WidgetDropdownE) {
|
if (w->type == WidgetDropdownE) {
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,7 @@ void widgetDropdownOnMouse(WidgetT *hit) {
|
||||||
// widgetDropdownPaint
|
// widgetDropdownPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetDropdownPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetDropdownPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
|
|
||||||
|
|
@ -142,8 +141,7 @@ void widgetDropdownPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
||||||
// widgetDropdownPaintPopup
|
// widgetDropdownPaintPopup
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetDropdownPaintPopup(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetDropdownPaintPopup(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
int32_t popX;
|
int32_t popX;
|
||||||
int32_t popY;
|
int32_t popY;
|
||||||
int32_t popW;
|
int32_t popW;
|
||||||
|
|
|
||||||
|
|
@ -143,8 +143,7 @@ void widgetImageOnMouse(WidgetT *hit) {
|
||||||
// widgetImagePaint
|
// widgetImagePaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetImagePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetImagePaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
(void)font;
|
(void)font;
|
||||||
(void)colors;
|
(void)colors;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,8 +32,7 @@ void widgetLabelCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
||||||
// widgetLabelPaint
|
// widgetLabelPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetLabelPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetLabelPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -342,8 +342,7 @@ void widgetLayoutChildren(WidgetT *w, const BitmapFontT *font) {
|
||||||
// wgtLayout
|
// wgtLayout
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wgtLayout(WidgetT *root, int32_t availW, int32_t availH,
|
void wgtLayout(WidgetT *root, int32_t availW, int32_t availH, const BitmapFontT *font) {
|
||||||
const BitmapFontT *font) {
|
|
||||||
if (!root) {
|
if (!root) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -44,8 +44,7 @@ static void debugContainerBorder(WidgetT *w, DisplayT *d, const BlitOpsT *ops) {
|
||||||
// Paint a single widget and its children. Dispatches to per-widget
|
// Paint a single widget and its children. Dispatches to per-widget
|
||||||
// paint functions defined in their respective files.
|
// paint functions defined in their respective files.
|
||||||
|
|
||||||
void widgetPaintOne(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetPaintOne(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
if (!w->visible) {
|
if (!w->visible) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -157,8 +156,7 @@ void widgetPaintOne(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
||||||
// Paints popup overlays (open dropdowns/comboboxes) on top of
|
// Paints popup overlays (open dropdowns/comboboxes) on top of
|
||||||
// the widget tree. Called after the main paint pass.
|
// the widget tree. Called after the main paint pass.
|
||||||
|
|
||||||
void widgetPaintOverlays(WidgetT *root, DisplayT *d, const BlitOpsT *ops,
|
void widgetPaintOverlays(WidgetT *root, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
if (!sOpenPopup) {
|
if (!sOpenPopup) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -345,8 +343,7 @@ void wgtInvalidate(WidgetT *w) {
|
||||||
// wgtPaint
|
// wgtPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void wgtPaint(WidgetT *root, DisplayT *d, const BlitOpsT *ops,
|
void wgtPaint(WidgetT *root, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
if (!root) {
|
if (!root) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,8 +67,7 @@ void widgetProgressBarCalcMinSize(WidgetT *w, const BitmapFontT *font) {
|
||||||
// widgetProgressBarPaint
|
// widgetProgressBarPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetProgressBarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetProgressBarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
(void)font;
|
(void)font;
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->activeTitleBg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->activeTitleBg;
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
|
|
|
||||||
|
|
@ -74,8 +74,7 @@ void widgetRadioOnMouse(WidgetT *hit) {
|
||||||
// widgetRadioPaint
|
// widgetRadioPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetRadioPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetRadioPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
int32_t boxY = w->y + (w->h - CHECKBOX_BOX_SIZE) / 2;
|
int32_t boxY = w->y + (w->h - CHECKBOX_BOX_SIZE) / 2;
|
||||||
|
|
|
||||||
|
|
@ -37,8 +37,7 @@ WidgetT *wgtVSeparator(WidgetT *parent) {
|
||||||
// widgetSeparatorPaint
|
// widgetSeparatorPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetSeparatorPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetSeparatorPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
(void)font;
|
(void)font;
|
||||||
|
|
||||||
if (w->as.separator.vertical) {
|
if (w->as.separator.vertical) {
|
||||||
|
|
|
||||||
|
|
@ -140,8 +140,7 @@ void widgetSliderOnMouse(WidgetT *hit, int32_t vx, int32_t vy) {
|
||||||
// widgetSliderPaint
|
// widgetSliderPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetSliderPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetSliderPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
(void)font;
|
(void)font;
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ WidgetT *wgtStatusBar(WidgetT *parent) {
|
||||||
// widgetStatusBarPaint
|
// widgetStatusBarPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetStatusBarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetStatusBarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
(void)font;
|
(void)font;
|
||||||
|
|
||||||
// Draw sunken border around each child
|
// Draw sunken border around each child
|
||||||
|
|
|
||||||
|
|
@ -168,8 +168,7 @@ void widgetTabControlOnMouse(WidgetT *hit, WidgetT *root, int32_t vx, int32_t vy
|
||||||
// widgetTabControlPaint
|
// widgetTabControlPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetTabControlPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetTabControlPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
int32_t tabH = font->charHeight + TAB_PAD_V * 2;
|
int32_t tabH = font->charHeight + TAB_PAD_V * 2;
|
||||||
|
|
||||||
// Content panel
|
// Content panel
|
||||||
|
|
|
||||||
|
|
@ -86,8 +86,7 @@ void widgetTextInputOnMouse(WidgetT *hit, WidgetT *root, int32_t vx) {
|
||||||
// widgetTextInputPaint
|
// widgetTextInputPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetTextInputPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetTextInputPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
uint32_t fg = w->fgColor ? w->fgColor : colors->contentFg;
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,8 +23,7 @@ WidgetT *wgtToolbar(WidgetT *parent) {
|
||||||
// widgetToolbarPaint
|
// widgetToolbarPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetToolbarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetToolbarPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
(void)font;
|
(void)font;
|
||||||
|
|
||||||
// Draw raised background and bottom separator
|
// Draw raised background and bottom separator
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,7 @@ static int32_t calcTreeItemsMaxWidth(WidgetT *parent, const BitmapFontT *font, i
|
||||||
// layoutTreeItems
|
// layoutTreeItems
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void layoutTreeItems(WidgetT *parent, const BitmapFontT *font,
|
static void layoutTreeItems(WidgetT *parent, const BitmapFontT *font, int32_t x, int32_t *y, int32_t width, int32_t depth) {
|
||||||
int32_t x, int32_t *y, int32_t width, int32_t depth) {
|
|
||||||
for (WidgetT *c = parent->firstChild; c; c = c->nextSibling) {
|
for (WidgetT *c = parent->firstChild; c; c = c->nextSibling) {
|
||||||
if (c->type != WidgetTreeItemE || !c->visible) {
|
if (c->type != WidgetTreeItemE || !c->visible) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -97,10 +96,7 @@ static void layoutTreeItems(WidgetT *parent, const BitmapFontT *font,
|
||||||
// paintTreeItems
|
// paintTreeItems
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
static void paintTreeItems(WidgetT *parent, DisplayT *d, const BlitOpsT *ops,
|
static void paintTreeItems(WidgetT *parent, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors, int32_t baseX, int32_t *itemY, int32_t depth, int32_t clipTop, int32_t clipBottom) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors,
|
|
||||||
int32_t baseX, int32_t *itemY, int32_t depth,
|
|
||||||
int32_t clipTop, int32_t clipBottom) {
|
|
||||||
for (WidgetT *c = parent->firstChild; c; c = c->nextSibling) {
|
for (WidgetT *c = parent->firstChild; c; c = c->nextSibling) {
|
||||||
if (c->type != WidgetTreeItemE || !c->visible) {
|
if (c->type != WidgetTreeItemE || !c->visible) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -174,8 +170,7 @@ static void paintTreeItems(WidgetT *parent, DisplayT *d, const BlitOpsT *ops,
|
||||||
//
|
//
|
||||||
// Find the tree item at a given Y coordinate.
|
// Find the tree item at a given Y coordinate.
|
||||||
|
|
||||||
static WidgetT *treeItemAtY(WidgetT *parent, int32_t targetY, int32_t *curY,
|
static WidgetT *treeItemAtY(WidgetT *parent, int32_t targetY, int32_t *curY, const BitmapFontT *font) {
|
||||||
const BitmapFontT *font) {
|
|
||||||
for (WidgetT *c = parent->firstChild; c; c = c->nextSibling) {
|
for (WidgetT *c = parent->firstChild; c; c = c->nextSibling) {
|
||||||
if (c->type != WidgetTreeItemE || !c->visible) {
|
if (c->type != WidgetTreeItemE || !c->visible) {
|
||||||
continue;
|
continue;
|
||||||
|
|
@ -343,8 +338,7 @@ void widgetTreeViewOnMouse(WidgetT *hit, WidgetT *root, int32_t vx, int32_t vy)
|
||||||
// widgetTreeViewPaint
|
// widgetTreeViewPaint
|
||||||
// ============================================================
|
// ============================================================
|
||||||
|
|
||||||
void widgetTreeViewPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops,
|
void widgetTreeViewPaint(WidgetT *w, DisplayT *d, const BlitOpsT *ops, const BitmapFontT *font, const ColorSchemeT *colors) {
|
||||||
const BitmapFontT *font, const ColorSchemeT *colors) {
|
|
||||||
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
uint32_t bg = w->bgColor ? w->bgColor : colors->contentBg;
|
||||||
|
|
||||||
// Sunken border
|
// Sunken border
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue