Changeset 192565b in mainline for uspace/app/vlaunch/vlaunch.c
- Timestamp:
- 2013-05-27T13:18:13Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f2c19b0
- Parents:
- d120133 (diff), c90aed4 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/vlaunch/vlaunch.c
rd120133 r192565b 46 46 #include <button.h> 47 47 #include <label.h> 48 #include <canvas.h> 48 49 49 #define NAME "vlaunch" 50 #include <surface.h> 51 #include <source.h> 52 #include <drawctx.h> 53 #include <codec/tga.h> 54 55 #include "images.h" 56 57 #define NAME "vlaunch" 58 59 #define LOGO_WIDTH 196 60 #define LOGO_HEIGHT 66 50 61 51 62 static char *winreg = NULL; … … 97 108 } 98 109 110 surface_t *logo = decode_tga((void *) helenos_tga, helenos_tga_size, 0); 111 if (!logo) { 112 printf("Unable to decode logo.\n"); 113 return 1; 114 } 115 99 116 winreg = argv[1]; 100 117 window_t *main_window = window_open(argv[1], true, true, "vlaunch", 0, 0); … … 104 121 } 105 122 106 pixel_t grd_bg = PIXEL(255, 2 40, 240, 240);123 pixel_t grd_bg = PIXEL(255, 255, 255, 255); 107 124 pixel_t btn_bg = PIXEL(255, 0, 0, 0); 108 125 pixel_t btn_fg = PIXEL(255, 240, 240, 240); 109 pixel_t lbl_bg = PIXEL(255, 2 40, 240, 240);126 pixel_t lbl_bg = PIXEL(255, 255, 255, 255); 110 127 pixel_t lbl_fg = PIXEL(255, 0, 0, 0); 111 128 129 canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT, 130 logo); 112 131 label_t *lbl_caption = create_label(NULL, "Launch application:", 16, 113 132 lbl_bg, lbl_fg); … … 118 137 button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg, 119 138 btn_fg); 120 grid_t *grid = create_grid(window_root(main_window), 4, 1, grd_bg);139 grid_t *grid = create_grid(window_root(main_window), 1, 5, grd_bg); 121 140 122 if ((!l bl_caption) || (!btn_vterm) || (!btn_vdemo) ||123 (!btn_v launch) || (!grid)) {141 if ((!logo_canvas) || (!lbl_caption) || (!btn_vterm) || 142 (!btn_vdemo) || (!btn_vlaunch) || (!grid)) { 124 143 window_close(main_window); 125 144 printf("Cannot create widgets.\n"); … … 131 150 sig_connect(&btn_vlaunch->clicked, NULL, on_vlaunch); 132 151 133 grid->add(grid, &lbl_caption->widget, 0, 0, 1, 1); 134 grid->add(grid, &btn_vterm->widget, 1, 0, 1, 1); 135 grid->add(grid, &btn_vdemo->widget, 2, 0, 1, 1); 136 grid->add(grid, &btn_vlaunch->widget, 3, 0, 1, 1); 152 grid->add(grid, &logo_canvas->widget, 0, 0, 1, 1); 153 grid->add(grid, &lbl_caption->widget, 0, 1, 1, 1); 154 grid->add(grid, &btn_vterm->widget, 0, 2, 1, 1); 155 grid->add(grid, &btn_vdemo->widget, 0, 3, 1, 1); 156 grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1); 137 157 138 window_resize(main_window, 180, 130);158 window_resize(main_window, 210, 130 + LOGO_HEIGHT); 139 159 window_exec(main_window); 160 140 161 task_retval(0); 141 162 async_manager();
Note:
See TracChangeset
for help on using the changeset viewer.