Changeset b3c185b6 in mainline for uspace/srv/hid/display/main.c


Ignore:
Timestamp:
2019-11-04T14:05:35Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
be15256
Parents:
22faaf2
git-author:
Jiri Svoboda <jiri@…> (2019-10-03 18:05:09)
git-committer:
Jiri Svoboda <jiri@…> (2019-11-04 14:05:35)
Message:

Window event delivery mechanism

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/display/main.c

    r22faaf2 rb3c185b6  
    4545#include <stdio.h>
    4646#include <task.h>
     47#include "client.h"
    4748#include "display.h"
     49#include "main.h"
    4850#include "output.h"
    4951#include "window.h"
    5052
    51 #define NAME  "display"
     53static void display_client_conn(ipc_call_t *, void *);
    5254
    53 static void display_client_conn(ipc_call_t *, void *);
     55static void display_kbd_event(void *arg, kbd_event_t *event)
     56{
     57        ds_display_t *disp = (ds_display_t *) arg;
     58
     59        printf("display_kbd_event\n");
     60        ds_display_post_kbd_event(disp, event);
     61}
    5462
    5563/** Initialize display server */
     
    6068        errno_t rc;
    6169
    62         rc = output_init(&gc);
     70        log_msg(LOG_DEFAULT, LVL_DEBUG, "display_srv_init()");
     71
     72        rc = ds_display_create(NULL, &disp);
    6373        if (rc != EOK)
    6474                goto error;
    6575
    66         rc = ds_display_create(gc, &disp);
     76        rc = output_init(display_kbd_event, (void *) disp, &gc);
    6777        if (rc != EOK)
    6878                goto error;
    6979
    70         log_msg(LOG_DEFAULT, LVL_DEBUG, "display_srv_init()");
    71 
     80        disp->gc = gc;
     81#if 0
     82        rc = ds_input_open(disp);
     83        if (rc != EOK)
     84                goto error;
     85#endif
    7286        async_set_fallback_port_handler(display_client_conn, disp);
    7387
     
    88102        return EOK;
    89103error:
     104#if 0
     105        if (disp->input != NULL)
     106                ds_input_close(disp);
     107#endif
    90108        if (gc != NULL)
    91109                gfx_context_delete(gc);
     
    101119        sysarg_t wnd_id;
    102120        sysarg_t svc_id;
     121        ds_client_t *client = NULL;
    103122        ds_window_t *wnd;
    104123        ds_display_t *disp = (ds_display_t *) arg;
    105124        gfx_context_t *gc;
     125        errno_t rc;
    106126
    107127        log_msg(LOG_DEFAULT, LVL_NOTE, "display_client_conn arg1=%zu arg2=%zu arg3=%zu arg4=%zu.",
     
    116136
    117137        if (svc_id != 0) {
    118                 /* Display management */
     138                /* Create client object */
     139                rc = ds_client_create(disp, &srv, &client);
     140                if (rc != EOK) {
     141                        async_answer_0(icall, ENOMEM);
     142                        return;
     143                }
     144
     145                /* Set up protocol structure */
    119146                srv.ops = &display_srv_ops;
    120                 srv.arg = disp;
     147                srv.arg = client;
    121148
     149                /* Handle connection */
    122150                display_conn(icall, &srv);
     151
     152                ds_client_destroy(client);
    123153        } else {
    124                 /* Window GC */
     154                /* Window GC connection */
     155
    125156                wnd = ds_display_find_window(disp, wnd_id);
    126157                if (wnd == NULL) {
     
    132163                gc_conn(icall, gc);
    133164        }
     165
    134166}
    135167
Note: See TracChangeset for help on using the changeset viewer.