Changeset 5480d5e in mainline for uspace/lib/display/src


Ignore:
Timestamp:
2020-05-19T21:51:11Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9242ad9
Parents:
4c4d6142
Message:

Add libdisplay method for setting window cursor

Location:
uspace/lib/display/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/display/src/disp_srv.c

    r4c4d6142 r5480d5e  
    266266}
    267267
     268static void display_window_set_cursor_srv(display_srv_t *srv, ipc_call_t *icall)
     269{
     270        sysarg_t wnd_id;
     271        display_stock_cursor_t cursor;
     272        errno_t rc;
     273
     274        wnd_id = ipc_get_arg1(icall);
     275        cursor = ipc_get_arg2(icall);
     276
     277        if (srv->ops->window_set_cursor == NULL) {
     278                async_answer_0(icall, ENOTSUP);
     279                return;
     280        }
     281
     282        rc = srv->ops->window_set_cursor(srv->arg, wnd_id, cursor);
     283        async_answer_0(icall, rc);
     284}
     285
    268286static void display_get_event_srv(display_srv_t *srv, ipc_call_t *icall)
    269287{
     
    386404                case DISPLAY_WINDOW_RESIZE:
    387405                        display_window_resize_srv(srv, &call);
     406                        break;
     407                case DISPLAY_WINDOW_SET_CURSOR:
     408                        display_window_set_cursor_srv(srv, &call);
    388409                        break;
    389410                case DISPLAY_GET_EVENT:
  • uspace/lib/display/src/display.c

    r4c4d6142 r5480d5e  
    416416}
    417417
     418/** Set window cursor.
     419 *
     420 * Set cursor that is displayed when pointer is over the window. The default
     421 * is the arrow pointer.
     422 *
     423 * @param window Window
     424 * @param cursor Cursor to display
     425 * @return EOK on success or an error code
     426 */
     427errno_t display_window_set_cursor(display_window_t *window,
     428    display_stock_cursor_t cursor)
     429{
     430        async_exch_t *exch;
     431        errno_t rc;
     432
     433        exch = async_exchange_begin(window->display->sess);
     434        rc = async_req_2_0(exch, DISPLAY_WINDOW_SET_CURSOR, window->id,
     435            cursor);
     436        async_exchange_end(exch);
     437        return rc;
     438}
     439
    418440/** Get display event.
    419441 *
Note: See TracChangeset for help on using the changeset viewer.