Changeset ec8a1bf in mainline


Ignore:
Timestamp:
2021-11-03T18:27:47Z (2 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
552b69f
Parents:
b48e680f
Message:

Add Text Editor to launcher

Location:
uspace/app/launcher
Files:
2 edited

Legend:

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

    rb48e680f rec8a1bf  
    9696                app_launchl("/app/terminal", "-c", "/app/nav", NULL);
    9797        } else if (pbutton == launcher->pb2) {
     98                app_launchl("/app/terminal", "-c", "/app/edit", NULL);
     99        } else if (pbutton == launcher->pb3) {
    98100                app_launchl("/app/terminal", NULL);
    99         } else if (pbutton == launcher->pb3) {
     101        } else if (pbutton == launcher->pb4) {
    100102                app_launchl("/app/calculator", NULL);
    101         } else if (pbutton == launcher->pb4) {
     103        } else if (pbutton == launcher->pb5) {
    102104                app_launchl("/app/uidemo", NULL);
    103         } else if (pbutton == launcher->pb5) {
     105        } else if (pbutton == launcher->pb6) {
    104106                app_launchl("/app/gfxdemo", "ui", NULL);
    105107        }
     
    222224        params.rect.p0.y = 0;
    223225        params.rect.p1.x = 210;
    224         params.rect.p1.y = 310;
     226        params.rect.p1.y = 345;
    225227
    226228        memset((void *) &launcher, 0, sizeof(launcher));
     
    318320        }
    319321
     322        /* Text Editor */
     323
     324        rc = ui_pbutton_create(ui_res, "Text Editor", &launcher.pb2);
     325        if (rc != EOK) {
     326                printf("Error creating button.\n");
     327                return rc;
     328        }
     329
     330        ui_pbutton_set_cb(launcher.pb2, &pbutton_cb, (void *) &launcher);
     331
     332        rect.p0.x = 15;
     333        rect.p0.y = 130 + 35;
     334        rect.p1.x = 190;
     335        rect.p1.y = rect.p0.y + 28;
     336        ui_pbutton_set_rect(launcher.pb2, &rect);
     337
     338        rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb2));
     339        if (rc != EOK) {
     340                printf("Error adding control to layout.\n");
     341                return rc;
     342        }
     343
    320344        /* Terminal */
    321345
    322         rc = ui_pbutton_create(ui_res, "Terminal", &launcher.pb2);
    323         if (rc != EOK) {
    324                 printf("Error creating button.\n");
    325                 return rc;
    326         }
    327 
    328         ui_pbutton_set_cb(launcher.pb2, &pbutton_cb, (void *) &launcher);
    329 
    330         rect.p0.x = 15;
    331         rect.p0.y = 130 + 35;
    332         rect.p1.x = 190;
    333         rect.p1.y = rect.p0.y + 28;
    334         ui_pbutton_set_rect(launcher.pb2, &rect);
    335 
    336         rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb2));
     346        rc = ui_pbutton_create(ui_res, "Terminal", &launcher.pb3);
     347        if (rc != EOK) {
     348                printf("Error creating button.\n");
     349                return rc;
     350        }
     351
     352        ui_pbutton_set_cb(launcher.pb3, &pbutton_cb, (void *) &launcher);
     353
     354        rect.p0.x = 15;
     355        rect.p0.y = 130 + 2 * 35;
     356        rect.p1.x = 190;
     357        rect.p1.y = rect.p0.y + 28;
     358        ui_pbutton_set_rect(launcher.pb3, &rect);
     359
     360        rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb3));
    337361        if (rc != EOK) {
    338362                printf("Error adding control to layout.\n");
     
    342366        /* Calculator */
    343367
    344         rc = ui_pbutton_create(ui_res, "Calculator", &launcher.pb3);
    345         if (rc != EOK) {
    346                 printf("Error creating button.\n");
    347                 return rc;
    348         }
    349 
    350         ui_pbutton_set_cb(launcher.pb3, &pbutton_cb, (void *) &launcher);
    351 
    352         rect.p0.x = 15;
    353         rect.p0.y = 130 + 2 * 35;
    354         rect.p1.x = 190;
    355         rect.p1.y = rect.p0.y + 28;
    356         ui_pbutton_set_rect(launcher.pb3, &rect);
    357 
    358         rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb3));
     368        rc = ui_pbutton_create(ui_res, "Calculator", &launcher.pb4);
     369        if (rc != EOK) {
     370                printf("Error creating button.\n");
     371                return rc;
     372        }
     373
     374        ui_pbutton_set_cb(launcher.pb4, &pbutton_cb, (void *) &launcher);
     375
     376        rect.p0.x = 15;
     377        rect.p0.y = 130 + 3 * 35;
     378        rect.p1.x = 190;
     379        rect.p1.y = rect.p0.y + 28;
     380        ui_pbutton_set_rect(launcher.pb4, &rect);
     381
     382        rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb4));
    359383        if (rc != EOK) {
    360384                printf("Error adding control to layout.\n");
     
    364388        /* UI Demo */
    365389
    366         rc = ui_pbutton_create(ui_res, "UI Demo", &launcher.pb4);
    367         if (rc != EOK) {
    368                 printf("Error creating button.\n");
    369                 return rc;
    370         }
    371 
    372         ui_pbutton_set_cb(launcher.pb4, &pbutton_cb, (void *) &launcher);
    373 
    374         rect.p0.x = 15;
    375         rect.p0.y = 130 + 3 * 35;
    376         rect.p1.x = 190;
    377         rect.p1.y = rect.p0.y + 28;
    378         ui_pbutton_set_rect(launcher.pb4, &rect);
    379 
    380         rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb4));
     390        rc = ui_pbutton_create(ui_res, "UI Demo", &launcher.pb5);
     391        if (rc != EOK) {
     392                printf("Error creating button.\n");
     393                return rc;
     394        }
     395
     396        ui_pbutton_set_cb(launcher.pb5, &pbutton_cb, (void *) &launcher);
     397
     398        rect.p0.x = 15;
     399        rect.p0.y = 130 + 4 * 35;
     400        rect.p1.x = 190;
     401        rect.p1.y = rect.p0.y + 28;
     402        ui_pbutton_set_rect(launcher.pb5, &rect);
     403
     404        rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb5));
    381405        if (rc != EOK) {
    382406                printf("Error adding control to layout.\n");
     
    386410        /* GFX Demo */
    387411
    388         rc = ui_pbutton_create(ui_res, "GFX Demo", &launcher.pb5);
    389         if (rc != EOK) {
    390                 printf("Error creating button.\n");
    391                 return rc;
    392         }
    393 
    394         ui_pbutton_set_cb(launcher.pb5, &pbutton_cb, (void *) &launcher);
    395 
    396         rect.p0.x = 15;
    397         rect.p0.y = 130 + 4 * 35;
    398         rect.p1.x = 190;
    399         rect.p1.y = rect.p0.y + 28;
    400         ui_pbutton_set_rect(launcher.pb5, &rect);
    401 
    402         rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb5));
     412        rc = ui_pbutton_create(ui_res, "GFX Demo", &launcher.pb6);
     413        if (rc != EOK) {
     414                printf("Error creating button.\n");
     415                return rc;
     416        }
     417
     418        ui_pbutton_set_cb(launcher.pb6, &pbutton_cb, (void *) &launcher);
     419
     420        rect.p0.x = 15;
     421        rect.p0.y = 130 + 5 * 35;
     422        rect.p1.x = 190;
     423        rect.p1.y = rect.p0.y + 28;
     424        ui_pbutton_set_rect(launcher.pb6, &rect);
     425
     426        rc = ui_fixed_add(launcher.fixed, ui_pbutton_ctl(launcher.pb6));
    403427        if (rc != EOK) {
    404428                printf("Error adding control to layout.\n");
  • uspace/app/launcher/launcher.h

    rb48e680f rec8a1bf  
    5757        ui_pbutton_t *pb4;
    5858        ui_pbutton_t *pb5;
     59        ui_pbutton_t *pb6;
    5960} launcher_t;
    6061
Note: See TracChangeset for help on using the changeset viewer.