mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-10 01:17:44 +03:00
terminal: provide display dimensions to API users
Allow users to query the display dimensions of a grdev_display. This is required to properly resize the objects to be rendered.
This commit is contained in:
parent
a908d21355
commit
158c1e3e0c
@ -301,6 +301,18 @@ const char *grdev_display_get_name(grdev_display *display) {
|
||||
return display->name;
|
||||
}
|
||||
|
||||
uint32_t grdev_display_get_width(grdev_display *display) {
|
||||
assert_return(display, 0);
|
||||
|
||||
return display->width;
|
||||
}
|
||||
|
||||
uint32_t grdev_display_get_height(grdev_display *display) {
|
||||
assert_return(display, 0);
|
||||
|
||||
return display->height;
|
||||
}
|
||||
|
||||
bool grdev_display_is_enabled(grdev_display *display) {
|
||||
return display && display->enabled;
|
||||
}
|
||||
@ -572,6 +584,8 @@ static bool display_cache(grdev_display *display) {
|
||||
}
|
||||
|
||||
display_cache_targets(display);
|
||||
display->width = display->tile->cache_w;
|
||||
display->height = display->tile->cache_h;
|
||||
|
||||
r = 0;
|
||||
|
||||
|
@ -112,6 +112,8 @@ void grdev_display_set_userdata(grdev_display *display, void *userdata);
|
||||
void *grdev_display_get_userdata(grdev_display *display);
|
||||
|
||||
const char *grdev_display_get_name(grdev_display *display);
|
||||
uint32_t grdev_display_get_width(grdev_display *display);
|
||||
uint32_t grdev_display_get_height(grdev_display *display);
|
||||
|
||||
bool grdev_display_is_enabled(grdev_display *display);
|
||||
void grdev_display_enable(grdev_display *display);
|
||||
|
Loading…
Reference in New Issue
Block a user