Changeset f126c87 in mainline for uspace/app
- Timestamp:
- 2016-09-01T16:46:27Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2a2fbc8
- Parents:
- 9befb0d (diff), bdfdc51c (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/app
- Files:
-
- 2 added
- 9 edited
-
barber/barber.c (modified) (2 diffs)
-
fontviewer/fontviewer.c (modified) (2 diffs)
-
usbinfo/info.c (modified) (4 diffs)
-
usbinfo/list.c (modified) (1 diff)
-
usbinfo/usbinfo.h (modified) (3 diffs)
-
vcalc/Makefile (added)
-
vcalc/vcalc.c (added)
-
vdemo/vdemo.c (modified) (3 diffs)
-
viewer/viewer.c (modified) (2 diffs)
-
vlaunch/vlaunch.c (modified) (4 diffs)
-
vterm/vterm.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/barber/barber.c
r9befb0d rf126c87 308 308 309 309 winreg = argv[1]; 310 window_t *main_window = window_open(argv[1], 310 window_t *main_window = window_open(argv[1], NULL, 311 311 WINDOW_MAIN | WINDOW_DECORATED, "barber"); 312 312 if (!main_window) { … … 315 315 } 316 316 317 frame_canvas = create_canvas(window_root(main_window), 317 frame_canvas = create_canvas(window_root(main_window), NULL, 318 318 FRAME_WIDTH, FRAME_HEIGHT, frames[frame]); 319 319 -
uspace/app/fontviewer/fontviewer.c
r9befb0d rf126c87 260 260 } 261 261 262 main_window = window_open(argv[1], WINDOW_MAIN, "fontviewer");262 main_window = window_open(argv[1], NULL, WINDOW_MAIN, "fontviewer"); 263 263 if (!main_window) { 264 264 printf("Cannot open main window.\n"); … … 282 282 } 283 283 284 canvas = create_canvas(window_root(main_window), 284 canvas = create_canvas(window_root(main_window), NULL, 285 285 WINDOW_WIDTH, WINDOW_HEIGHT, surface); 286 286 if (canvas == NULL) { -
uspace/app/usbinfo/info.c
r9befb0d rf126c87 93 93 init_match_ids(&matches); 94 94 usb_device_create_match_ids_from_device_descriptor( 95 &usb_device_descriptors(usb_dev)->device, &matches);95 &usb_device_descriptors(usb_dev)->device, &matches); 96 96 printf("%sDevice match ids (0x%04x by 0x%04x, %s)\n", get_indent(0), 97 97 usb_device_descriptors(usb_dev)->device.product_id, … … 229 229 { 230 230 dump_descriptor_tree_callback( 231 (const uint8_t *) &usb_device_descriptors(usb_dev)->device,231 (const uint8_t *) &usb_device_descriptors(usb_dev)->device, 232 232 (size_t) -1, NULL); 233 233 … … 242 242 { 243 243 dump_descriptor_tree_callback( 244 (const uint8_t *) &usb_device_descriptors(usb_dev)->device,244 (const uint8_t *) &usb_device_descriptors(usb_dev)->device, 245 245 (size_t) -1, usb_dev); 246 246 … … 296 296 uint64_t str_mask = 0; 297 297 find_string_indexes_callback( 298 (const uint8_t *) &usb_device_descriptors(usb_dev)->device, 0,298 (const uint8_t *) &usb_device_descriptors(usb_dev)->device, 0, 299 299 &str_mask); 300 300 -
uspace/app/usbinfo/list.c
r9befb0d rf126c87 148 148 } 149 149 150 for (unsigned i = 0; i < count; ++i) {150 for (unsigned int i = 0; i < count; ++i) { 151 151 print_usb_bus(svcs[i]); 152 152 } -
uspace/app/usbinfo/usbinfo.h
r9befb0d rf126c87 44 44 typedef struct { 45 45 int opt; 46 void (*action)(usb_device_t * usb_dev);46 void (*action)(usb_device_t *); 47 47 bool active; 48 48 } usbinfo_action_t; … … 51 51 #define NAME "usbinfo" 52 52 53 void dump_buffer(const char *, size_t, const uint8_t *, size_t);54 const char *get_indent(size_t);55 void dump_match_ids(match_id_list_t *, const char *);56 void dump_usb_descriptor(uint8_t *, size_t);57 void dump_descriptor_tree(uint8_t *, size_t);53 extern void dump_buffer(const char *, size_t, const uint8_t *, size_t); 54 extern const char *get_indent(size_t); 55 extern void dump_match_ids(match_id_list_t *, const char *); 56 extern void dump_usb_descriptor(uint8_t *, size_t); 57 extern void dump_descriptor_tree(uint8_t *, size_t); 58 58 59 59 static inline void internal_error(int err) … … 63 63 64 64 typedef void (*dump_descriptor_in_tree_t)(const uint8_t *, size_t, void *); 65 void browse_descriptor_tree(uint8_t *, size_t, usb_dp_descriptor_nesting_t *,66 dump_descriptor_in_tree_t, size_t, void *);67 65 68 void list(void); 66 extern void browse_descriptor_tree(uint8_t *, size_t, 67 usb_dp_descriptor_nesting_t *, dump_descriptor_in_tree_t, size_t, void *); 69 68 70 void dump_short_device_identification(usb_device_t *); 71 void dump_device_match_ids(usb_device_t *); 72 void dump_descriptor_tree_brief(usb_device_t *); 73 void dump_descriptor_tree_full(usb_device_t *); 74 void dump_strings(usb_device_t *); 75 void dump_status(usb_device_t *); 76 void dump_hidreport_raw(usb_device_t *); 77 void dump_hidreport_usages(usb_device_t *); 69 extern void list(void); 70 71 extern void dump_short_device_identification(usb_device_t *); 72 extern void dump_device_match_ids(usb_device_t *); 73 extern void dump_descriptor_tree_brief(usb_device_t *); 74 extern void dump_descriptor_tree_full(usb_device_t *); 75 extern void dump_strings(usb_device_t *); 76 extern void dump_status(usb_device_t *); 77 extern void dump_hidreport_raw(usb_device_t *); 78 extern void dump_hidreport_usages(usb_device_t *); 78 79 79 80 #endif -
uspace/app/vdemo/vdemo.c
r9befb0d rf126c87 85 85 lbl->confirm = on_confirm; 86 86 lbl->cancel = on_cancel; 87 bool initialized = init_label( 88 &lbl->label, parent, caption,points, background, foreground);87 bool initialized = init_label(&lbl->label, parent, NULL, caption, 88 points, background, foreground); 89 89 lbl->label.widget.destroy = my_label_destroy; 90 90 return initialized; … … 110 110 { 111 111 if (argc >= 2) { 112 window_t *main_window = window_open(argv[1], 112 window_t *main_window = window_open(argv[1], NULL, 113 113 WINDOW_MAIN | WINDOW_DECORATED | WINDOW_RESIZEABLE, "vdemo"); 114 114 if (!main_window) { … … 128 128 my_label_t *lbl_action = create_my_label(NULL, "Hello there!", 16, 129 129 lbl_bg, lbl_text); 130 button_t *btn_confirm = create_button(NULL, "Confirm", 16, btn_bg, 131 btn_fg, btn_text); 132 button_t *btn_cancel = create_button(NULL, "Cancel", 16, btn_bg, 133 btn_fg, btn_text); 134 grid_t *grid = create_grid(window_root(main_window), 2, 2, grd_bg); 130 button_t *btn_confirm = create_button(NULL, NULL, "Confirm", 16, 131 btn_bg, btn_fg, btn_text); 132 button_t *btn_cancel = create_button(NULL, NULL, "Cancel", 16, 133 btn_bg, btn_fg, btn_text); 134 grid_t *grid = create_grid(window_root(main_window), NULL, 2, 2, 135 grd_bg); 135 136 if (!lbl_action || !btn_confirm || !btn_cancel || !grid) { 136 137 window_close(main_window); -
uspace/app/viewer/viewer.c
r9befb0d rf126c87 157 157 } 158 158 } else { 159 canvas = create_canvas(window_root(main_window), 159 canvas = create_canvas(window_root(main_window), NULL, 160 160 img_width, img_height, local_surface); 161 161 if (canvas == NULL) { … … 219 219 flags |= WINDOW_DECORATED; 220 220 221 main_window = window_open(argv[1], flags, "viewer");221 main_window = window_open(argv[1], NULL, flags, "viewer"); 222 222 if (!main_window) { 223 223 printf("Cannot open main window.\n"); -
uspace/app/vlaunch/vlaunch.c
r9befb0d rf126c87 85 85 } 86 86 87 static void on_ vterm(widget_t *widget, void *data)87 static void on_btn_click(widget_t *widget, void *data) 88 88 { 89 app_launch("/app/vterm"); 90 } 91 92 static void on_vdemo(widget_t *widget, void *data) 93 { 94 app_launch("/app/vdemo"); 95 } 96 97 static void on_vlaunch(widget_t *widget, void *data) 98 { 99 app_launch("/app/vlaunch"); 89 const char *app = (const char *) widget_get_data(widget); 90 app_launch(app); 100 91 } 101 92 … … 114 105 115 106 winreg = argv[1]; 116 window_t *main_window = window_open(argv[1], 107 window_t *main_window = window_open(argv[1], NULL, 117 108 WINDOW_MAIN | WINDOW_DECORATED | WINDOW_RESIZEABLE, "vlaunch"); 118 109 if (!main_window) { … … 130 121 pixel_t lbl_text = PIXEL(255, 0, 0, 0); 131 122 132 canvas_t *logo_canvas = create_canvas(NULL, LOGO_WIDTH, LOGO_HEIGHT,123 canvas_t *logo_canvas = create_canvas(NULL, NULL, LOGO_WIDTH, LOGO_HEIGHT, 133 124 logo); 134 label_t *lbl_caption = create_label(NULL, "Launch application:", 16, 135 lbl_bg, lbl_text); 136 button_t *btn_vterm = create_button(NULL, "vterm", 16, btn_bg, 137 btn_fg, btn_text); 138 button_t *btn_vdemo = create_button(NULL, "vdemo", 16, btn_bg, 139 btn_fg, btn_text); 140 button_t *btn_vlaunch = create_button(NULL, "vlaunch", 16, btn_bg, 141 btn_fg, btn_text); 142 grid_t *grid = create_grid(window_root(main_window), 1, 5, grd_bg); 125 label_t *lbl_caption = create_label(NULL, NULL, "Launch application:", 126 16, lbl_bg, lbl_text); 127 button_t *btn_vterm = create_button(NULL, "/app/vterm", "vterm", 128 16, btn_bg, btn_fg, btn_text); 129 button_t *btn_vcalc = create_button(NULL, "/app/vcalc", "vcalc", 130 16, btn_bg, btn_fg, btn_text); 131 button_t *btn_vdemo = create_button(NULL, "/app/vdemo", "vdemo", 132 16, btn_bg, btn_fg, btn_text); 133 button_t *btn_vlaunch = create_button(NULL, "/app/vlaunch", "vlaunch", 134 16, btn_bg, btn_fg, btn_text); 135 grid_t *grid = create_grid(window_root(main_window), NULL, 1, 6, grd_bg); 143 136 144 137 if ((!logo_canvas) || (!lbl_caption) || (!btn_vterm) || 145 (!btn_v demo) || (!btn_vlaunch) || (!grid)) {138 (!btn_vcalc) || (!btn_vdemo) || (!btn_vlaunch) || (!grid)) { 146 139 window_close(main_window); 147 140 printf("Cannot create widgets.\n"); … … 149 142 } 150 143 151 sig_connect(&btn_vterm->clicked, NULL, on_vterm); 152 sig_connect(&btn_vdemo->clicked, NULL, on_vdemo); 153 sig_connect(&btn_vlaunch->clicked, NULL, on_vlaunch); 144 sig_connect(&btn_vterm->clicked, &btn_vterm->widget, on_btn_click); 145 sig_connect(&btn_vcalc->clicked, &btn_vcalc->widget, on_btn_click); 146 sig_connect(&btn_vdemo->clicked, &btn_vdemo->widget, on_btn_click); 147 sig_connect(&btn_vlaunch->clicked, &btn_vlaunch->widget, on_btn_click); 154 148 155 149 grid->add(grid, &logo_canvas->widget, 0, 0, 1, 1); 156 150 grid->add(grid, &lbl_caption->widget, 0, 1, 1, 1); 157 151 grid->add(grid, &btn_vterm->widget, 0, 2, 1, 1); 158 grid->add(grid, &btn_vdemo->widget, 0, 3, 1, 1); 159 grid->add(grid, &btn_vlaunch->widget, 0, 4, 1, 1); 152 grid->add(grid, &btn_vcalc->widget, 0, 3, 1, 1); 153 grid->add(grid, &btn_vdemo->widget, 0, 4, 1, 1); 154 grid->add(grid, &btn_vlaunch->widget, 0, 5, 1, 1); 160 155 161 window_resize(main_window, 0, 0, 210, 1 30+ LOGO_HEIGHT,156 window_resize(main_window, 0, 0, 210, 164 + LOGO_HEIGHT, 162 157 WINDOW_PLACEMENT_RIGHT | WINDOW_PLACEMENT_TOP); 163 158 window_exec(main_window); -
uspace/app/vterm/vterm.c
r9befb0d rf126c87 49 49 } 50 50 51 window_t *main_window = window_open(argv[1], 51 window_t *main_window = window_open(argv[1], NULL, 52 52 WINDOW_MAIN | WINDOW_DECORATED, "vterm"); 53 53 if (!main_window) { … … 58 58 window_resize(main_window, 0, 0, 648, 508, WINDOW_PLACEMENT_ANY); 59 59 terminal_t *terminal_widget = 60 create_terminal(window_root(main_window), 640, 480);60 create_terminal(window_root(main_window), NULL, 640, 480); 61 61 if (!terminal_widget) { 62 62 window_close(main_window);
Note:
See TracChangeset
for help on using the changeset viewer.
