Changeset 38e5f36c in mainline


Ignore:
Timestamp:
2019-11-28T14:23:51Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf32dbd
Parents:
670cfcf
git-author:
Jiri Svoboda <jiri@…> (2019-11-27 18:23:41)
git-committer:
Jiri Svoboda <jiri@…> (2019-11-28 14:23:51)
Message:

Move implementation of display ops to a separate module

Location:
uspace/srv/hid/display
Files:
2 added
4 edited

Legend:

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

    r670cfcf r38e5f36c  
    3131 */
    3232/**
    33  * @file Display management
     33 * @file Display server display
    3434 */
    3535
    36 #include <disp_srv.h>
    3736#include <errno.h>
    3837#include <gfx/context.h>
     
    4241#include "window.h"
    4342#include "display.h"
    44 
    45 static errno_t disp_window_create(void *, sysarg_t *);
    46 static errno_t disp_window_destroy(void *, sysarg_t);
    47 static errno_t disp_get_event(void *, sysarg_t *, display_wnd_ev_t *);
    48 
    49 display_ops_t display_srv_ops = {
    50         .window_create = disp_window_create,
    51         .window_destroy = disp_window_destroy,
    52         .get_event = disp_get_event
    53 };
    54 
    55 static errno_t disp_window_create(void *arg, sysarg_t *rwnd_id)
    56 {
    57         errno_t rc;
    58         ds_client_t *client = (ds_client_t *) arg;
    59         ds_window_t *wnd;
    60 
    61         log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create()");
    62 
    63         rc = ds_window_create(client, &wnd);
    64         log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create() - ds_window_create -> %d", rc);
    65         if (rc != EOK)
    66                 return rc;
    67 
    68         log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_create() -> EOK, id=%zu",
    69             wnd->id);
    70 
    71         wnd->dpos.x = ((wnd->id - 1) & 1) * 400;
    72         wnd->dpos.y = ((wnd->id - 1) & 2) / 2 * 300;
    73 
    74         *rwnd_id = wnd->id;
    75         return EOK;
    76 }
    77 
    78 static errno_t disp_window_destroy(void *arg, sysarg_t wnd_id)
    79 {
    80         ds_client_t *client = (ds_client_t *) arg;
    81         ds_window_t *wnd;
    82 
    83         wnd = ds_client_find_window(client, wnd_id);
    84         if (wnd == NULL)
    85                 return ENOENT;
    86 
    87         log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_destroy()");
    88         ds_client_remove_window(wnd);
    89         ds_window_destroy(wnd);
    90         return EOK;
    91 }
    92 
    93 static errno_t disp_get_event(void *arg, sysarg_t *wnd_id,
    94     display_wnd_ev_t *event)
    95 {
    96         ds_client_t *client = (ds_client_t *) arg;
    97         ds_window_t *wnd;
    98         errno_t rc;
    99 
    100         log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_window_get_event()");
    101 
    102         rc = ds_client_get_event(client, &wnd, event);
    103         if (rc != EOK)
    104                 return rc;
    105 
    106         *wnd_id = wnd->id;
    107         return EOK;
    108 }
    10943
    11044/** Create display.
  • uspace/srv/hid/display/display.h

    r670cfcf r38e5f36c  
    3131 */
    3232/**
    33  * @file
    34  * @brief
     33 * @file Display server display
    3534 */
    3635
     
    3837#define DISPLAY_H
    3938
    40 #include <disp_srv.h>
    4139#include <errno.h>
    4240#include <gfx/context.h>
     
    4442#include "types/display/client.h"
    4543#include "types/display/display.h"
    46 
    47 extern display_ops_t display_srv_ops;
    4844
    4945extern errno_t ds_display_create(gfx_context_t *, ds_display_t **);
  • uspace/srv/hid/display/main.c

    r670cfcf r38e5f36c  
    4747#include "client.h"
    4848#include "display.h"
     49#include "dsops.h"
    4950#include "main.h"
    5051#include "output.h"
  • uspace/srv/hid/display/meson.build

    r670cfcf r38e5f36c  
    3232        'client.c',
    3333        'display.c',
     34        'dsops.c',
    3435        'main.c',
    3536        'output.c',
Note: See TracChangeset for help on using the changeset viewer.