Ignore:
Timestamp:
2012-11-25T21:26:29Z (12 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
82edef2
Parents:
290a0f0
Message:

Improved window opening API to allow specification of initial window coordinates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/compositor/compositor.c

    r290a0f0 rfa98b26a  
    207207}
    208208
    209 static window_t *window_create()
     209static window_t *window_create(sysarg_t x_offset, sysarg_t y_offset)
    210210{
    211211        window_t *win = (window_t *) malloc(sizeof(window_t));
     
    217217        prodcons_initialize(&win->queue);
    218218        transform_identity(&win->transform);
    219         transform_translate(&win->transform, coord_origin, coord_origin);
    220         win->dx = coord_origin;
    221         win->dy = coord_origin;
     219        transform_translate(&win->transform,
     220            coord_origin + x_offset, coord_origin + y_offset);
     221        win->dx = coord_origin + x_offset;
     222        win->dy = coord_origin + y_offset;
    222223        win->fx = 1;
    223224        win->fy = 1;
     
    744745                        fibril_mutex_lock(&window_list_mtx);
    745746
    746                         window_t *win = window_create();
     747                        window_t *win = window_create(IPC_GET_ARG1(call), IPC_GET_ARG2(call));
    747748                        if (!win) {
    748749                                async_answer_2(callid, ENOMEM, 0, 0);
     
    19211922                fibril_mutex_lock(&window_list_mtx);
    19221923
    1923                 window_t *red_win = window_create();
     1924                window_t *red_win = window_create(0, 0);
    19241925                red_win->surface = surface_create(250, 150, NULL, 0);
    19251926                pixel_t red_pix = PIXEL(255, 240, 0, 0);
     
    19311932                list_prepend(&red_win->link, &window_list);
    19321933
    1933                 window_t *blue_win = window_create();
     1934                window_t *blue_win = window_create(0, 0);
    19341935                blue_win->surface = surface_create(200, 100, NULL, 0);
    19351936                pixel_t blue_pix = PIXEL(255, 0, 0, 240);
     
    19411942                list_prepend(&blue_win->link, &window_list);
    19421943
    1943                 window_t *helenos_win = window_create();
     1944                window_t *helenos_win = window_create(0, 0);
    19441945                helenos_win->surface = decode_tga((void *) helenos_tga, helenos_tga_size, 0);
    19451946                list_prepend(&helenos_win->link, &window_list);
    19461947
    1947                 window_t *nameic_win = window_create();
     1948                window_t *nameic_win = window_create(0, 0);
    19481949                nameic_win->surface = decode_tga((void *) nameic_tga, nameic_tga_size, 0);
    19491950                list_prepend(&nameic_win->link, &window_list);
Note: See TracChangeset for help on using the changeset viewer.