aboutsummaryrefslogtreecommitdiff
path: root/src/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/image.c b/src/image.c
index 6150988..23a76e0 100644
--- a/src/image.c
+++ b/src/image.c
@@ -2,6 +2,14 @@
#include "window.h"
#include <gtk-3.0/gtk/gtk.h>
+static GtkWidget *image;
+static GdkPixbuf *pixbuf;
+static GdkPixbuf *curr_pixbuf;
+static int pixbuf_width, pixbuf_height, curr_pixbuf_width, curr_pixbuf_height;
+static double aspect_ratio;
+static double curr_zoom;
+static enum scale_mode curr_scale_mod;
+
GtkWidget *new_image()
{
image = gtk_image_new();
@@ -13,6 +21,7 @@ int load_image(char *file_name)
GError *error = NULL;
if (pixbuf != NULL)
g_object_unref(pixbuf);
+ gtk_image_clear(GTK_IMAGE(image));
pixbuf = gdk_pixbuf_new_from_file(file_name, &error);
if (error)
return -1;
@@ -95,3 +104,8 @@ void zoom(int type)
update_pixbuf();
}
+
+enum scale_mode get_current_scale_mode()
+{
+ return curr_scale_mod;
+}