Changeset 5713e5f in mainline for uspace/lib/gui
- Timestamp:
- 2014-09-01T19:17:55Z (11 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 21365c0
- Parents:
- a4666a9 (diff), 00ddb40 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/lib/gui
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/gui/button.c
ra4666a9 r5713e5f 38 38 #include <drawctx.h> 39 39 #include <surface.h> 40 #include <font/embedded.h> 41 #include <errno.h> 40 42 #include "common.h" 41 43 #include "window.h" … … 76 78 sysarg_t cpt_width; 77 79 sysarg_t cpt_height; 78 font_get_box( &btn->font, btn->caption, &cpt_width, &cpt_height);80 font_get_box(btn->font, btn->caption, &cpt_width, &cpt_height); 79 81 80 82 if ((widget->width >= cpt_width) && (widget->height >= cpt_height)) { … … 83 85 84 86 drawctx_set_source(&drawctx, &btn->text); 85 drawctx_set_font(&drawctx, &btn->font);87 drawctx_set_font(&drawctx, btn->font); 86 88 87 89 if (btn->caption) … … 96 98 widget_deinit(&btn->widget); 97 99 free(btn->caption); 98 font_release( &btn->font);100 font_release(btn->font); 99 101 } 100 102 … … 171 173 btn->caption = str_dup(caption); 172 174 173 font_init(&btn->font, FONT_DECODER_EMBEDDED, NULL, points); 175 int rc = embedded_font_create(&btn->font, points); 176 if (rc != EOK) { 177 free(btn->caption); 178 btn->caption = NULL; 179 return false; 180 } 174 181 175 182 sysarg_t cpt_width; 176 183 sysarg_t cpt_height; 177 font_get_box( &btn->font, btn->caption, &cpt_width, &cpt_height);184 font_get_box(btn->font, btn->caption, &cpt_width, &cpt_height); 178 185 btn->widget.width_min = cpt_width + 10; 179 186 btn->widget.height_min = cpt_height + 10; -
uspace/lib/gui/button.h
ra4666a9 r5713e5f 52 52 source_t text; 53 53 char *caption; 54 font_t font;54 font_t *font; 55 55 signal_t clicked; 56 56 } button_t; -
uspace/lib/gui/canvas.c
ra4666a9 r5713e5f 58 58 source_init(&source); 59 59 source_set_transform(&source, transform); 60 source_set_texture(&source, canvas->surface, false); 60 source_set_texture(&source, canvas->surface, 61 PIXELMAP_EXTEND_TRANSPARENT_BLACK); 61 62 62 63 drawctx_t drawctx; -
uspace/lib/gui/label.c
ra4666a9 r5713e5f 38 38 #include <drawctx.h> 39 39 #include <surface.h> 40 #include <font/embedded.h> 41 #include <errno.h> 40 42 #include "window.h" 41 43 #include "label.h" … … 58 60 sysarg_t cpt_width; 59 61 sysarg_t cpt_height; 60 font_get_box( &lbl->font, lbl->caption, &cpt_width, &cpt_height);62 font_get_box(lbl->font, lbl->caption, &cpt_width, &cpt_height); 61 63 62 64 if ((widget->width >= cpt_width) && (widget->height >= cpt_height)) { … … 65 67 66 68 drawctx_set_source(&drawctx, &lbl->text); 67 drawctx_set_font(&drawctx, &lbl->font);69 drawctx_set_font(&drawctx, lbl->font); 68 70 69 71 if (lbl->caption) … … 84 86 sysarg_t cpt_width; 85 87 sysarg_t cpt_height; 86 font_get_box( &lbl->font, lbl->caption, &cpt_width, &cpt_height);88 font_get_box(lbl->font, lbl->caption, &cpt_width, &cpt_height); 87 89 88 90 lbl->widget.width_min = cpt_width + 4; … … 99 101 widget_deinit(&lbl->widget); 100 102 free(lbl->caption); 101 font_release( &lbl->font);103 font_release(lbl->font); 102 104 } 103 105 … … 161 163 lbl->caption = str_dup(caption); 162 164 163 font_init(&lbl->font, FONT_DECODER_EMBEDDED, NULL, points); 165 int rc = embedded_font_create(&lbl->font, points); 166 if (rc != EOK) { 167 free(lbl->caption); 168 lbl->caption = NULL; 169 return false; 170 } 164 171 165 172 sysarg_t cpt_width; 166 173 sysarg_t cpt_height; 167 font_get_box( &lbl->font, lbl->caption, &cpt_width, &cpt_height);174 font_get_box(lbl->font, lbl->caption, &cpt_width, &cpt_height); 168 175 169 176 lbl->widget.width_min = cpt_width + 4; -
uspace/lib/gui/label.h
ra4666a9 r5713e5f 51 51 source_t text; 52 52 char *caption; 53 font_t font;53 font_t *font; 54 54 slot_t rewrite; 55 55 } label_t; -
uspace/lib/gui/terminal.c
ra4666a9 r5713e5f 186 186 // for full UTF-32 coverage. 187 187 188 uint16_t glyph = fb_font_glyph(field->ch );188 uint16_t glyph = fb_font_glyph(field->ch, NULL); 189 189 190 190 for (unsigned int y = 0; y < FONT_SCANLINES; y++) { -
uspace/lib/gui/window.c
ra4666a9 r5713e5f 55 55 #include <drawctx.h> 56 56 #include <surface.h> 57 #include <font/embedded.h> 57 58 58 59 #include "common.h" … … 160 161 /* Window caption */ 161 162 162 font_t font; 163 font_init(&font, FONT_DECODER_EMBEDDED, NULL, 16); 164 165 drawctx_set_font(&drawctx, &font); 163 font_t *font; 164 int rc = embedded_font_create(&font, 16); 165 if (rc != EOK) { 166 window_yield(widget->window); 167 return; 168 } 169 170 drawctx_set_font(&drawctx, font); 166 171 source_set_color(&source, widget->window->is_focused ? 167 172 color_caption_focus : color_caption_unfocus); … … 169 174 sysarg_t cpt_width; 170 175 sysarg_t cpt_height; 171 font_get_box( &font, widget->window->caption, &cpt_width, &cpt_height);176 font_get_box(font, widget->window->caption, &cpt_width, &cpt_height); 172 177 173 178 bool draw_title = … … 183 188 } 184 189 185 font_release( &font);190 font_release(font); 186 191 window_yield(widget->window); 187 192 }
Note:
See TracChangeset
for help on using the changeset viewer.