#include <config.h>
#include <glib/gstdio.h>
#include <unistd.h>
#include "ev-document-misc.h"
#include "ev-file-helpers.h"
#include "ev-image.h"
Go to the source code of this file.
Definition at line 65 of file ev-image.c.
67 GObjectClass *g_object_class;
69 g_object_class = G_OBJECT_CLASS (klass);
71 g_type_class_add_private (g_object_class,
sizeof (
EvImagePrivate));
static void ev_image_finalize |
( |
GObject * |
object) | |
|
|
static |
Definition at line 42 of file ev-image.c.
46 if (image->priv->pixbuf) {
47 g_object_unref (image->priv->pixbuf);
48 image->priv->pixbuf = NULL;
51 if (image->priv->tmp_uri) {
54 filename = g_filename_from_uri (image->priv->tmp_uri, NULL, NULL);
57 g_free (image->priv->tmp_uri);
58 image->priv->tmp_uri = NULL;
61 (* G_OBJECT_CLASS (ev_image_parent_class)->finalize) (
object);
gint ev_image_get_id |
( |
EvImage * |
image) | |
|
Definition at line 117 of file ev-image.c.
121 return image->priv->id;
gint ev_image_get_page |
( |
EvImage * |
image) | |
|
Definition at line 109 of file ev-image.c.
113 return image->priv->page;
GdkPixbuf* ev_image_get_pixbuf |
( |
EvImage * |
image) | |
|
ev_image_get_pixbuf: an EvImage
Returns: (transfer none): a #GdkPixbuf
Definition at line 131 of file ev-image.c.
134 g_return_val_if_fail (GDK_IS_PIXBUF (image->priv->pixbuf), NULL);
136 return image->priv->pixbuf;
const gchar* ev_image_get_tmp_uri |
( |
EvImage * |
image) | |
|
Definition at line 182 of file ev-image.c.
186 return image->priv->tmp_uri;
static void ev_image_init |
( |
EvImage * |
image) | |
|
|
static |
EvImage* ev_image_new |
( |
gint |
page, |
|
|
gint |
img_id |
|
) |
| |
Definition at line 83 of file ev-image.c.
89 image->priv->page = page;
90 image->priv->id = img_id;
EvImage* ev_image_new_from_pixbuf |
( |
GdkPixbuf * |
pixbuf) | |
|
Definition at line 96 of file ev-image.c.
100 g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
103 image->priv->pixbuf = g_object_ref (pixbuf);
const gchar* ev_image_save_tmp |
( |
EvImage * |
image, |
|
|
GdkPixbuf * |
pixbuf |
|
) |
| |
Definition at line 140 of file ev-image.c.
143 GError *error = NULL;
144 gchar *filename = NULL;
148 g_return_val_if_fail (GDK_IS_PIXBUF (pixbuf), NULL);
150 if (image->priv->tmp_uri)
151 return image->priv->tmp_uri;
153 if ((fd =
ev_mkstemp (
"image.XXXXXX.png", &filename, &error)) == -1)
156 gdk_pixbuf_save (pixbuf, filename,
158 "compression",
"3", NULL);
162 image->priv->tmp_uri = g_filename_to_uri (filename, NULL, &error);
163 if (image->priv->tmp_uri == NULL)
168 return image->priv->tmp_uri;
174 g_warning (
"Error saving image: %s", error->message);
175 g_error_free (error);