Changeset 06d0c81 in mainline for uspace/app


Ignore:
Timestamp:
2020-11-19T22:38:17Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
20667af
Parents:
2e0a2e7
Message:

Window placement

Needed to recreate the current 'desktop' and keep CI tests working

Location:
uspace/app
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/barber/barber.c

    r2e0a2e7 r06d0c81  
    362362        ui_wnd_params_init(&params);
    363363        params.caption = "";
     364        params.placement = ui_wnd_place_bottom_right;
    364365        /*
    365366         * Compute window rectangle such that application area corresponds
  • uspace/app/init/init.c

    r2e0a2e7 r06d0c81  
    277277}
    278278
    279 static int app_start(const char *app)
     279static int app_start(const char *app, const char *arg)
    280280{
    281281        printf("%s: Spawning %s\n", NAME, app);
     
    283283        task_id_t id;
    284284        task_wait_t wait;
    285         errno_t rc = task_spawnl(&id, &wait, app, app, NULL);
     285        errno_t rc = task_spawnl(&id, &wait, app, app, arg, NULL);
    286286        if (rc != EOK) {
    287287                oom_check(rc, app);
     
    471471                rc = display_server();
    472472                if (rc == EOK) {
    473                         app_start("/app/terminal");
    474                         app_start("/app/launcher");
    475                         app_start("/app/barber");
     473                        app_start("/app/launcher", NULL);
     474                        app_start("/app/barber", NULL);
     475                        app_start("/app/terminal", "-topleft");
    476476                }
    477477        }
  • uspace/app/launcher/launcher.c

    r2e0a2e7 r06d0c81  
    184184        ui_wnd_params_init(&params);
    185185        params.caption = "Launcher";
     186        params.placement = ui_wnd_place_top_right;
    186187        params.rect.p0.x = 0;
    187188        params.rect.p0.y = 0;
  • uspace/app/terminal/main.c

    r2e0a2e7 r06d0c81  
    4343static void print_syntax(void)
    4444{
    45         printf("Syntax: %s [-d <display-spec>]\n", NAME);
     45        printf("Syntax: %s [<options>]\n", NAME);
     46        printf("\t-d <display-spec> Use the specified display\n");
     47        printf("\t-topleft]         Place window to the top-left corner of "
     48            "the screen\n");
    4649}
    4750
     
    5053        const char *display_spec = UI_DISPLAY_DEFAULT;
    5154        terminal_t *terminal = NULL;
     55        terminal_flags_t flags = 0;
    5256        errno_t rc;
    5357        int i;
     
    6468
    6569                        display_spec = argv[i++];
     70                } else if (str_cmp(argv[i], "-topleft") == 0) {
     71                        ++i;
     72                        flags |= tf_topleft;
    6673                } else {
    6774                        printf("Invalid option '%s'.\n", argv[i]);
     
    7683        }
    7784
    78         rc = terminal_create(display_spec, 640, 480, &terminal);
     85        rc = terminal_create(display_spec, 640, 480, flags, &terminal);
    7986        if (rc != EOK)
    8087                return 1;
  • uspace/app/terminal/terminal.c

    r2e0a2e7 r06d0c81  
    756756
    757757errno_t terminal_create(const char *display_spec, sysarg_t width,
    758     sysarg_t height, terminal_t **rterm)
     758    sysarg_t height, terminal_flags_t flags, terminal_t **rterm)
    759759{
    760760        terminal_t *term;
     
    811811        ui_wnd_params_init(&wparams);
    812812        wparams.caption = "Terminal";
     813        if ((flags & tf_topleft) != 0)
     814                wparams.placement = ui_wnd_place_top_left;
    813815
    814816        /*
  • uspace/app/terminal/terminal.h

    r2e0a2e7 r06d0c81  
    5454#define UTF8_CHAR_BUFFER_SIZE  (STR_BOUNDS(1) + 1)
    5555
     56typedef enum {
     57        tf_topleft = 1
     58} terminal_flags_t;
     59
    5660typedef struct {
    5761        ui_t *ui;
     
    8589} terminal_t;
    8690
    87 extern errno_t terminal_create(const char *, sysarg_t, sysarg_t, terminal_t **);
     91extern errno_t terminal_create(const char *, sysarg_t, sysarg_t,
     92    terminal_flags_t, terminal_t **);
    8893extern void terminal_destroy(terminal_t *);
    8994
Note: See TracChangeset for help on using the changeset viewer.