Changeset 7cc30e9 in mainline for uspace/srv/hid/display/test/window.c


Ignore:
Timestamp:
2022-10-24T17:50:46Z (3 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
913add60
Parents:
7a05d924
Message:

Display server needs to store window caption

Even though it does not use it itself, it needs to provide it to
window managers (e.g. Task bar). We need to be able to set caption
for a new window and to change it for an existing window.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/test/window.c

    r7a05d924 r7cc30e9  
    851851}
    852852
     853/** Test ds_window_set_caption() */
     854PCUT_TEST(window_set_caption)
     855{
     856        gfx_context_t *gc;
     857        ds_display_t *disp;
     858        ds_client_t *client;
     859        ds_seat_t *seat;
     860        ds_window_t *wnd;
     861        display_wnd_params_t params;
     862        errno_t rc;
     863
     864        rc = gfx_context_new(&dummy_ops, NULL, &gc);
     865        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     866
     867        rc = ds_display_create(gc, df_none, &disp);
     868        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     869
     870        rc = ds_client_create(disp, NULL, NULL, &client);
     871        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     872
     873        rc = ds_seat_create(disp, &seat);
     874        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     875
     876        display_wnd_params_init(&params);
     877        params.rect.p0.x = params.rect.p0.y = 0;
     878        params.rect.p1.x = params.rect.p1.y = 1;
     879
     880        rc = ds_window_create(client, &params, &wnd);
     881        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     882
     883        PCUT_ASSERT_EQUALS(wnd->display->cursor[dcurs_arrow], wnd->cursor);
     884
     885        rc = ds_window_set_caption(wnd, "Hello");
     886        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     887        PCUT_ASSERT_INT_EQUALS(0, str_cmp("Hello", wnd->caption));
     888
     889        ds_window_destroy(wnd);
     890        ds_seat_destroy(seat);
     891        ds_client_destroy(client);
     892        ds_display_destroy(disp);
     893}
     894
    853895static errno_t dummy_set_color(void *arg, gfx_color_t *color)
    854896{
Note: See TracChangeset for help on using the changeset viewer.