diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c index def5a0b..6a7f855 100644 --- a/src/virt-viewer-window.c +++ b/src/virt-viewer-window.c @@ -451,10 +451,11 @@ virt_viewer_window_menu_machine_pause(GtkWidget *menu G_GNUC_UNUSED, virt_viewer_session_vm_action(virt_viewer_app_get_session(self->app), action); } -G_MODULE_EXPORT void -virt_viewer_window_menu_view_zoom_out(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) +void +virt_viewer_window_zoom_out(VirtViewerWindow *self) { + g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); + if (VIRT_VIEWER_IS_DISPLAY_VTE(self->display)) { virt_viewer_display_vte_zoom_out(VIRT_VIEWER_DISPLAY_VTE(self->display)); } else { @@ -463,10 +464,11 @@ virt_viewer_window_menu_view_zoom_out(GtkWidget *menu G_GNUC_UNUSED, } } -G_MODULE_EXPORT void -virt_viewer_window_menu_view_zoom_in(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) +void +virt_viewer_window_zoom_in(VirtViewerWindow *self) { + g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); + if (VIRT_VIEWER_IS_DISPLAY_VTE(self->display)) { virt_viewer_display_vte_zoom_in(VIRT_VIEWER_DISPLAY_VTE(self->display)); } else { @@ -475,10 +477,11 @@ virt_viewer_window_menu_view_zoom_in(GtkWidget *menu G_GNUC_UNUSED, } } -G_MODULE_EXPORT void -virt_viewer_window_menu_view_zoom_reset(GtkWidget *menu G_GNUC_UNUSED, - VirtViewerWindow *self) +void +virt_viewer_window_zoom_reset(VirtViewerWindow *self) { + g_return_if_fail(VIRT_VIEWER_IS_WINDOW(self)); + if (VIRT_VIEWER_IS_DISPLAY_VTE(self->display)) { virt_viewer_display_vte_zoom_reset(VIRT_VIEWER_DISPLAY_VTE(self->display)); } else { @@ -486,6 +489,27 @@ virt_viewer_window_menu_view_zoom_reset(GtkWidget *menu G_GNUC_UNUSED, } } +G_MODULE_EXPORT void +virt_viewer_window_menu_view_zoom_out(GtkWidget *menu G_GNUC_UNUSED, + VirtViewerWindow *self) +{ + virt_viewer_window_zoom_out(self); +} + +G_MODULE_EXPORT void +virt_viewer_window_menu_view_zoom_in(GtkWidget *menu G_GNUC_UNUSED, + VirtViewerWindow *self) +{ + virt_viewer_window_zoom_in(self); +} + +G_MODULE_EXPORT void +virt_viewer_window_menu_view_zoom_reset(GtkWidget *menu G_GNUC_UNUSED, + VirtViewerWindow *self) +{ + virt_viewer_window_zoom_reset(self); +} + /* Kick GtkWindow to tell it to adjust to our new widget sizes */ static void virt_viewer_window_queue_resize(VirtViewerWindow *self) @@ -786,7 +810,7 @@ action_zoom_in(G_GNUC_UNUSED GSimpleAction *action, G_GNUC_UNUSED GVariant *state, gpointer user_data) { - virt_viewer_window_menu_view_zoom_in(NULL, VIRT_VIEWER_WINDOW(user_data)); + virt_viewer_window_zoom_in(VIRT_VIEWER_WINDOW(user_data)); } static void @@ -794,7 +818,7 @@ action_zoom_out(G_GNUC_UNUSED GSimpleAction *action, G_GNUC_UNUSED GVariant *state, gpointer user_data) { - virt_viewer_window_menu_view_zoom_out(NULL, VIRT_VIEWER_WINDOW(user_data)); + virt_viewer_window_zoom_out(VIRT_VIEWER_WINDOW(user_data)); } static void @@ -802,7 +826,7 @@ action_zoom_reset(G_GNUC_UNUSED GSimpleAction *action, G_GNUC_UNUSED GVariant *state, gpointer user_data) { - virt_viewer_window_menu_view_zoom_reset(NULL, VIRT_VIEWER_WINDOW(user_data)); + virt_viewer_window_zoom_reset(VIRT_VIEWER_WINDOW(user_data)); } /* Keep keypad_action_entries and keypad_action_accels in sync */ diff --git a/src/virt-viewer-window.h b/src/virt-viewer-window.h index 0244f66..f4d1bd7 100644 --- a/src/virt-viewer-window.h +++ b/src/virt-viewer-window.h @@ -54,6 +54,9 @@ void virt_viewer_window_update_title(VirtViewerWindow *self); void virt_viewer_window_show(VirtViewerWindow *self); void virt_viewer_window_hide(VirtViewerWindow *self); void virt_viewer_window_set_zoom_level(VirtViewerWindow *self, gint zoom_level); +void virt_viewer_window_zoom_out(VirtViewerWindow *self); +void virt_viewer_window_zoom_in(VirtViewerWindow *self); +void virt_viewer_window_zoom_reset(VirtViewerWindow *self); gint virt_viewer_window_get_zoom_level(VirtViewerWindow *self); void virt_viewer_window_leave_fullscreen(VirtViewerWindow *self); void virt_viewer_window_enter_fullscreen(VirtViewerWindow *self, gint monitor);