From 5d2c2b27a6323e2666378b986129b2a7c2c39e5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 6 Feb 2022 16:04:24 +0100 Subject: New upstream version 5.2.2GA --- app/wlib/gtklib/boxes.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'app/wlib/gtklib/boxes.c') diff --git a/app/wlib/gtklib/boxes.c b/app/wlib/gtklib/boxes.c index cf419e6..74dbb7b 100644 --- a/app/wlib/gtklib/boxes.c +++ b/app/wlib/gtklib/boxes.c @@ -61,8 +61,8 @@ struct wBox_t { void wBoxSetSize( wBox_p b, - wPos_t w, - wPos_t h) + wWinPix_t w, + wWinPix_t h) { b->w = w; b->h = h; @@ -84,12 +84,12 @@ void wBoxSetSize( void wlibDrawBox( wWin_p win, wBoxType_e style, - wPos_t x, - wPos_t y, - wPos_t w, - wPos_t h) + wWinPix_t x, + wWinPix_t y, + wWinPix_t w, + wWinPix_t h) { - wPos_t x0, y0, x1, y1; + wWinPix_t x0, y0, x1, y1; GdkDrawable * window; cairo_t *cr; static char colors[8][4][2] = { @@ -185,12 +185,12 @@ static void boxRepaint(wControl_p b) wBox_p wBoxCreate( wWin_p parent, - wPos_t bx, - wPos_t by, + wWinPix_t bx, + wWinPix_t by, const char * labelStr, wBoxType_e boxTyp, - wPos_t bw, - wPos_t bh) + wWinPix_t bw, + wWinPix_t bh) { wBox_p b; b = (wBox_p)wlibAlloc(parent, B_BOX, bx, by, labelStr, sizeof *b, NULL); -- cgit v1.2.3 From a14a7a0ccc9de76aeab0b2e4bbf58f1a79deedc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Wed, 3 Jul 2024 10:19:30 +0200 Subject: New upstream version 5.3.0GA --- app/wlib/gtklib/boxes.c | 194 ++++++++++++++++++++++++------------------------ 1 file changed, 97 insertions(+), 97 deletions(-) (limited to 'app/wlib/gtklib/boxes.c') diff --git a/app/wlib/gtklib/boxes.c b/app/wlib/gtklib/boxes.c index 74dbb7b..3c0173b 100644 --- a/app/wlib/gtklib/boxes.c +++ b/app/wlib/gtklib/boxes.c @@ -36,8 +36,8 @@ #include "gtkint.h" struct wBox_t { - WOBJ_COMMON - wBoxType_e boxTyp; + WOBJ_COMMON + wBoxType_e boxTyp; }; #define B (1) @@ -60,12 +60,12 @@ struct wBox_t { */ void wBoxSetSize( - wBox_p b, - wWinPix_t w, - wWinPix_t h) + wBox_p b, + wWinPix_t w, + wWinPix_t h) { - b->w = w; - b->h = h; + b->w = w; + b->h = h; } /** @@ -82,78 +82,78 @@ void wBoxSetSize( */ void wlibDrawBox( - wWin_p win, - wBoxType_e style, - wWinPix_t x, - wWinPix_t y, - wWinPix_t w, - wWinPix_t h) + wWin_p win, + wBoxType_e style, + wWinPix_t x, + wWinPix_t y, + wWinPix_t w, + wWinPix_t h) { - wWinPix_t x0, y0, x1, y1; - GdkDrawable * window; - cairo_t *cr; - static char colors[8][4][2] = { - { /* ThinB */ {B,0}, {B,0}, {B,0}, {B,0} }, - { /* ThinW */ {W,0}, {W,0}, {W,0}, {W,0} }, - { /* AboveW */ {W,0}, {W,0}, {B,0}, {B,0} }, - { /* BelowW */ {B,0}, {B,0}, {W,0}, {W,0} }, - { /* ThickB */ {B,B}, {B,B}, {B,B}, {B,B} }, - { /* ThickW */ {W,W}, {W,W}, {W,W}, {W,W} }, - { /* RidgeW */ {W,B}, {W,B}, {B,W}, {B,W} }, - { /* TroughW*/ {B,W}, {B,W}, {W,B}, {W,B} } - }; - window = gtk_widget_get_window(win->widget); - cr = gdk_cairo_create(window); - cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); - cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER); - cairo_set_line_width(cr, 1.0); - x0 = x; - x1 = x+w; - y0 = y; - y1 = y+h; - SETCOLOR(style, 0, 0); - cairo_move_to(cr, x0, y0); - cairo_line_to(cr, x0, y1); - cairo_stroke_preserve(cr); - SETCOLOR(style, 1, 0); - cairo_move_to(cr, x0, y0); - cairo_line_to(cr, x1, y0); - cairo_stroke_preserve(cr); - SETCOLOR(style, 2, 0); - cairo_move_to(cr, x1, y1); - cairo_line_to(cr, x0+1, y1); - cairo_stroke_preserve(cr); - SETCOLOR(style, 3, 0); - cairo_move_to(cr, x1, y1-1); - cairo_line_to(cr, x1, y0+1); - cairo_stroke_preserve(cr); - - if (style < wBoxThickB) { - cairo_destroy(cr); - return; - } - - x0++; - y0++; - x1--; - y1--; - SETCOLOR(style, 0, 1); - cairo_move_to(cr, x0, y0); - cairo_line_to(cr, x0, y1); - cairo_stroke_preserve(cr); - SETCOLOR(style, 1, 1); - cairo_move_to(cr, x0+1, y0); - cairo_line_to(cr, x1, y0); - cairo_stroke_preserve(cr); - SETCOLOR(style, 2, 1); - cairo_move_to(cr, x1, y1); - cairo_line_to(cr, x0+1, y1); - cairo_stroke_preserve(cr); - SETCOLOR(style, 3, 1); - cairo_move_to(cr, x1, y1-1); - cairo_line_to(cr, x1, y0+1); - cairo_stroke_preserve(cr); - cairo_destroy(cr); + wWinPix_t x0, y0, x1, y1; + GdkDrawable * window; + cairo_t *cr; + static char colors[8][4][2] = { + { /* ThinB */ {B,0}, {B,0}, {B,0}, {B,0} }, + { /* ThinW */ {W,0}, {W,0}, {W,0}, {W,0} }, + { /* AboveW */ {W,0}, {W,0}, {B,0}, {B,0} }, + { /* BelowW */ {B,0}, {B,0}, {W,0}, {W,0} }, + { /* ThickB */ {B,B}, {B,B}, {B,B}, {B,B} }, + { /* ThickW */ {W,W}, {W,W}, {W,W}, {W,W} }, + { /* RidgeW */ {W,B}, {W,B}, {B,W}, {B,W} }, + { /* TroughW*/ {B,W}, {B,W}, {W,B}, {W,B} } + }; + window = gtk_widget_get_window(win->widget); + cr = gdk_cairo_create(window); + cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT); + cairo_set_line_join(cr, CAIRO_LINE_JOIN_MITER); + cairo_set_line_width(cr, 1.0); + x0 = x; + x1 = x+w; + y0 = y; + y1 = y+h; + SETCOLOR(style, 0, 0); + cairo_move_to(cr, x0, y0); + cairo_line_to(cr, x0, y1); + cairo_stroke_preserve(cr); + SETCOLOR(style, 1, 0); + cairo_move_to(cr, x0, y0); + cairo_line_to(cr, x1, y0); + cairo_stroke_preserve(cr); + SETCOLOR(style, 2, 0); + cairo_move_to(cr, x1, y1); + cairo_line_to(cr, x0+1, y1); + cairo_stroke_preserve(cr); + SETCOLOR(style, 3, 0); + cairo_move_to(cr, x1, y1-1); + cairo_line_to(cr, x1, y0+1); + cairo_stroke_preserve(cr); + + if (style < wBoxThickB) { + cairo_destroy(cr); + return; + } + + x0++; + y0++; + x1--; + y1--; + SETCOLOR(style, 0, 1); + cairo_move_to(cr, x0, y0); + cairo_line_to(cr, x0, y1); + cairo_stroke_preserve(cr); + SETCOLOR(style, 1, 1); + cairo_move_to(cr, x0+1, y0); + cairo_line_to(cr, x1, y0); + cairo_stroke_preserve(cr); + SETCOLOR(style, 2, 1); + cairo_move_to(cr, x1, y1); + cairo_line_to(cr, x0+1, y1); + cairo_stroke_preserve(cr); + SETCOLOR(style, 3, 1); + cairo_move_to(cr, x1, y1-1); + cairo_line_to(cr, x1, y0+1); + cairo_stroke_preserve(cr); + cairo_destroy(cr); } /** @@ -165,9 +165,9 @@ void wlibDrawBox( static void boxRepaint(wControl_p b) { - wBox_p bb = (wBox_p)(b); - wWin_p win = bb->parent; - wlibDrawBox(win, bb->boxTyp, bb->realX, bb->realY, bb->w, bb->h); + wBox_p bb = (wBox_p)(b); + wWin_p win = bb->parent; + wlibDrawBox(win, bb->boxTyp, bb->realX, bb->realY, bb->w, bb->h); } /** @@ -184,21 +184,21 @@ static void boxRepaint(wControl_p b) */ wBox_p wBoxCreate( - wWin_p parent, - wWinPix_t bx, - wWinPix_t by, - const char * labelStr, - wBoxType_e boxTyp, - wWinPix_t bw, - wWinPix_t bh) + wWin_p parent, + wWinPix_t bx, + wWinPix_t by, + const char * labelStr, + wBoxType_e boxTyp, + wWinPix_t bw, + wWinPix_t bh) { - wBox_p b; - b = (wBox_p)wlibAlloc(parent, B_BOX, bx, by, labelStr, sizeof *b, NULL); - wlibComputePos((wControl_p)b); - b->boxTyp = boxTyp; - b->w = bw; - b->h = bh; - b->repaintProc = boxRepaint; - wlibAddButton((wControl_p)b); - return b; + wBox_p b; + b = (wBox_p)wlibAlloc(parent, B_BOX, bx, by, labelStr, sizeof *b, NULL); + wlibComputePos((wControl_p)b); + b->boxTyp = boxTyp; + b->w = bw; + b->h = bh; + b->repaintProc = boxRepaint; + wlibAddButton((wControl_p)b); + return b; } -- cgit v1.2.3