mirror of
https://github.com/labwc/labwc.git
synced 2025-10-29 05:40:24 -04:00
magnifier: rename some functions
This commit is contained in:
parent
cfbe54e67a
commit
b66c0d8797
5 changed files with 16 additions and 16 deletions
|
|
@ -14,12 +14,12 @@ enum magnify_dir {
|
|||
MAGNIFY_DECREASE
|
||||
};
|
||||
|
||||
void magnify_toggle(struct server *server);
|
||||
void magnify_set_scale(struct server *server, enum magnify_dir dir);
|
||||
void magnifier_toggle(struct server *server);
|
||||
void magnifier_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,
|
||||
void magnifier_draw(struct output *output, struct wlr_buffer *output_buffer,
|
||||
struct wlr_box *damage);
|
||||
bool is_magnify_on(void);
|
||||
void magnify_reset(void);
|
||||
bool magnifier_is_enabled(void);
|
||||
void magnifier_reset(void);
|
||||
|
||||
#endif /* LABWC_MAGNIFIER_H */
|
||||
|
|
|
|||
|
|
@ -1319,13 +1319,13 @@ actions_run(struct view *activator, struct server *server,
|
|||
rc.tablet.force_mouse_emulation = !rc.tablet.force_mouse_emulation;
|
||||
break;
|
||||
case ACTION_TYPE_TOGGLE_MAGNIFY:
|
||||
magnify_toggle(server);
|
||||
magnifier_toggle(server);
|
||||
break;
|
||||
case ACTION_TYPE_ZOOM_IN:
|
||||
magnify_set_scale(server, MAGNIFY_INCREASE);
|
||||
magnifier_set_scale(server, MAGNIFY_INCREASE);
|
||||
break;
|
||||
case ACTION_TYPE_ZOOM_OUT:
|
||||
magnify_set_scale(server, MAGNIFY_DECREASE);
|
||||
magnifier_set_scale(server, MAGNIFY_DECREASE);
|
||||
break;
|
||||
case ACTION_TYPE_WARP_CURSOR:
|
||||
{
|
||||
|
|
|
|||
|
|
@ -114,8 +114,8 @@ lab_wlr_scene_output_commit(struct wlr_scene_output *scene_output,
|
|||
}
|
||||
|
||||
struct wlr_box additional_damage = {0};
|
||||
if (state->buffer && is_magnify_on()) {
|
||||
magnify(output, state->buffer, &additional_damage);
|
||||
if (state->buffer && magnifier_is_enabled()) {
|
||||
magnifier_draw(output, state->buffer, &additional_damage);
|
||||
}
|
||||
|
||||
bool committed = wlr_output_commit_state(wlr_output, state);
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ static struct wlr_texture *tmp_texture = NULL;
|
|||
#define CLAMP(in, lower, upper) MAX(MIN((in), (upper)), (lower))
|
||||
|
||||
void
|
||||
magnify(struct output *output, struct wlr_buffer *output_buffer, struct wlr_box *damage)
|
||||
magnifier_draw(struct output *output, struct wlr_buffer *output_buffer, struct wlr_box *damage)
|
||||
{
|
||||
int width, height;
|
||||
double x, y;
|
||||
|
|
@ -258,7 +258,7 @@ enable_magnifier(struct server *server, bool enable)
|
|||
|
||||
/* Toggles magnification on and off */
|
||||
void
|
||||
magnify_toggle(struct server *server)
|
||||
magnifier_toggle(struct server *server)
|
||||
{
|
||||
enable_magnifier(server, !magnify_on);
|
||||
|
||||
|
|
@ -270,7 +270,7 @@ magnify_toggle(struct server *server)
|
|||
|
||||
/* Increases and decreases magnification scale */
|
||||
void
|
||||
magnify_set_scale(struct server *server, enum magnify_dir dir)
|
||||
magnifier_set_scale(struct server *server, enum magnify_dir dir)
|
||||
{
|
||||
struct output *output = output_nearest_to_cursor(server);
|
||||
|
||||
|
|
@ -296,7 +296,7 @@ magnify_set_scale(struct server *server, enum magnify_dir dir)
|
|||
|
||||
/* Reset any buffers held by the magnifier */
|
||||
void
|
||||
magnify_reset(void)
|
||||
magnifier_reset(void)
|
||||
{
|
||||
if (tmp_texture && tmp_buffer) {
|
||||
wlr_texture_destroy(tmp_texture);
|
||||
|
|
@ -308,7 +308,7 @@ magnify_reset(void)
|
|||
|
||||
/* Report whether magnification is enabled */
|
||||
bool
|
||||
is_magnify_on(void)
|
||||
magnifier_is_enabled(void)
|
||||
{
|
||||
return magnify_on;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -413,7 +413,7 @@ handle_renderer_lost(struct wl_listener *listener, void *data)
|
|||
|
||||
reload_config_and_theme(server);
|
||||
|
||||
magnify_reset();
|
||||
magnifier_reset();
|
||||
|
||||
wlr_allocator_destroy(old_allocator);
|
||||
wlr_renderer_destroy(old_renderer);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue