Changeset aeb3037 in mainline for uspace/srv


Ignore:
Timestamp:
2020-03-18T17:27:18Z (5 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0680854
Parents:
1a1271d
git-author:
Jiri Svoboda <jiri@…> (2020-03-18 16:57:15)
git-committer:
Jiri Svoboda <jiri@…> (2020-03-18 17:27:18)
Message:

Allow getting display dimensions

Can be used to position special windows such as panels, or to help
emulate libgui's window placement policy. To support multi-monitor
setups we would rather need to be able to query individual monitors.
But let's keep things simple for now.

Location:
uspace/srv/hid/display
Files:
3 edited

Legend:

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

    r1a1271d raeb3037  
    8484        gfx_color_delete(disp->bg_color);
    8585        free(disp);
     86}
     87
     88/** Get display information.
     89 *
     90 * @param disp Display
     91 */
     92void ds_display_get_info(ds_display_t *disp, display_info_t *info)
     93{
     94        info->rect = disp->rect;
    8695}
    8796
  • uspace/srv/hid/display/display.h

    r1a1271d raeb3037  
    3737#define DISPLAY_H
    3838
     39#include <display/info.h>
    3940#include <errno.h>
    4041#include <gfx/context.h>
     
    4950extern errno_t ds_display_create(gfx_context_t *, ds_display_t **);
    5051extern void ds_display_destroy(ds_display_t *);
     52extern void ds_display_get_info(ds_display_t *, display_info_t *);
    5153extern void ds_display_add_client(ds_display_t *, ds_client_t *);
    5254extern void ds_display_remove_client(ds_client_t *);
  • uspace/srv/hid/display/dsops.c

    r1a1271d raeb3037  
    5252    gfx_rect_t *);
    5353static errno_t disp_get_event(void *, sysarg_t *, display_wnd_ev_t *);
     54static errno_t disp_get_info(void *, display_info_t *);
    5455
    5556display_ops_t display_srv_ops = {
     
    5960        .window_resize_req = disp_window_resize_req,
    6061        .window_resize = disp_window_resize,
    61         .get_event = disp_get_event
     62        .get_event = disp_get_event,
     63        .get_info = disp_get_info
    6264};
    6365
     
    168170}
    169171
     172static errno_t disp_get_info(void *arg, display_info_t *info)
     173{
     174        ds_client_t *client = (ds_client_t *) arg;
     175
     176        log_msg(LOG_DEFAULT, LVL_DEBUG, "disp_get_info()");
     177
     178        ds_display_get_info(client->display, info);
     179        return EOK;
     180}
     181
    170182/** @}
    171183 */
Note: See TracChangeset for help on using the changeset viewer.