Changeset be15256 in mainline for uspace/srv/hid/display/client.c


Ignore:
Timestamp:
2019-11-05T08:00:18Z (4 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b2d1df3
Parents:
b3c185b6
git-author:
Jiri Svoboda <jiri@…> (2019-10-04 19:00:15)
git-committer:
Jiri Svoboda <jiri@…> (2019-11-05 08:00:18)
Message:

ds_client should not have reverse dependency on libdisplay's display_srv

Breaks layering and hampers testability

File:
1 edited

Legend:

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

    rb3c185b6 rbe15256  
    3434 */
    3535
    36 #include <disp_srv.h>
    3736#include <errno.h>
    3837#include <stdlib.h>
     
    4443 *
    4544 * @param display Parent display
     45 * @param cb Client callbacks
     46 * @param cb_arg Callback argument
    4647 * @param rclient Place to store pointer to new client.
    4748 * @return EOK on success, ENOMEM if out of memory
    4849 */
    49 errno_t ds_client_create(ds_display_t *display, display_srv_t *srv,
    50     ds_client_t **rclient)
     50errno_t ds_client_create(ds_display_t *display, ds_client_cb_t *cb,
     51    void *cb_arg, ds_client_t **rclient)
    5152{
    5253        ds_client_t *client;
     
    5859        list_initialize(&client->windows);
    5960        prodcons_initialize(&client->events);
    60         client->srv = srv;
     61        client->cb = cb;
     62        client->cb_arg = cb_arg;
    6163
    6264        ds_display_add_client(display, client);
     
    195197        /* Notify the client */
    196198        // TODO Do not send more than once until client drains the queue
    197         display_srv_ev_pending(client->srv);
     199        client->cb->ev_pending(client->cb_arg);
    198200
    199201        return EOK;
Note: See TracChangeset for help on using the changeset viewer.