]> git.mdlowis.com Git - proto/labwc.git/commitdiff
magnifier: rename some functions
authortokyo4j <hrak1529@gmail.com>
Sat, 22 Feb 2025 06:21:32 +0000 (15:21 +0900)
committertokyo4j <hrak1529@gmail.com>
Sun, 23 Feb 2025 05:17:31 +0000 (14:17 +0900)
include/magnifier.h
src/action.c
src/common/scene-helpers.c
src/magnifier.c
src/server.c

index daa6d7a38a37c2e52809a9b769f1fdd89374498d..afe79e22bc3752eabc1289e83d3e2d4a1ded1855 100644 (file)
@@ -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 */
index 3b03558c7367c02b7f94204d45bea6cd81094d01..a9fa40b7ddcef761027a68207d49d53c9aaf7eb2 100644 (file)
@@ -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:
                        {
index cc9e4db657da6c51d47f26b8427444b80a2dc53a..a8558ab1e26430662619463e5c226bebe59d6371 100644 (file)
@@ -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);
index fded35fded21b9019404fc98c459074f9427fd81..d9f316c183a6d1c911c0e27b799f24133c338fbd 100644 (file)
@@ -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;
 }
index 03fd5cd0541eb2469633fdc69cf0cb61a62f57ef..2c546309fcf77501ccaf02b8905df97c03f796b6 100644 (file)
@@ -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);