[eog] Remove unneeded code
- From: Claudio Saavedra <csaavedra src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [eog] Remove unneeded code
- Date: Wed, 8 Sep 2010 16:43:26 +0000 (UTC)
commit bb9d00011e07e9ad68b5e4968a2c1e68596c5684
Author: Claudio Saavedra <csaavedra igalia com>
Date: Tue Aug 17 18:27:52 2010 +0300
Remove unneeded code
Actually, #ifdef it out and comment it. It's nice code anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=626795
src/eog-scroll-view.c | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 51da12d..4b634fb 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -49,12 +49,14 @@ typedef enum {
ZOOM_MODE_FREE /* The image remains at its current zoom factor even if the scrollview changes size */
} ZoomMode;
+#if 0
/* Progressive loading state */
typedef enum {
PROGRESSIVE_NONE, /* We are not loading an image or it is already loaded */
PROGRESSIVE_LOADING, /* An image is being loaded */
PROGRESSIVE_POLISHING /* We have finished loading an image but have not scaled it with interpolation */
} ProgressiveState;
+#endif
/* Signal IDs */
enum {
@@ -143,8 +145,10 @@ struct _EogScrollViewPrivate {
int drag_ofs_x, drag_ofs_y;
guint dragging : 1;
+#if 0
/* status of progressive loading */
ProgressiveState progressive_state;
+#endif
/* how to indicate transparency in images */
EogTransparencyStyle transp_style;
@@ -162,7 +166,7 @@ struct _EogScrollViewPrivate {
static void scroll_by (EogScrollView *view, int xofs, int yofs);
static void set_zoom_fit (EogScrollView *view);
-static void request_paint_area (EogScrollView *view, GdkRectangle *area);
+/* static void request_paint_area (EogScrollView *view, GdkRectangle *area); */
static void set_minimum_zoom_factor (EogScrollView *view);
static void view_on_drag_begin_cb (GtkWidget *widget, GdkDragContext *context,
gpointer user_data);
@@ -489,6 +493,7 @@ check_scrollbar_visibility (EogScrollView *view, GtkAllocation *alloc)
#define DOUBLE_EQUAL_MAX_DIFF 1e-6
#define DOUBLE_EQUAL(a,b) (fabs (a - b) < DOUBLE_EQUAL_MAX_DIFF)
+#if 0
/* Returns whether the zoom factor is 1.0 */
static gboolean
is_unity_zoom (EogScrollView *view)
@@ -498,6 +503,7 @@ is_unity_zoom (EogScrollView *view)
priv = view->priv;
return DOUBLE_EQUAL (priv->zoom, 1.0);
}
+#endif
/* Returns whether the image is zoomed in */
static gboolean
@@ -567,6 +573,7 @@ get_image_offsets (EogScrollView *view, int *xofs, int *yofs)
---------------------------------*/
+#if 0
/* Pulls a rectangle from the specified microtile array. The rectangle is the
* first one that would be glommed together by art_rect_list_from_uta(), and its
* size is bounded by max_width and max_height. The rectangle is also removed
@@ -597,6 +604,7 @@ paint_background (EogScrollView *view, EogIRect *r, EogIRect *rect)
d.x1 - d.x0, d.y1 - d.y0);
}
}
+#endif
static void
get_transparency_params (EogScrollView *view, int *size, guint32 *color1, guint32 *color2)
@@ -1785,7 +1793,6 @@ display_expose_event (GtkWidget *widget, GdkEventExpose *event, gpointer data)
GtkAllocation allocation;
int scaled_width, scaled_height;
int xofs, yofs;
- EogIRect r, d;
g_return_val_if_fail (GTK_IS_DRAWING_AREA (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -2338,18 +2345,19 @@ eog_scroll_view_set_image (EogScrollView *view, EogImage *image)
g_assert (priv->image == NULL);
g_assert (priv->pixbuf == NULL);
- priv->progressive_state = PROGRESSIVE_NONE;
+ /* priv->progressive_state = PROGRESSIVE_NONE; */
if (image != NULL) {
eog_image_data_ref (image);
if (priv->pixbuf == NULL) {
update_pixbuf (view, eog_image_get_pixbuf (image));
- priv->progressive_state = PROGRESSIVE_NONE;
+ /* priv->progressive_state = PROGRESSIVE_NONE; */
set_zoom_fit (view);
check_scrollbar_visibility (view, NULL);
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
}
+#if 0
else if ((is_zoomed_in (view) && priv->interp_type_in != GDK_INTERP_NEAREST) ||
(is_zoomed_out (view) && priv->interp_type_out != GDK_INTERP_NEAREST))
{
@@ -2357,6 +2365,7 @@ eog_scroll_view_set_image (EogScrollView *view, EogImage *image)
priv->progressive_state = PROGRESSIVE_POLISHING;
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
}
+#endif
priv->image_changed_id = g_signal_connect (image, "changed",
(GCallback) image_changed_cb, view);
@@ -2445,7 +2454,7 @@ eog_scroll_view_init (EogScrollView *view)
priv->image = NULL;
priv->pixbuf = NULL;
priv->surface = NULL;
- priv->progressive_state = PROGRESSIVE_NONE;
+ /* priv->progressive_state = PROGRESSIVE_NONE; */
priv->transp_style = EOG_TRANSP_BACKGROUND;
priv->transp_color = 0;
priv->cursor = EOG_SCROLL_VIEW_CURSOR_NORMAL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]