Changeset e1f2079 in mainline for uspace/srv/hid/rfb/main.c


Ignore:
Timestamp:
2020-02-14T19:54:40Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b0a94854
Parents:
b252e87
Message:

Get display resolution by querying display device

File:
1 edited

Legend:

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

    rb252e87 re1f2079  
    2727 */
    2828
     29#include <ddev/info.h>
    2930#include <ddev_srv.h>
    3031#include <errno.h>
     
    4647#define NAME "rfb"
    4748
     49static errno_t rfb_ddev_get_gc(void *, sysarg_t *, sysarg_t *);
     50static errno_t rfb_ddev_get_info(void *, ddev_info_t *);
     51
    4852static errno_t rfb_gc_set_color(void *, gfx_color_t *);
    4953static errno_t rfb_gc_fill_rect(void *, gfx_rect_t *);
     
    5559
    5660static ddev_ops_t rfb_ddev_ops = {
     61        .get_gc = rfb_ddev_get_gc,
     62        .get_info = rfb_ddev_get_info
    5763};
    5864
     
    103109        rfb->damage_rect.width = new_rect.p1.x - new_rect.p0.x;
    104110        rfb->damage_rect.height = new_rect.p1.y - new_rect.p1.y;
     111}
     112
     113static errno_t rfb_ddev_get_gc(void *arg, sysarg_t *arg2, sysarg_t *arg3)
     114{
     115        *arg2 = 0;
     116        *arg3 = 42;
     117        return EOK;
     118}
     119
     120static errno_t rfb_ddev_get_info(void *arg, ddev_info_t *info)
     121{
     122        rfb_t *rfb = (rfb_t *) arg;
     123
     124        ddev_info_init(info);
     125
     126        info->rect.p0.x = 0;
     127        info->rect.p0.y = 0;
     128        info->rect.p1.x = rfb->width;
     129        info->rect.p1.y = rfb->height;
     130
     131        return EOK;
    105132}
    106133
     
    284311static void client_connection(ipc_call_t *icall, void *arg)
    285312{
     313        rfb_t *rfb = (rfb_t *) arg;
    286314        ddev_srv_t srv;
    287315        sysarg_t svc_id;
     
    295323                ddev_srv_initialize(&srv);
    296324                srv.ops = &rfb_ddev_ops;
    297                 srv.arg = arg;
     325                srv.arg = (void *) rfb;
    298326
    299327                /* Handle connection */
    300328                ddev_conn(icall, &srv);
    301329        } else {
    302                 rc = gfx_context_new(&rfb_gc_ops, arg, &gc);
     330                rc = gfx_context_new(&rfb_gc_ops, (void *) rfb, &gc);
    303331                if (rc != EOK) {
    304332                        async_answer_0(icall, ENOMEM);
Note: See TracChangeset for help on using the changeset viewer.