mirror of
https://github.com/labwc/labwc.git
synced 2025-10-31 22:25:34 -04:00
Add screen magnifier
This adds a screen magnifier which can be controlled with the `ZoomIn` / `ZoomOut` and `ToggleMagnify` actions. It scales up part of the rendered framebuffer so the magnification may end up looking blurry depending on the magnification scale. PR #1774
This commit is contained in:
parent
ad15c0474d
commit
8ba066a1a5
13 changed files with 473 additions and 1 deletions
|
|
@ -140,6 +140,13 @@ struct rcxml {
|
|||
|
||||
/* Menu */
|
||||
unsigned int menu_ignore_button_release_period;
|
||||
|
||||
/* Magnifier */
|
||||
int mag_width;
|
||||
int mag_height;
|
||||
float mag_scale;
|
||||
float mag_increment;
|
||||
bool mag_filter;
|
||||
};
|
||||
|
||||
extern struct rcxml rc;
|
||||
|
|
|
|||
23
include/magnifier.h
Normal file
23
include/magnifier.h
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
#ifndef LABWC_MAGNIFIER_H
|
||||
#define LABWC_MAGNIFIER_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <wayland-server-core.h>
|
||||
|
||||
struct server;
|
||||
struct output;
|
||||
|
||||
enum magnify_dir {
|
||||
MAGNIFY_INCREASE,
|
||||
MAGNIFY_DECREASE
|
||||
};
|
||||
|
||||
void magnify_toggle(struct server *server);
|
||||
void magnify_set_scale(struct server *server, enum magnify_dir dir);
|
||||
bool output_wants_magnification(struct output *output);
|
||||
void magnify(struct output *output, struct wlr_buffer *output_buffer,
|
||||
struct wlr_box *damage);
|
||||
bool is_magnify_on(void);
|
||||
|
||||
#endif /* LABWC_MAGNIFIER_H */
|
||||
|
|
@ -139,6 +139,10 @@ struct theme {
|
|||
|
||||
/* not set in rc.xml/themerc, but derived from font & padding_height */
|
||||
int osd_window_switcher_item_height;
|
||||
|
||||
/* magnifier */
|
||||
float mag_border_color[4];
|
||||
int mag_border_width;
|
||||
};
|
||||
|
||||
struct server;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue