Changeset fa98b26a in mainline


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.

Location:
uspace
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/vdemo/vdemo.c

    r290a0f0 rfa98b26a  
    110110{
    111111        if (argc >= 2) {
    112                 window_t *main_window = window_open(argv[1], true, true, "vdemo");
     112                window_t *main_window = window_open(argv[1], true, true, "vdemo", 0, 0);
    113113                if (!main_window) {
    114114                        printf("Cannot open main window.\n");
  • uspace/app/vlaunch/vlaunch.c

    r290a0f0 rfa98b26a  
    9898       
    9999        winreg = argv[1];
    100         window_t *main_window = window_open(argv[1], true, true, "vlaunch");
     100        window_t *main_window = window_open(argv[1], true, true, "vlaunch", 0, 0);
    101101        if (!main_window) {
    102102                printf("Cannot open main window.\n");
  • uspace/app/vterm/vterm.c

    r290a0f0 rfa98b26a  
    4949        }
    5050       
    51         window_t *main_window = window_open(argv[1], true, true, "vterm");
     51        window_t *main_window = window_open(argv[1], true, true, "vterm", 0, 0);
    5252        if (!main_window) {
    5353                printf("%s: Cannot open main window.\n", NAME);
  • uspace/lib/c/generic/io/window.c

    r290a0f0 rfa98b26a  
    4040#include <stdio.h>
    4141
    42 int win_register(async_sess_t *sess, service_id_t *in, service_id_t *out)
     42int win_register(async_sess_t *sess, service_id_t *in, service_id_t *out,
     43    sysarg_t x_offset, sysarg_t y_offset)
    4344{
    4445        async_exch_t *exch = async_exchange_begin(sess);
    45         int ret = async_req_0_2(exch, WINDOW_REGISTER, in, out);
     46        int ret = async_req_2_2(exch, WINDOW_REGISTER, x_offset, y_offset, in, out);
    4647        async_exchange_end(exch);
    4748
  • uspace/lib/c/include/io/window.h

    r290a0f0 rfa98b26a  
    102102} window_grab_flags_t;
    103103
    104 extern int win_register(async_sess_t *, service_id_t *, service_id_t *);
     104extern int win_register(async_sess_t *, service_id_t *, service_id_t *, sysarg_t, sysarg_t);
    105105
    106106extern int win_get_event(async_sess_t *, window_event_t *);
  • uspace/lib/gui/window.c

    r290a0f0 rfa98b26a  
    534534}
    535535
    536 window_t *window_open(char *winreg, bool is_main, bool is_decorated, const char *caption)
     536window_t *window_open(char *winreg, bool is_main, bool is_decorated,
     537    const char *caption, sysarg_t x_offset, sysarg_t y_offset)
    537538{
    538539        int rc;
     
    578579        service_id_t out_dsid;
    579580       
    580         rc = win_register(reg_sess, &in_dsid, &out_dsid);
     581        rc = win_register(reg_sess, &in_dsid, &out_dsid, x_offset, y_offset);
    581582        async_hangup(reg_sess);
    582583        if (rc != EOK) {
  • uspace/lib/gui/window.h

    r290a0f0 rfa98b26a  
    6666 * If the window is declared as main, its closure causes termination of the
    6767 * whole application. Note that opened window does not have any surface yet. */
    68 extern window_t *window_open(char *, bool, bool, const char *);
     68extern window_t *window_open(char *, bool, bool, const char *, sysarg_t, sysarg_t);
    6969
    7070/**
  • 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.