diff options
author | inmarket <andrewh@inmarket.com.au> | 2018-07-08 12:50:05 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2018-07-08 12:50:05 +1000 |
commit | a24fab0d7217aaae1463f62d5d1381ef820cfa17 (patch) | |
tree | 73f3bb1b93d13d9ee4161e0a994e5b53f70af93b /src/gwin | |
parent | 2e8eaa34717f99c9696867b62ff5f19e76a7ccf8 (diff) | |
download | uGFX-a24fab0d7217aaae1463f62d5d1381ef820cfa17.tar.gz uGFX-a24fab0d7217aaae1463f62d5d1381ef820cfa17.tar.bz2 uGFX-a24fab0d7217aaae1463f62d5d1381ef820cfa17.zip |
Added type gFontmetric to replace V2.x fontmetric_t, and values gFontXXX replace fontXXX
Diffstat (limited to 'src/gwin')
-rw-r--r-- | src/gwin/gwin_console.c | 18 | ||||
-rw-r--r-- | src/gwin/gwin_label.c | 2 | ||||
-rw-r--r-- | src/gwin/gwin_list.c | 12 | ||||
-rw-r--r-- | src/gwin/gwin_textedit.c | 4 |
4 files changed, 18 insertions, 18 deletions
diff --git a/src/gwin/gwin_console.c b/src/gwin/gwin_console.c index c5db3da8..668dd116 100644 --- a/src/gwin/gwin_console.c +++ b/src/gwin/gwin_console.c @@ -200,7 +200,7 @@ return; // Handle vertical size decrease - We have to scroll out first lines of the log - fy = gdispGetFontMetric(gh->font, fontHeight); + fy = gdispGetFontMetric(gh->font, gFontHeight); while (gcw->cy > gh->height) { scrollBuffer(gcw); gcw->cy -= fy; @@ -233,7 +233,7 @@ y = gcw->cy; if (gcw->cx) - y += gdispGetFontMetric(gh->font, fontHeight); + y += gdispGetFontMetric(gh->font, gFontHeight); if (y < gh->height) gdispGFillArea(gh->display, gh->x, gh->y+y, gh->width, gh->height-y, gh->bgcolor); } @@ -397,14 +397,14 @@ GHandle gwinGConsoleCreate(GDisplay *g, GConsoleObject *gc, const GWindowInit *p // Get the number of characters that fit in the x direction #if GWIN_CONSOLE_HISTORY_AVERAGING - gcw->bufsize = gh->width / ((2*gdispGetFontMetric(gh->font, fontMinWidth)+gdispGetFontMetric(gh->font, fontMaxWidth))/3); + gcw->bufsize = gh->width / ((2*gdispGetFontMetric(gh->font, gFontMinWidth)+gdispGetFontMetric(gh->font, gFontMaxWidth))/3); #else - gcw->bufsize = gh->width / gdispGetFontMetric(gh->font, fontMinWidth); + gcw->bufsize = gh->width / gdispGetFontMetric(gh->font, gFontMinWidth); #endif gcw->bufsize++; // Allow space for a newline on each line. // Multiply by the number of lines - gcw->bufsize *= gh->height / gdispGetFontMetric(gh->font, fontHeight); + gcw->bufsize *= gh->height / gdispGetFontMetric(gh->font, gFontHeight); // Allocate the buffer if (!(gcw->buffer = gfxAlloc(gcw->bufsize))) @@ -438,7 +438,7 @@ void gwinPutChar(GHandle gh, char c) { if (gh->vmt != &consoleVMT || !gh->font) return; - fy = gdispGetFontMetric(gh->font, fontHeight); + fy = gdispGetFontMetric(gh->font, gFontHeight); #if GWIN_CONSOLE_ESCSEQ /** @@ -603,8 +603,8 @@ void gwinPutChar(GHandle gh, char c) { #if GWIN_CONSOLE_ESCSEQ // Draw the underline if ((gcw->currattr & ESC_UNDERLINE)) - gdispGDrawLine(gh->display, gh->x + gcw->cx, gh->y + gcw->cy + fy - gdispGetFontMetric(gh->font, fontDescendersHeight), - gh->x + gcw->cx + width + gdispGetFontMetric(gh->font, fontCharPadding), gh->y + gcw->cy + fy - gdispGetFontMetric(gh->font, fontDescendersHeight), + gdispGDrawLine(gh->display, gh->x + gcw->cx, gh->y + gcw->cy + fy - gdispGetFontMetric(gh->font, gFontDescendersHeight), + gh->x + gcw->cx + width + gdispGetFontMetric(gh->font, gFontCharPadding), gh->y + gcw->cy + fy - gdispGetFontMetric(gh->font, gFontDescendersHeight), ESCPrintColor(gcw)); // Bold (very crude) if ((gcw->currattr & ESC_BOLD)) @@ -615,7 +615,7 @@ void gwinPutChar(GHandle gh, char c) { } // Update the cursor - gcw->cx += width + gdispGetFontMetric(gh->font, fontCharPadding); + gcw->cx += width + gdispGetFontMetric(gh->font, gFontCharPadding); #undef gcw } diff --git a/src/gwin/gwin_label.c b/src/gwin/gwin_label.c index 88573210..97b9f304 100644 --- a/src/gwin/gwin_label.c +++ b/src/gwin/gwin_label.c @@ -32,7 +32,7 @@ static gCoord getheight(const char *text, font_t font, gCoord maxwidth) { (void) text; (void) maxwidth; - return gdispGetFontMetric(font, fontHeight); + return gdispGetFontMetric(font, gFontHeight); } static const gwidgetVMT labelVMT = { diff --git a/src/gwin/gwin_list.c b/src/gwin/gwin_list.c index d832f99a..cd21623d 100644 --- a/src/gwin/gwin_list.c +++ b/src/gwin/gwin_list.c @@ -60,7 +60,7 @@ static void sendListEvent(GWidgetObject *gw, int item) { gCoord iheight; (void) x; - iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD; + iheight = gdispGetFontMetric(gw->g.font, gFontHeight) + LST_VERT_PAD; // Handle click over the list area item = (gw2obj->top + y) / iheight; @@ -101,7 +101,7 @@ static void sendListEvent(GWidgetObject *gw, int item) { return; // Some initial stuff - iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD; + iheight = gdispGetFontMetric(gw->g.font, gFontHeight) + LST_VERT_PAD; pgsz = gw->g.height-2; // Handle click over the scroll bar @@ -163,7 +163,7 @@ static void sendListEvent(GWidgetObject *gw, int item) { if (gw2obj->last_mouse_y != y) { oldtop = gw2obj->top; - iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD; + iheight = gdispGetFontMetric(gw->g.font, gFontHeight) + LST_VERT_PAD; gw2obj->top -= y - gw2obj->last_mouse_y; if (gw2obj->top >= gw2obj->cnt * iheight - (gw->g.height-2)) @@ -185,7 +185,7 @@ static void sendListEvent(GWidgetObject *gw, int item) { int i; gCoord iheight; - iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD; + iheight = gdispGetFontMetric(gw->g.font, gFontHeight) + LST_VERT_PAD; switch (role) { // select down @@ -664,7 +664,7 @@ void gwinListViewItem(GHandle gh, int item) { return; // Work out a possible new top for the list - iheight = gdispGetFontMetric(gh->font, fontHeight) + LST_VERT_PAD; + iheight = gdispGetFontMetric(gh->font, gFontHeight) + LST_VERT_PAD; gh2obj->top = iheight * item; // Adjust the list @@ -725,7 +725,7 @@ void gwinListDefaultDraw(GWidgetObject* gw, void* param) { return; ps = (gw->g.flags & GWIN_FLG_SYSENABLED) ? &gw->pstyle->enabled : &gw->pstyle->disabled; - iheight = gdispGetFontMetric(gw->g.font, fontHeight) + LST_VERT_PAD; + iheight = gdispGetFontMetric(gw->g.font, gFontHeight) + LST_VERT_PAD; x = 1; // the scroll area diff --git a/src/gwin/gwin_textedit.c b/src/gwin/gwin_textedit.c index 590780cf..3373ab34 100644 --- a/src/gwin/gwin_textedit.c +++ b/src/gwin/gwin_textedit.c @@ -307,8 +307,8 @@ void gwinTexteditDefaultDraw(GWidgetObject* gw, void* param) // Calculate cursor stuff // Draw cursor - tpos += gw->g.x + CURSOR_PADDING_LEFT + TEXT_PADDING_LEFT + gdispGetFontMetric(gw->g.font, fontBaselineX)/2; - cpos = (gw->g.height - gdispGetFontMetric(gw->g.font, fontHeight))/2 - CURSOR_EXTRA_HEIGHT; + tpos += gw->g.x + CURSOR_PADDING_LEFT + TEXT_PADDING_LEFT + gdispGetFontMetric(gw->g.font, gFontBaselineX)/2; + cpos = (gw->g.height - gdispGetFontMetric(gw->g.font, gFontHeight))/2 - CURSOR_EXTRA_HEIGHT; gdispGDrawLine(gw->g.display, tpos, gw->g.y + cpos, tpos, gw->g.y + gw->g.height - cpos, pcol->edge); } |