Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset ff6e91b in mainline for uspace/lib/ui/test/paint.c


Ignore:
Timestamp:
2021-08-30T20:41:27Z (7 weeks ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
81ec7e1
Parents:
9b2e20c
Message:

Make use of code page 437 characters

To draw proper text boxes, for a nice round radio button light,
for a nice contiguous slider groove.

File:
1 edited

Legend:

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

    r9b2e20c rff6e91b  
    241241}
    242242
     243/** Paint text box */
     244PCUT_TEST(text_box)
     245{
     246        errno_t rc;
     247        gfx_context_t *gc = NULL;
     248        ui_resource_t *resource = NULL;
     249        gfx_color_t *color = NULL;
     250        test_gc_t tgc;
     251        gfx_rect_t rect;
     252
     253        memset(&tgc, 0, sizeof(tgc));
     254        rc = gfx_context_new(&ops, &tgc, &gc);
     255        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     256
     257        rc = ui_resource_create(gc, false, &resource);
     258        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     259        PCUT_ASSERT_NOT_NULL(resource);
     260
     261        rc = gfx_color_new_rgb_i16(1, 2, 3, &color);
     262        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     263
     264        rect.p0.x = 10;
     265        rect.p0.y = 20;
     266        rect.p1.x = 30;
     267        rect.p1.y = 40;
     268
     269        /* Paint text box */
     270        rc = ui_paint_text_box(resource, &rect, ui_box_single, color);
     271        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     272
     273        gfx_color_delete(color);
     274        ui_resource_destroy(resource);
     275        rc = gfx_context_delete(gc);
     276        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     277}
     278
    243279static errno_t testgc_set_clip_rect(void *arg, gfx_rect_t *rect)
    244280{
Note: See TracChangeset for help on using the changeset viewer.