Changes in uspace/app/fontviewer/fontviewer.c [09d13c8e:38d150e] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/fontviewer/fontviewer.c
r09d13c8e r38d150e 38 38 #include <stdlib.h> 39 39 #include <stdbool.h> 40 #include <str_error.h>41 40 #include <window.h> 42 41 #include <canvas.h> … … 63 62 char *font_path = NULL; 64 63 65 static errno_t draw(void);64 static int draw(void); 66 65 67 66 static void on_keyboard_event(widget_t *widget, void *data) … … 96 95 } 97 96 98 errno_t rc = draw();97 int rc = draw(); 99 98 if (rc != EOK) { 100 printf("Failed drawing: % s.\n", str_error(rc));99 printf("Failed drawing: %d.\n", rc); 101 100 exit(1); 102 101 } … … 104 103 } 105 104 106 static errno_t create_font(font_t **font, uint16_t points)105 static int create_font(font_t **font, uint16_t points) 107 106 { 108 107 if (font_path == NULL) { … … 139 138 140 139 static int text(drawctx_t *, font_t *, source_t *, surface_coord_t x, 141 surface_coord_t , const char *, ...) _HELENOS_PRINTF_ATTRIBUTE(6, 7);140 surface_coord_t , const char *, ...) PRINTF_ATTRIBUTE(6, 7); 142 141 static int text(drawctx_t *drawctx, font_t *font, source_t *source, 143 142 surface_coord_t x, surface_coord_t y, const char *fmt, ...) … … 149 148 va_end(args); 150 149 151 if (ret >= 0) { 152 drawctx_set_source(drawctx, source); 153 drawctx_set_font(drawctx, font); 154 drawctx_print(drawctx, str, x, y); 155 156 free(str); 157 } 150 if (ret <= 0) 151 return ret; 152 153 drawctx_set_source(drawctx, source); 154 drawctx_set_font(drawctx, font); 155 drawctx_print(drawctx, str, x, y); 156 157 free(str); 158 158 159 159 return ret; … … 161 161 162 162 163 static errno_t draw(void)163 static int draw(void) 164 164 { 165 165 source_t background = rgb(255, 255, 255); … … 174 174 175 175 font_t *font; 176 errno_t rc = create_font(&font, points);176 int rc = create_font(&font, points); 177 177 if (rc != EOK) { 178 178 printf("Failed creating font\n"); … … 274 274 height = WINDOW_HEIGHT; 275 275 276 errno_t rc = draw();276 int rc = draw(); 277 277 if (rc != EOK) { 278 printf("Failed drawing: % s.\n", str_error(rc));278 printf("Failed drawing: %d.\n", rc); 279 279 return 2; 280 280 }
Note:
See TracChangeset
for help on using the changeset viewer.