Mercurial > audlegacy
changeset 1836:a1089ea6f436 trunk
[svn] - implement textboxBitmapFontWidth and textboxBitmapFontHeight for defining the size of a cell in the textbox character grid
author | nenolod |
---|---|
date | Thu, 05 Oct 2006 20:18:41 -0700 |
parents | fab086733722 |
children | be26ff803e4f |
files | ChangeLog audacious/widgets/skin.c audacious/widgets/skin.h audacious/widgets/textbox.c |
diffstat | 4 files changed, 93 insertions(+), 60 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog Thu Oct 05 19:50:10 2006 -0700 +++ b/ChangeLog Thu Oct 05 20:18:41 2006 -0700 @@ -1,3 +1,11 @@ +2006-10-06 02:50:10 +0000 George Averill <nhjm449@gmail.com> + revision [2627] + - revert to 2599 + + trunk/audacious/mainwin.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + + 2006-10-05 15:55:13 +0000 William Pitcock <nenolod@nenolod.net> revision [2625] - better handle the stream condition
--- a/audacious/widgets/skin.c Thu Oct 05 19:50:10 2006 -0700 +++ b/audacious/widgets/skin.c Thu Oct 05 20:18:41 2006 -0700 @@ -1044,6 +1044,24 @@ g_free(tmp); } + skin->properties.textbox_bitmap_font_width = 5; + tmp = read_ini_string(filename, "skin", "textboxBitmapFontWidth"); + + if (tmp != NULL) + { + skin->properties.textbox_bitmap_font_width = atoi(tmp); + g_free(tmp); + } + + skin->properties.textbox_bitmap_font_height = 6; + tmp = read_ini_string(filename, "skin", "textboxBitmapFontHeight"); + + if (tmp != NULL) + { + skin->properties.textbox_bitmap_font_height = atoi(tmp); + g_free(tmp); + } + if (filename != NULL) g_free(filename); }
--- a/audacious/widgets/skin.h Thu Oct 05 19:50:10 2006 -0700 +++ b/audacious/widgets/skin.h Thu Oct 05 20:18:41 2006 -0700 @@ -156,8 +156,10 @@ gint mainwin_height; gboolean mainwin_menurow_visible; + gboolean mainwin_othertext_is_status; - gboolean mainwin_othertext_is_status; + gint textbox_bitmap_font_width; + gint textbox_bitmap_font_height; } SkinProperties; #define SKIN_PIXMAP(x) ((SkinPixmap *)(x))
--- a/audacious/widgets/textbox.c Thu Oct 05 19:50:10 2006 -0700 +++ b/audacious/widgets/textbox.c Thu Oct 05 20:18:41 2006 -0700 @@ -240,127 +240,132 @@ static void textbox_handle_special_char(gchar c, gint * x, gint * y) { + gint tx, ty; + switch (c) { case '"': - *x = 130; - *y = 0; + tx = 26; + ty = 0; break; case '\r': - *x = 50; - *y = 6; + tx = 10; + ty = 1; break; case ':': case ';': - *x = 60; - *y = 6; + tx = 12; + ty = 1; break; case '(': - *x = 65; - *y = 6; + tx = 13; + ty = 1; break; case ')': - *x = 70; - *y = 6; + tx = 14; + ty = 1; break; case '-': - *x = 75; - *y = 6; + tx = 15; + ty = 1; break; case '`': case '\'': - *x = 80; - *y = 6; + tx = 16; + ty = 1; break; case '!': - *x = 85; - *y = 6; + tx = 17; + ty = 1; break; case '_': - *x = 90; - *y = 6; + tx = 18; + ty = 1; break; case '+': - *x = 95; - *y = 6; + tx = 19; + ty = 1; break; case '\\': - *x = 100; - *y = 6; + tx = 20; + ty = 1; break; case '/': - *x = 105; - *y = 6; + tx = 21; + ty = 1; break; case '[': - *x = 110; - *y = 6; + tx = 22; + ty = 1; break; case ']': - *x = 115; - *y = 6; + tx = 23; + ty = 1; break; case '^': - *x = 120; - *y = 6; + tx = 24; + ty = 1; break; case '&': - *x = 125; - *y = 6; + tx = 25; + ty = 1; break; case '%': - *x = 130; - *y = 6; + tx = 26; + ty = 1; break; case '.': case ',': - *x = 135; - *y = 6; + tx = 27; + ty = 1; break; case '=': - *x = 140; - *y = 6; + tx = 28; + ty = 1; break; case '$': - *x = 145; - *y = 6; + tx = 29; + ty = 1; break; case '#': - *x = 150; - *y = 6; + tx = 30; + ty = 1; break; case 'å': case 'Å': - *x = 0; - *y = 12; + tx = 0; + ty = 2; break; case 'ö': case 'Ö': - *x = 5; - *y = 12; + tx = 1; + ty = 2; break; case 'ä': case 'Ä': - *x = 10; - *y = 12; + tx = 2; + ty = 2; break; case 'ü': case 'Ü': - *x = 100; - *y = 0; + tx = 20; + ty = 0; break; case '?': - *x = 15; - *y = 12; + tx = 3; + ty = 2; break; case '*': - *x = 20; - *y = 12; + tx = 4; + ty = 2; break; default: - *x = 145; - *y = 0; + tx = 29; + ty = 0; break; } + + *x = tx * bmp_active_skin->properties.textbox_bitmap_font_width; + *y = ty * bmp_active_skin->properties.textbox_bitmap_font_height; } static void @@ -443,7 +448,7 @@ tb->tb_pixmap_width = length * 5; tb->tb_pixmap = gdk_pixmap_new(mainwin->window, - tb->tb_pixmap_width, 6, + tb->tb_pixmap_width, bmp_active_skin->properties.textbox_bitmap_font_height, gdk_rgb_get_visual()->depth); gc = tb->tb_widget.gc; @@ -452,12 +457,12 @@ x = y = -1; c = toupper((int) pixmaptext[i]); if (c >= 'A' && c <= 'Z') { - x = 5 * (c - 'A'); + x = bmp_active_skin->properties.textbox_bitmap_font_width * (c - 'A'); y = 0; } else if (c >= '0' && c <= '9') { x = 5 * (c - '0'); - y = 6; + y = bmp_active_skin->properties.textbox_bitmap_font_height; } else textbox_handle_special_char(c, &x, &y);