Changeset e022819 in mainline


Ignore:
Timestamp:
2020-03-14T00:30:53Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
03c8081
Parents:
1e4a937
Message:

Resizing windows

Location:
uspace
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/display/include/types/display.h

    r1e4a937 re022819  
    7070        /** Position event */
    7171        void (*pos_event)(void *, pos_event_t *);
     72        /** Resize event */
     73        void (*resize_event)(void *, gfx_rect_t *);
    7274        /** Unfocus event */
    7375        void (*unfocus_event)(void *);
  • uspace/lib/display/include/types/display/event.h

    r1e4a937 re022819  
    3636#define _LIBDISPLAY_TYPES_DISPLAY_EVENT_H_
    3737
     38#include <gfx/coord.h>
    3839#include <io/kbd_event.h>
    3940#include <io/pos_event.h>
     
    4950        /** Position event */
    5051        wev_pos,
     52        /** Resize event */
     53        wev_resize,
    5154        /** Window lost focus */
    5255        wev_unfocus
    5356} display_wnd_ev_type_t;
     57
     58/** Display window resize event */
     59typedef struct {
     60        gfx_rect_t rect;
     61} display_wnd_resize_ev_t;
    5462
    5563/** Display window event */
     
    6270                /** Position event data */
    6371                pos_event_t pos;
     72                /** Resize event data */
     73                display_wnd_resize_ev_t resize;
    6474        } ev;
    6575} display_wnd_ev_t;
  • uspace/lib/display/src/display.c

    r1e4a937 re022819  
    460460                        }
    461461                        break;
     462                case wev_resize:
     463                        if (window->cb != NULL && window->cb->resize_event != NULL) {
     464                                window->cb->resize_event(window->cb_arg,
     465                                    &event.ev.resize.rect);
     466                        }
     467                        break;
    462468                case wev_unfocus:
    463469                        if (window->cb != NULL && window->cb->unfocus_event != NULL) {
  • uspace/lib/gui/window.c

    r1e4a937 re022819  
    8787static void window_kbd_event(void *, kbd_event_t *);
    8888static void window_pos_event(void *, pos_event_t *);
     89static void window_resize_event(void *, gfx_rect_t *);
    8990static void window_unfocus_event(void *);
    9091
     
    9495        .kbd_event = window_kbd_event,
    9596        .pos_event = window_pos_event,
     97        .resize_event = window_resize_event,
    9698        .unfocus_event = window_unfocus_event
    9799};
     
    313315                } else if (left && btn_left) {
    314316                        (void) display_window_resize_req(widget->window->dwindow,
    315                             display_wr_bottom, &pos);
     317                            display_wr_left, &pos);
    316318                } else if (bottom && btn_left) {
    317319                        (void) display_window_resize_req(widget->window->dwindow,
     
    319321                } else if (right && btn_left) {
    320322                        (void) display_window_resize_req(widget->window->dwindow,
    321                             display_wr_bottom, &pos);
     323                            display_wr_right, &pos);
    322324                } else if (close && btn_left) {
    323325                        window_close(widget->window);
     
    815817}
    816818
     819static void window_resize_event(void *arg, gfx_rect_t *nrect)
     820{
     821        window_t *win = (window_t *) arg;
     822        window_event_t *event;
     823
     824        event = (window_event_t *) calloc(1, sizeof(window_event_t));
     825        if (event == NULL)
     826                return;
     827
     828        link_initialize(&event->link);
     829        event->type = ET_WINDOW_RESIZE;
     830        event->data.resize.offset_x = nrect->p0.x;
     831        event->data.resize.offset_y = nrect->p0.y;
     832        event->data.resize.width = nrect->p1.x - nrect->p0.x;
     833        event->data.resize.height = nrect->p1.y - nrect->p0.y;
     834        event->data.resize.placement_flags = WINDOW_PLACEMENT_ANY;
     835        prodcons_produce(&win->events, &event->link);
     836}
     837
    817838static void window_unfocus_event(void *arg)
    818839{
  • uspace/srv/hid/display/client.c

    r1e4a937 re022819  
    316316}
    317317
     318/** Post resize event to the client's message queue.
     319 *
     320 * @param client Client
     321 * @param ewindow Window that the message is targetted to
     322 * @param rect New window rectangle
     323 *
     324 * @return EOK on success or an error code
     325 */
     326errno_t ds_client_post_resize_event(ds_client_t *client, ds_window_t *ewindow,
     327    gfx_rect_t *rect)
     328{
     329        ds_window_ev_t *wevent;
     330
     331        wevent = calloc(1, sizeof(ds_window_ev_t));
     332        if (wevent == NULL)
     333                return ENOMEM;
     334
     335        wevent->window = ewindow;
     336        wevent->event.etype = wev_resize;
     337        wevent->event.ev.resize.rect = *rect;
     338        list_append(&wevent->levents, &client->events);
     339
     340        /* Notify the client */
     341        // TODO Do not send more than once until client drains the queue
     342        if (client->cb != NULL && client->cb->ev_pending != NULL)
     343                client->cb->ev_pending(client->cb_arg);
     344
     345        return EOK;
     346}
     347
    318348/** Post unfocus event to the client's message queue.
    319349 *
  • uspace/srv/hid/display/client.h

    r1e4a937 re022819  
    5959extern errno_t ds_client_post_pos_event(ds_client_t *, ds_window_t *,
    6060    pos_event_t *);
     61extern errno_t ds_client_post_resize_event(ds_client_t *, ds_window_t *,
     62    gfx_rect_t *);
    6163extern errno_t ds_client_post_unfocus_event(ds_client_t *, ds_window_t *);
    6264
  • uspace/srv/hid/display/dsops.c

    r1e4a937 re022819  
    4747static errno_t disp_window_destroy(void *, sysarg_t);
    4848static errno_t disp_window_move_req(void *, sysarg_t, gfx_coord2_t *);
     49static errno_t disp_window_resize_req(void *, sysarg_t,
     50    display_wnd_rsztype_t, gfx_coord2_t *);
    4951static errno_t disp_window_resize(void *, sysarg_t, gfx_coord2_t *,
    5052    gfx_rect_t *);
     
    5557        .window_destroy = disp_window_destroy,
    5658        .window_move_req = disp_window_move_req,
     59        .window_resize_req = disp_window_resize_req,
    5760        .window_resize = disp_window_resize,
    5861        .get_event = disp_get_event
     
    119122}
    120123
     124static errno_t disp_window_resize_req(void *arg, sysarg_t wnd_id,
     125    display_wnd_rsztype_t rsztype, gfx_coord2_t *pos)
     126{
     127        ds_client_t *client = (ds_client_t *) arg;
     128        ds_window_t *wnd;
     129
     130        wnd = ds_client_find_window(client, wnd_id);
     131        if (wnd == NULL)
     132                return ENOENT;
     133
     134        log_msg(LVL_NOTE, LVL_DEBUG, "disp_window_resize_req()");
     135        ds_window_resize_req(wnd, rsztype, pos);
     136        return EOK;
     137}
     138
    121139static errno_t disp_window_resize(void *arg, sysarg_t wnd_id,
    122140    gfx_coord2_t *offs, gfx_rect_t *nbound)
  • uspace/srv/hid/display/test/client.c

    r1e4a937 re022819  
    369369}
    370370
     371/** Test ds_client_get_event(), ds_client_post_resize_event(). */
     372PCUT_TEST(client_get_post_resize_event)
     373{
     374        ds_display_t *disp;
     375        ds_client_t *client;
     376        ds_window_t *wnd;
     377        display_wnd_params_t params;
     378        gfx_rect_t rect;
     379        ds_window_t *rwindow;
     380        display_wnd_ev_t revent;
     381        bool called_cb = NULL;
     382        errno_t rc;
     383
     384        rc = ds_display_create(NULL, &disp);
     385        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     386
     387        rc = ds_client_create(disp, &test_ds_client_cb, &called_cb, &client);
     388        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     389
     390        display_wnd_params_init(&params);
     391        params.rect.p0.x = params.rect.p0.y = 0;
     392        params.rect.p1.x = params.rect.p1.y = 1;
     393
     394        rc = ds_window_create(client, &params, &wnd);
     395        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     396
     397        rect.p0.x = 1;
     398        rect.p0.y = 2;
     399        rect.p1.x = 3;
     400        rect.p1.y = 4;
     401
     402        PCUT_ASSERT_FALSE(called_cb);
     403
     404        rc = ds_client_get_event(client, &rwindow, &revent);
     405        PCUT_ASSERT_ERRNO_VAL(ENOENT, rc);
     406
     407        rc = ds_client_post_resize_event(client, wnd, &rect);
     408        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     409        PCUT_ASSERT_TRUE(called_cb);
     410
     411        rc = ds_client_get_event(client, &rwindow, &revent);
     412        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     413        PCUT_ASSERT_EQUALS(wnd, rwindow);
     414        PCUT_ASSERT_EQUALS(wev_resize, revent.etype);
     415        PCUT_ASSERT_EQUALS(rect.p0.x, revent.ev.resize.rect.p0.x);
     416        PCUT_ASSERT_EQUALS(rect.p0.y, revent.ev.resize.rect.p0.y);
     417        PCUT_ASSERT_EQUALS(rect.p1.x, revent.ev.resize.rect.p1.x);
     418        PCUT_ASSERT_EQUALS(rect.p1.y, revent.ev.resize.rect.p1.y);
     419
     420        rc = ds_client_get_event(client, &rwindow, &revent);
     421        PCUT_ASSERT_ERRNO_VAL(ENOENT, rc);
     422
     423        ds_window_destroy(wnd);
     424        ds_client_destroy(client);
     425        ds_display_destroy(disp);
     426}
     427
    371428/** Test ds_client_get_event(), ds_client_post_unfocus_event(). */
    372429PCUT_TEST(client_get_post_unfocus_event)
  • uspace/srv/hid/display/test/window.c

    r1e4a937 re022819  
    281281}
    282282
     283/** Test ds_window_resize_req() */
     284PCUT_TEST(window_resize_req)
     285{
     286        gfx_context_t *gc;
     287        ds_display_t *disp;
     288        ds_client_t *client;
     289        ds_window_t *wnd;
     290        display_wnd_params_t params;
     291        gfx_coord2_t pos;
     292        errno_t rc;
     293
     294        rc = gfx_context_new(&dummy_ops, NULL, &gc);
     295        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     296
     297        rc = ds_display_create(gc, &disp);
     298        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     299
     300        rc = ds_client_create(disp, NULL, NULL, &client);
     301        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     302
     303        display_wnd_params_init(&params);
     304        params.rect.p0.x = params.rect.p0.y = 0;
     305        params.rect.p1.x = params.rect.p1.y = 1;
     306
     307        rc = ds_window_create(client, &params, &wnd);
     308        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     309
     310        PCUT_ASSERT_INT_EQUALS(dsw_idle, wnd->state);
     311
     312        pos.x = 42;
     313        pos.y = 43;
     314        ds_window_resize_req(wnd, display_wr_top_right, &pos);
     315
     316        PCUT_ASSERT_INT_EQUALS(dsw_resizing, wnd->state);
     317        PCUT_ASSERT_INT_EQUALS(display_wr_top_right, wnd->rsztype);
     318        PCUT_ASSERT_INT_EQUALS(pos.x, wnd->orig_pos.x);
     319        PCUT_ASSERT_INT_EQUALS(pos.y, wnd->orig_pos.y);
     320
     321        ds_window_destroy(wnd);
     322        ds_client_destroy(client);
     323        ds_display_destroy(disp);
     324}
     325
     326PCUT_TEST(window_calc_resize)
     327{
     328        ds_display_t *disp;
     329        ds_client_t *client;
     330        ds_window_t *wnd;
     331        display_wnd_params_t params;
     332        gfx_coord2_t dresize;
     333        gfx_rect_t nrect;
     334        errno_t rc;
     335
     336        rc = ds_display_create(NULL, &disp);
     337        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     338
     339        rc = ds_client_create(disp, NULL, NULL, &client);
     340        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     341
     342        display_wnd_params_init(&params);
     343        params.rect.p0.x = 10;
     344        params.rect.p0.y = 11;
     345        params.rect.p1.x = 20;
     346        params.rect.p1.y = 21;
     347
     348        rc = ds_window_create(client, &params, &wnd);
     349        PCUT_ASSERT_ERRNO_VAL(EOK, rc);
     350
     351        wnd->state = dsw_resizing;
     352        dresize.x = 5;
     353        dresize.y = 6;
     354
     355        wnd->rsztype = display_wr_top;
     356        ds_window_calc_resize(wnd, &dresize, &nrect);
     357        PCUT_ASSERT_INT_EQUALS(10, nrect.p0.x);
     358        PCUT_ASSERT_INT_EQUALS(17, nrect.p0.y);
     359        PCUT_ASSERT_INT_EQUALS(20, nrect.p1.x);
     360        PCUT_ASSERT_INT_EQUALS(21, nrect.p1.y);
     361
     362        wnd->rsztype = display_wr_top_left;
     363        ds_window_calc_resize(wnd, &dresize, &nrect);
     364        PCUT_ASSERT_INT_EQUALS(15, nrect.p0.x);
     365        PCUT_ASSERT_INT_EQUALS(17, nrect.p0.y);
     366        PCUT_ASSERT_INT_EQUALS(20, nrect.p1.x);
     367        PCUT_ASSERT_INT_EQUALS(21, nrect.p1.y);
     368
     369        wnd->rsztype = display_wr_left;
     370        ds_window_calc_resize(wnd, &dresize, &nrect);
     371        PCUT_ASSERT_INT_EQUALS(15, nrect.p0.x);
     372        PCUT_ASSERT_INT_EQUALS(11, nrect.p0.y);
     373        PCUT_ASSERT_INT_EQUALS(20, nrect.p1.x);
     374        PCUT_ASSERT_INT_EQUALS(21, nrect.p1.y);
     375
     376        wnd->rsztype = display_wr_bottom_left;
     377        ds_window_calc_resize(wnd, &dresize, &nrect);
     378        PCUT_ASSERT_INT_EQUALS(15, nrect.p0.x);
     379        PCUT_ASSERT_INT_EQUALS(11, nrect.p0.y);
     380        PCUT_ASSERT_INT_EQUALS(20, nrect.p1.x);
     381        PCUT_ASSERT_INT_EQUALS(27, nrect.p1.y);
     382
     383        wnd->rsztype = display_wr_bottom;
     384        ds_window_calc_resize(wnd, &dresize, &nrect);
     385        PCUT_ASSERT_INT_EQUALS(10, nrect.p0.x);
     386        PCUT_ASSERT_INT_EQUALS(11, nrect.p0.y);
     387        PCUT_ASSERT_INT_EQUALS(20, nrect.p1.x);
     388        PCUT_ASSERT_INT_EQUALS(27, nrect.p1.y);
     389
     390        wnd->rsztype = display_wr_bottom_right;
     391        ds_window_calc_resize(wnd, &dresize, &nrect);
     392        PCUT_ASSERT_INT_EQUALS(10, nrect.p0.x);
     393        PCUT_ASSERT_INT_EQUALS(11, nrect.p0.y);
     394        PCUT_ASSERT_INT_EQUALS(25, nrect.p1.x);
     395        PCUT_ASSERT_INT_EQUALS(27, nrect.p1.y);
     396
     397        wnd->rsztype = display_wr_right;
     398        ds_window_calc_resize(wnd, &dresize, &nrect);
     399        PCUT_ASSERT_INT_EQUALS(10, nrect.p0.x);
     400        PCUT_ASSERT_INT_EQUALS(11, nrect.p0.y);
     401        PCUT_ASSERT_INT_EQUALS(25, nrect.p1.x);
     402        PCUT_ASSERT_INT_EQUALS(21, nrect.p1.y);
     403
     404        wnd->rsztype = display_wr_top_right;
     405        ds_window_calc_resize(wnd, &dresize, &nrect);
     406        PCUT_ASSERT_INT_EQUALS(10, nrect.p0.x);
     407        PCUT_ASSERT_INT_EQUALS(17, nrect.p0.y);
     408        PCUT_ASSERT_INT_EQUALS(25, nrect.p1.x);
     409        PCUT_ASSERT_INT_EQUALS(21, nrect.p1.y);
     410
     411        ds_window_destroy(wnd);
     412        ds_client_destroy(client);
     413        ds_display_destroy(disp);
     414}
     415
    283416static errno_t dummy_set_color(void *arg, gfx_color_t *color)
    284417{
  • uspace/srv/hid/display/types/display/window.h

    r1e4a937 re022819  
    3939#include <adt/list.h>
    4040#include <display/event.h>
     41#include <display/wndresize.h>
    4142#include <gfx/context.h>
    4243#include <gfx/coord.h>
     
    5051        dsw_idle,
    5152        /** Moving by mouse drag */
    52         dsw_moving
     53        dsw_moving,
     54        /** Resizing by mouse drag */
     55        dsw_resizing
    5356} ds_window_state_t;
    5457
     
    8083        /** State */
    8184        ds_window_state_t state;
    82         /** Original position before started to move the window */
     85        /** Original position before started to move or resize the window */
    8386        gfx_coord2_t orig_pos;
     87        /** Window resize type (if state is dsw_resizing) */
     88        display_wnd_rsztype_t rsztype;
    8489} ds_window_t;
    8590
  • uspace/srv/hid/display/window.c

    r1e4a937 re022819  
    436436}
    437437
    438 /** Start moving a window, detected by client.
    439  *
    440  * @param wnd Window
    441  * @param pos Position where the pointer was when the move started
    442  *            relative to the window
    443  * @param event Button press event
    444  */
    445 void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos)
    446 {
    447         log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_move_req (%d, %d)",
    448             (int) pos->x, (int) pos->y);
    449 
    450         if (wnd->state != dsw_idle)
    451                 return;
    452 
    453         gfx_coord2_add(&wnd->dpos, pos, &wnd->orig_pos);
    454         wnd->state = dsw_moving;
    455 }
    456 
    457438/** Start moving a window by mouse drag.
    458439 *
     
    553534}
    554535
     536/** Finish resizing a window by mouse drag.
     537 *
     538 * @param wnd Window
     539 * @param event Button release event
     540 */
     541static void ds_window_finish_resize(ds_window_t *wnd, pos_event_t *event)
     542{
     543        gfx_coord2_t pos;
     544        gfx_coord2_t dresize;
     545        gfx_rect_t nrect;
     546
     547        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_finish_resize (%d, %d)",
     548            (int) event->hpos, (int) event->vpos);
     549
     550        if (wnd->state != dsw_resizing)
     551                return;
     552
     553        pos.x = event->hpos;
     554        pos.y = event->vpos;
     555        gfx_coord2_subtract(&pos, &wnd->orig_pos, &dresize);
     556
     557        /* Compute new rectangle */
     558        ds_window_calc_resize(wnd, &dresize, &nrect);
     559
     560        wnd->state = dsw_idle;
     561        ds_client_post_resize_event(wnd->client, wnd, &nrect);
     562}
     563
     564/** Update window position when resizing by mouse drag.
     565 *
     566 * @param wnd Window
     567 * @param event Position update event
     568 */
     569static void ds_window_update_resize(ds_window_t *wnd, pos_event_t *event)
     570{
     571        gfx_coord2_t pos;
     572        gfx_coord2_t dresize;
     573        gfx_rect_t nrect;
     574        gfx_rect_t drect;
     575        gfx_color_t *color;
     576        gfx_context_t *gc;
     577        errno_t rc;
     578
     579        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_update_resize (%d, %d)",
     580            (int) event->hpos, (int) event->vpos);
     581
     582        if (wnd->state != dsw_resizing)
     583                return;
     584
     585        gfx_rect_translate(&wnd->dpos, &wnd->rect, &drect);
     586
     587        gc = ds_display_get_gc(wnd->display); // XXX
     588        if (gc != NULL) {
     589                gfx_set_color(gc, wnd->display->bg_color);
     590                gfx_fill_rect(gc, &drect);
     591        }
     592
     593        pos.x = event->hpos;
     594        pos.y = event->vpos;
     595        gfx_coord2_subtract(&pos, &wnd->orig_pos, &dresize);
     596
     597        ds_window_calc_resize(wnd, &dresize, &nrect);
     598        gfx_rect_translate(&wnd->dpos, &nrect, &drect);
     599
     600        rc = gfx_color_new_rgb_i16(0xffff, 0xffff, 0xffff, &color);
     601        if (rc != EOK)
     602                return;
     603
     604        gc = ds_display_get_gc(wnd->display); // XXX
     605        if (gc != NULL) {
     606                gfx_set_color(gc, color);
     607                gfx_fill_rect(gc, &drect);
     608        }
     609
     610        gfx_color_delete(color);
     611}
     612
    555613/** Post keyboard event to window.
    556614 *
     
    599657                ds_window_start_move(wnd, event);
    600658
    601         if (event->type == POS_RELEASE)
     659        if (event->type == POS_RELEASE) {
    602660                ds_window_finish_move(wnd, event);
    603 
    604         if (event->type == POS_UPDATE)
     661                ds_window_finish_resize(wnd, event);
     662        }
     663
     664        if (event->type == POS_UPDATE) {
    605665                ds_window_update_move(wnd, event);
     666                ds_window_update_resize(wnd, event);
     667        }
    606668
    607669        /* Transform event coordinates to window-local */
     
    635697}
    636698
     699/** Start moving a window, detected by client.
     700 *
     701 * @param wnd Window
     702 * @param pos Position where the pointer was when the move started
     703 *            relative to the window
     704 * @param event Button press event
     705 */
     706void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *pos)
     707{
     708        log_msg(LOG_DEFAULT, LVL_DEBUG, "ds_window_move_req (%d, %d)",
     709            (int) pos->x, (int) pos->y);
     710
     711        if (wnd->state != dsw_idle)
     712                return;
     713
     714        gfx_coord2_add(&wnd->dpos, pos, &wnd->orig_pos);
     715        wnd->state = dsw_moving;
     716}
     717
     718/** Start resizing a window, detected by client.
     719 *
     720 * @param wnd Window
     721 * @param rsztype Resize type (which part of window is being dragged)
     722 * @param pos Position where the pointer was when the resize started
     723 *            relative to the window
     724 * @param event Button press event
     725 */
     726void ds_window_resize_req(ds_window_t *wnd, display_wnd_rsztype_t rsztype,
     727    gfx_coord2_t *pos)
     728{
     729        log_msg(LOG_DEFAULT, LVL_NOTE, "ds_window_resize_req (%d, %d, %d)",
     730            (int) rsztype, (int) pos->x, (int) pos->y);
     731
     732        if (wnd->state != dsw_idle)
     733                return;
     734
     735        gfx_coord2_add(&wnd->dpos, pos, &wnd->orig_pos);
     736        wnd->state = dsw_resizing;
     737        wnd->rsztype = rsztype;
     738}
     739
     740/** Compute new window rectangle after resize operation.
     741 *
     742 * @param wnd Window which is being resized (in dsw_resizing state and thus
     743 *            has rsztype set)
     744 * @param dresize Amount by which to resize
     745 * @param nrect Place to store new rectangle
     746 */
     747void ds_window_calc_resize(ds_window_t *wnd, gfx_coord2_t *dresize,
     748    gfx_rect_t *nrect)
     749{
     750        *nrect = wnd->rect;
     751
     752        if ((wnd->rsztype & display_wr_top) != 0)
     753                nrect->p0.y += dresize->y;
     754        if ((wnd->rsztype & display_wr_left) != 0)
     755                nrect->p0.x += dresize->x;
     756        if ((wnd->rsztype & display_wr_bottom) != 0)
     757                nrect->p1.y += dresize->y;
     758        if ((wnd->rsztype & display_wr_right) != 0)
     759                nrect->p1.x += dresize->x;
     760}
     761
    637762/** @}
    638763 */
  • uspace/srv/hid/display/window.h

    r1e4a937 re022819  
    3737#define WINDOW_H
    3838
     39#include <display/wndparams.h>
     40#include <display/wndresize.h>
    3941#include <errno.h>
    4042#include <io/pos_event.h>
     
    4446#include "types/display/display.h"
    4547#include "types/display/window.h"
    46 #include "types/display/wndparams.h"
    4748
    4849extern gfx_context_ops_t window_gc_ops;
     
    5960extern errno_t ds_window_post_unfocus_event(ds_window_t *);
    6061extern void ds_window_move_req(ds_window_t *wnd, gfx_coord2_t *);
     62extern void ds_window_resize_req(ds_window_t *wnd, display_wnd_rsztype_t,
     63    gfx_coord2_t *);
     64extern void ds_window_calc_resize(ds_window_t *wnd, gfx_coord2_t *,
     65    gfx_rect_t *);
    6166
    6267#endif
Note: See TracChangeset for help on using the changeset viewer.