Changeset 3be5366 in mainline for uspace/lib/ui/test/wdecor.c


Ignore:
Timestamp:
2023-01-19T12:09:34Z (15 months ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6828a56
Parents:
aaa3b855
git-author:
Jiri Svoboda <jiri@…> (2023-01-19 18:09:23)
git-committer:
Jiri Svoboda <jiri@…> (2023-01-19 12:09:34)
Message:

Add pos_id information to move request, too

This will become useful momentarily.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/ui/test/wdecor.c

    raaa3b855 r3be5366  
    6666static void test_wdecor_unmaximize(ui_wdecor_t *, void *);
    6767static void test_wdecor_close(ui_wdecor_t *, void *);
    68 static void test_wdecor_move(ui_wdecor_t *, void *, gfx_coord2_t *);
     68static void test_wdecor_move(ui_wdecor_t *, void *, gfx_coord2_t *, sysarg_t);
    6969static void test_wdecor_resize(ui_wdecor_t *, void *, ui_wdecor_rsztype_t,
    7070    gfx_coord2_t *, sysarg_t);
     
    339339        test_cb_resp_t resp;
    340340        gfx_coord2_t pos;
     341        sysarg_t pos_id;
    341342
    342343        rc = ui_wdecor_create(NULL, "Hello", ui_wds_none, &wdecor);
     
    345346        pos.x = 3;
    346347        pos.y = 4;
     348        pos_id = 5;
    347349
    348350        /* Move callback with no callbacks set */
    349         ui_wdecor_move(wdecor, &pos);
     351        ui_wdecor_move(wdecor, &pos, pos_id);
    350352
    351353        /* Move callback with move callback not implemented */
    352354        ui_wdecor_set_cb(wdecor, &dummy_wdecor_cb, NULL);
    353         ui_wdecor_move(wdecor, &pos);
     355        ui_wdecor_move(wdecor, &pos, pos_id);
    354356
    355357        /* Move callback with real callback set */
     
    357359        resp.pos.x = 0;
    358360        resp.pos.y = 0;
     361        resp.pos_id = 0;
    359362        ui_wdecor_set_cb(wdecor, &test_wdecor_cb, &resp);
    360         ui_wdecor_move(wdecor, &pos);
     363        ui_wdecor_move(wdecor, &pos, pos_id);
    361364        PCUT_ASSERT_TRUE(resp.move);
    362365        PCUT_ASSERT_INT_EQUALS(pos.x, resp.pos.x);
    363366        PCUT_ASSERT_INT_EQUALS(pos.y, resp.pos.y);
     367        PCUT_ASSERT_INT_EQUALS(pos_id, resp.pos_id);
    364368
    365369        ui_wdecor_destroy(wdecor);
     
    10751079}
    10761080
    1077 static void test_wdecor_move(ui_wdecor_t *wdecor, void *arg, gfx_coord2_t *pos)
     1081static void test_wdecor_move(ui_wdecor_t *wdecor, void *arg, gfx_coord2_t *pos,
     1082    sysarg_t pos_id)
    10781083{
    10791084        test_cb_resp_t *resp = (test_cb_resp_t *) arg;
     
    10811086        resp->move = true;
    10821087        resp->pos = *pos;
     1088        resp->pos_id = pos_id;
    10831089}
    10841090
Note: See TracChangeset for help on using the changeset viewer.