magnifier: rename some functions

This commit is contained in:
tokyo4j 2025-02-22 15:21:32 +09:00
parent cfbe54e67a
commit b66c0d8797
5 changed files with 16 additions and 16 deletions

View file

@ -14,12 +14,12 @@ enum magnify_dir {
MAGNIFY_DECREASE MAGNIFY_DECREASE
}; };
void magnify_toggle(struct server *server); void magnifier_toggle(struct server *server);
void magnify_set_scale(struct server *server, enum magnify_dir dir); void magnifier_set_scale(struct server *server, enum magnify_dir dir);
bool output_wants_magnification(struct output *output); 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); struct wlr_box *damage);
bool is_magnify_on(void); bool magnifier_is_enabled(void);
void magnify_reset(void); void magnifier_reset(void);
#endif /* LABWC_MAGNIFIER_H */ #endif /* LABWC_MAGNIFIER_H */

View file

@ -1319,13 +1319,13 @@ actions_run(struct view *activator, struct server *server,
rc.tablet.force_mouse_emulation = !rc.tablet.force_mouse_emulation; rc.tablet.force_mouse_emulation = !rc.tablet.force_mouse_emulation;
break; break;
case ACTION_TYPE_TOGGLE_MAGNIFY: case ACTION_TYPE_TOGGLE_MAGNIFY:
magnify_toggle(server); magnifier_toggle(server);
break; break;
case ACTION_TYPE_ZOOM_IN: case ACTION_TYPE_ZOOM_IN:
magnify_set_scale(server, MAGNIFY_INCREASE); magnifier_set_scale(server, MAGNIFY_INCREASE);
break; break;
case ACTION_TYPE_ZOOM_OUT: case ACTION_TYPE_ZOOM_OUT:
magnify_set_scale(server, MAGNIFY_DECREASE); magnifier_set_scale(server, MAGNIFY_DECREASE);
break; break;
case ACTION_TYPE_WARP_CURSOR: case ACTION_TYPE_WARP_CURSOR:
{ {

View file

@ -114,8 +114,8 @@ lab_wlr_scene_output_commit(struct wlr_scene_output *scene_output,
} }
struct wlr_box additional_damage = {0}; struct wlr_box additional_damage = {0};
if (state->buffer && is_magnify_on()) { if (state->buffer && magnifier_is_enabled()) {
magnify(output, state->buffer, &additional_damage); magnifier_draw(output, state->buffer, &additional_damage);
} }
bool committed = wlr_output_commit_state(wlr_output, state); bool committed = wlr_output_commit_state(wlr_output, state);

View file

@ -17,7 +17,7 @@ static struct wlr_texture *tmp_texture = NULL;
#define CLAMP(in, lower, upper) MAX(MIN((in), (upper)), (lower)) #define CLAMP(in, lower, upper) MAX(MIN((in), (upper)), (lower))
void 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; int width, height;
double x, y; double x, y;
@ -258,7 +258,7 @@ enable_magnifier(struct server *server, bool enable)
/* Toggles magnification on and off */ /* Toggles magnification on and off */
void void
magnify_toggle(struct server *server) magnifier_toggle(struct server *server)
{ {
enable_magnifier(server, !magnify_on); enable_magnifier(server, !magnify_on);
@ -270,7 +270,7 @@ magnify_toggle(struct server *server)
/* Increases and decreases magnification scale */ /* Increases and decreases magnification scale */
void 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); 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 */ /* Reset any buffers held by the magnifier */
void void
magnify_reset(void) magnifier_reset(void)
{ {
if (tmp_texture && tmp_buffer) { if (tmp_texture && tmp_buffer) {
wlr_texture_destroy(tmp_texture); wlr_texture_destroy(tmp_texture);
@ -308,7 +308,7 @@ magnify_reset(void)
/* Report whether magnification is enabled */ /* Report whether magnification is enabled */
bool bool
is_magnify_on(void) magnifier_is_enabled(void)
{ {
return magnify_on; return magnify_on;
} }

View file

@ -413,7 +413,7 @@ handle_renderer_lost(struct wl_listener *listener, void *data)
reload_config_and_theme(server); reload_config_and_theme(server);
magnify_reset(); magnifier_reset();
wlr_allocator_destroy(old_allocator); wlr_allocator_destroy(old_allocator);
wlr_renderer_destroy(old_renderer); wlr_renderer_destroy(old_renderer);