[eog] Revert commits I pushed by mistake
- From: Gustavo Noronha Silva <gns src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [eog] Revert commits I pushed by mistake
- Date: Thu, 5 Nov 2009 18:06:29 +0000 (UTC)
commit be27f848baa3d4c63b34d904c6e4438ad16ccd8e
Author: Gustavo Noronha Silva <kov debian org>
Date: Thu Nov 5 16:04:57 2009 -0200
Revert commits I pushed by mistake
They were supposed to go to a personal branch instead.
bindings/python/Makefile.am | 2 +-
bindings/python/eog.defs | 111 ++++-----
configure.ac | 45 ---
doc/reference/eog-sections.txt | 50 ++---
plugins/reload/eog-reload-plugin.c | 2 +-
src/Makefile.am | 20 +--
src/eog-clutter-view.c | 526 ------------------------------------
src/eog-clutter-view.h | 55 ----
src/eog-scroll-view.c | 272 +++++++------------
src/eog-scroll-view.h | 34 +++-
src/eog-window.c | 200 ++++-----------
src/eog-window.h | 9 -
src/main.c | 11 -
13 files changed, 251 insertions(+), 1086 deletions(-)
---
diff --git a/bindings/python/Makefile.am b/bindings/python/Makefile.am
index 360ead5..d57d5c9 100644
--- a/bindings/python/Makefile.am
+++ b/bindings/python/Makefile.am
@@ -46,7 +46,7 @@ BINDING_EOG_HEADERS_SRCDIR_IN = \
src/eog-statusbar.h \
src/eog-thumb-nav.h \
src/eog-image.h \
- src/eog-view.h \
+ src/eog-scroll-view.h \
src/eog-thumb-view.h \
src/eog-list-store.h \
src/eog-job-queue.h \
diff --git a/bindings/python/eog.defs b/bindings/python/eog.defs
index 08b40ed..276cd06 100644
--- a/bindings/python/eog.defs
+++ b/bindings/python/eog.defs
@@ -98,12 +98,12 @@
(gtype-id "EOG_TYPE_PROPERTIES_DIALOG")
)
-;;; (define-object ScrollView
-;;; (in-module "Eog")
-;;; (parent "GtkTable")
-;;; (c-name "EogScrollView")
-;;; (gtype-id "EOG_TYPE_SCROLL_VIEW")
-;;; )
+(define-object ScrollView
+ (in-module "Eog")
+ (parent "GtkTable")
+ (c-name "EogScrollView")
+ (gtype-id "EOG_TYPE_SCROLL_VIEW")
+)
(define-object Sidebar
(in-module "Eog")
@@ -140,16 +140,6 @@
(gtype-id "EOG_TYPE_WINDOW")
)
-;; Interfaces.
-
-(define-interface View
- (in-module "Eog")
- (c-name "EogView")
- (gtype-id "EOG_TYPE_VIEW")
- (vtable "EogViewClass")
- (prerequisite "GtkWidget")
-)
-
;; Enumerations and flags ...
(define-flags ImageData
@@ -892,29 +882,20 @@
;; From eog-scroll-view.h
-;;(define-function eog_scroll_view_get_type
-;; (c-name "eog_scroll_view_get_type")
-;; (return-type "GType")
-;;)
-
-;;(define-function eog_scroll_view_new
-;; (c-name "eog_scroll_view_new")
-;; (is-constructor-of "EogScrollView")
-;; (return-type "GtkWidget*")
-;;)
-
-
-
-;; From eog-view.h
-
-(define-function eog_view_get_type
- (c-name "eog_view_get_type")
+(define-function eog_scroll_view_get_type
+ (c-name "eog_scroll_view_get_type")
(return-type "GType")
)
+(define-function eog_scroll_view_new
+ (c-name "eog_scroll_view_new")
+ (is-constructor-of "EogScrollView")
+ (return-type "GtkWidget*")
+)
+
(define-method set_image
- (of-object "EogView")
- (c-name "eog_view_set_image")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_set_image")
(return-type "none")
(parameters
'("EogImage*" "image")
@@ -922,8 +903,8 @@
)
(define-method set_zoom_upscale
- (of-object "EogView")
- (c-name "eog_view_set_zoom_upscale")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_set_zoom_upscale")
(return-type "none")
(parameters
'("gboolean" "upscale")
@@ -931,8 +912,8 @@
)
(define-method set_zoom_multiplier
- (of-object "EogView")
- (c-name "eog_view_set_zoom_multiplier")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_set_zoom_multiplier")
(return-type "none")
(parameters
'("gdouble" "multiplier")
@@ -940,8 +921,8 @@
)
(define-method set_antialiasing_in
- (of-object "EogView")
- (c-name "eog_view_set_antialiasing_in")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_set_antialiasing_in")
(return-type "none")
(parameters
'("gboolean" "state")
@@ -949,8 +930,8 @@
)
(define-method set_antialiasing_out
- (of-object "EogView")
- (c-name "eog_view_set_antialiasing_out")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_set_antialiasing_out")
(return-type "none")
(parameters
'("gboolean" "state")
@@ -958,8 +939,8 @@
)
(define-method set_transparency
- (of-object "EogView")
- (c-name "eog_view_set_transparency")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_set_transparency")
(return-type "none")
(parameters
'("EogTransparencyStyle" "style")
@@ -968,14 +949,14 @@
)
(define-method scrollbars_visible
- (of-object "EogView")
- (c-name "eog_view_scrollbars_visible")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_scrollbars_visible")
(return-type "gboolean")
)
(define-method zoom_in
- (of-object "EogView")
- (c-name "eog_view_zoom_in")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_zoom_in")
(return-type "none")
(parameters
'("gboolean" "smooth")
@@ -983,8 +964,8 @@
)
(define-method zoom_out
- (of-object "EogView")
- (c-name "eog_view_zoom_out")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_zoom_out")
(return-type "none")
(parameters
'("gboolean" "smooth")
@@ -992,14 +973,14 @@
)
(define-method zoom_fit
- (of-object "EogView")
- (c-name "eog_view_zoom_fit")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_zoom_fit")
(return-type "none")
)
(define-method set_zoom
- (of-object "EogView")
- (c-name "eog_view_set_zoom")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_set_zoom")
(return-type "none")
(parameters
'("double" "zoom")
@@ -1007,32 +988,32 @@
)
(define-method get_zoom
- (of-object "EogView")
- (c-name "eog_view_get_zoom")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_get_zoom")
(return-type "double")
)
(define-method get_zoom_is_min
- (of-object "EogView")
- (c-name "eog_view_get_zoom_is_min")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_get_zoom_is_min")
(return-type "gboolean")
)
(define-method get_zoom_is_max
- (of-object "EogView")
- (c-name "eog_view_get_zoom_is_max")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_get_zoom_is_max")
(return-type "gboolean")
)
(define-method show_cursor
- (of-object "EogView")
- (c-name "eog_view_show_cursor")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_show_cursor")
(return-type "none")
)
(define-method hide_cursor
- (of-object "EogView")
- (c-name "eog_view_hide_cursor")
+ (of-object "EogScrollView")
+ (c-name "eog_scroll_view_hide_cursor")
(return-type "none")
)
diff --git a/configure.ac b/configure.ac
index 223b213..b08b264 100644
--- a/configure.ac
+++ b/configure.ac
@@ -225,50 +225,6 @@ AC_ARG_WITH(libjpeg, AC_HELP_STRING([--without-libjpeg], [disable special JPEG s
AC_SUBST(LIBJPEG)
AM_CONDITIONAL(ENABLE_JPEG, test x$have_jpeg = xyes)
-# ******************
-# Clutter (optional)
-# ******************
-
-CLUTTER_REQUIRED=1.0.0
-
-AC_ARG_WITH([clutter], AC_HELP_STRING([--with-clutter], [enable Clutter backend]),
- [with_clutter=$withval], [with_clutter=no])
-have_clutter=no
-if test "x$with_clutter" != "xno"; then
- PKG_CHECK_MODULES(CLUTTER,
- clutter-1.0 >= $CLUTTER_REQUIRED dnl
- clutter-gtk-0.10
- clutter-gesture,
- have_clutter=yes, have_clutter=no)
-fi
-if test "x$have_clutter" = "xyes"; then
- AC_DEFINE(WITH_CLUTTER_BACKEND, 1, [Clutter backend.])
- EOG_MODULES="$EOG_MODULES clutter-1.0 >= $CLUTTER_REQUIRED clutter-gtk-0.10 clutter-gesture"
-fi
-
-AM_CONDITIONAL([WITH_CLUTTER_BACKEND], [test "x$have_clutter" = "xyes"])
-
-# ******************
-# Hildon (optional)
-# ******************
-
-HILDON_REQUIRED=1.99.0
-
-AC_ARG_WITH([hildon], AC_HELP_STRING([--with-hildon], [enable Hildon UI]),
- [with_hildon=$withval], [with_hildon=no])
-have_hildon=no
-if test "x$with_hildon" != "xno"; then
- PKG_CHECK_MODULES(HILDON,
- hildon-1 >= $HILDON_REQUIRED,
- have_hildon=yes, have_hildon=no)
-fi
-if test "x$have_hildon" = "xyes"; then
- AC_DEFINE(WITH_HILDON_UI, 1, [Hildon UI.])
- EOG_MODULES="$EOG_MODULES hildon-1 >= $HILDON_REQUIRED"
-fi
-
-AM_CONDITIONAL([WITH_HILDON_UI], [test "x$have_hildon" = "xyes"])
-
# ****************
# D-Bus activation
# ****************
@@ -482,5 +438,4 @@ Configure summary:
JPEG support ...............: ${have_jpeg}
Colour management support ..: ${have_lcms}
D-Bus activation............: ${have_dbus}
- Clutter backend.............: ${have_clutter}
"
diff --git a/doc/reference/eog-sections.txt b/doc/reference/eog-sections.txt
index 3eacd5a..5a0bc4d 100644
--- a/doc/reference/eog-sections.txt
+++ b/doc/reference/eog-sections.txt
@@ -434,7 +434,26 @@ EOG_PLUGIN_MANAGER_GET_CLASS
<FILE>eog-scroll-view</FILE>
<TITLE>EogScrollView</TITLE>
EogScrollView
+EogTransparencyStyle
eog_scroll_view_new
+eog_scroll_view_set_image
+eog_scroll_view_set_scroll_wheel_zoom
+eog_scroll_view_set_zoom_upscale
+eog_scroll_view_set_zoom_multiplier
+eog_scroll_view_set_antialiasing_in
+eog_scroll_view_set_antialiasing_out
+eog_scroll_view_set_transparency
+eog_scroll_view_scrollbars_visible
+eog_scroll_view_set_popup
+eog_scroll_view_zoom_in
+eog_scroll_view_zoom_out
+eog_scroll_view_zoom_fit
+eog_scroll_view_set_zoom
+eog_scroll_view_get_zoom
+eog_scroll_view_get_zoom_is_min
+eog_scroll_view_get_zoom_is_max
+eog_scroll_view_show_cursor
+eog_scroll_view_hide_cursor
<SUBSECTION Standard>
EOG_SCROLL_VIEW
EOG_IS_SCROLL_VIEW
@@ -605,37 +624,6 @@ EOG_SIDEBAR_GET_CLASS
</SECTION>
<SECTION>
-<FILE>eog-view</FILE>
-EOG_VIEW_GET_INTERFACE
-EogTransparencyStyle
-<TITLE>EogView</TITLE>
-EogView
-eog_view_set_image
-eog_view_set_scroll_wheel_zoom
-eog_view_set_zoom_upscale
-eog_view_set_zoom_multiplier
-eog_view_set_antialiasing
-eog_view_set_transparency
-eog_view_scrollbars_visible
-eog_view_set_popup
-eog_view_zoom_in
-eog_view_zoom_out
-eog_view_zoom_fit
-eog_view_set_zoom
-eog_view_get_zoom
-eog_view_get_zoom_is_min
-eog_view_get_zoom_is_max
-eog_view_show_cursor
-eog_view_hide_cursor
-<SUBSECTION Standard>
-EOG_VIEW
-EOG_IS_VIEW
-EOG_TYPE_VIEW
-eog_view_get_type
-EOG_VIEW_CLASS
-</SECTION>
-
-<SECTION>
<FILE>eog-thumbnail</FILE>
eog_thumbnail_init
eog_thumbnail_fit_to_size
diff --git a/plugins/reload/eog-reload-plugin.c b/plugins/reload/eog-reload-plugin.c
index 830415a..beedae1 100644
--- a/plugins/reload/eog-reload-plugin.c
+++ b/plugins/reload/eog-reload-plugin.c
@@ -8,7 +8,7 @@
#include <glib/gi18n-lib.h>
#include <eog-debug.h>
-#include <eog-view.h>
+#include <eog-scroll-view.h>
#include <eog-thumb-view.h>
#include <eog-image.h>
diff --git a/src/Makefile.am b/src/Makefile.am
index a2edcad..f17050f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -61,7 +61,7 @@ INST_H_FILES = \
eog-image.h \
eog-enums.h \
eog-image-save-info.h \
- eog-view.h \
+ eog-scroll-view.h \
eog-thumb-view.h \
eog-list-store.h \
eog-thumbnail.h \
@@ -69,14 +69,6 @@ INST_H_FILES = \
eog-jobs.h \
eog-plugin.h
-if WITH_CLUTTER_BACKEND
-INST_H_FILES += \
- eog-clutter-view.h
-else
-INST_H_FILES += \
- eog-scroll-view.h
-endif
-
libeog_la_SOURCES = \
eog-application.c \
eog-session.c \
@@ -97,7 +89,7 @@ libeog_la_SOURCES = \
eog-image.c \
eog-image-jpeg.c \
eog-image-save-info.c \
- eog-view.c \
+ eog-scroll-view.c \
eog-thumb-view.c \
eog-list-store.c \
eog-thumbnail.c \
@@ -150,14 +142,6 @@ libeog_la_SOURCES += \
eog-exif-details.c
endif HAVE_EXEMPI
-if WITH_CLUTTER_BACKEND
-libeog_la_SOURCES += \
- eog-clutter-view.c
-else
-libeog_la_SOURCES += \
- eog-scroll-view.c
-endif
-
libeog_la_CFLAGS = \
-I$(top_srcdir)/jpegutils \
-I$(top_srcdir)/cut-n-paste/toolbar-editor \
diff --git a/src/eog-scroll-view.c b/src/eog-scroll-view.c
index 858e94c..60005dd 100644
--- a/src/eog-scroll-view.c
+++ b/src/eog-scroll-view.c
@@ -6,8 +6,8 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <gdk/gdkkeysyms.h>
+#include "eog-marshal.h"
#include "eog-scroll-view.h"
-#include "eog-view.h"
#include "eog-debug.h"
#include "uta.h"
#include "zoom.h"
@@ -49,6 +49,13 @@ typedef enum {
PROGRESSIVE_POLISHING /* We have finished loading an image but have not scaled it with interpolation */
} ProgressiveState;
+/* Signal IDs */
+enum {
+ SIGNAL_ZOOM_CHANGED,
+ SIGNAL_LAST
+};
+static gint view_signals [SIGNAL_LAST];
+
typedef enum {
EOG_SCROLL_VIEW_CURSOR_NORMAL,
EOG_SCROLL_VIEW_CURSOR_HIDDEN,
@@ -132,41 +139,10 @@ static void set_zoom_fit (EogScrollView *view);
static void request_paint_area (EogScrollView *view, GdkRectangle *area);
static void set_minimum_zoom_factor (EogScrollView *view);
-/* EogView interface implementation */
-
-static void eog_scroll_view_iface_init (EogViewClass *iface);
-
-/* loading stuff */
-static void eog_scroll_view_set_image (EogView *view, EogImage *image);
-
-/* general properties */
-static void eog_scroll_view_set_scroll_wheel_zoom (EogView *view, gboolean scroll_wheel_zoom);
-static void eog_scroll_view_set_zoom_upscale (EogView *view, gboolean upscale);
-static void eog_scroll_view_set_zoom_multiplier (EogView *view, gdouble multiplier);
-static void eog_scroll_view_set_antialiasing_in (EogView *view, gboolean state);
-static void eog_scroll_view_set_antialiasing_out (EogView *view, gboolean state);
-static void eog_scroll_view_set_transparency (EogView *view, EogTransparencyStyle style, GdkColor *color);
-static gboolean eog_scroll_view_scrollbars_visible (EogView *view);
-static void eog_scroll_view_set_popup (EogView *view, GtkMenu *menu);
-static void eog_scroll_view_set_bg_color (EogView *view, GdkColor *color);
-
-/* zoom api */
-static void eog_scroll_view_zoom_in (EogView *view, gboolean smooth);
-static void eog_scroll_view_zoom_out (EogView *view, gboolean smooth);
-static void eog_scroll_view_zoom_fit (EogView *view);
-static void eog_scroll_view_set_zoom (EogView *view, double zoom);
-static double eog_scroll_view_get_zoom (EogView *view);
-static gboolean eog_scroll_view_get_zoom_is_min (EogView *view);
-static gboolean eog_scroll_view_get_zoom_is_max (EogView *view);
-static void eog_scroll_view_show_cursor (EogView *view);
-static void eog_scroll_view_hide_cursor (EogView *view);
-
#define EOG_SCROLL_VIEW_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), EOG_TYPE_SCROLL_VIEW, EogScrollViewPrivate))
-G_DEFINE_TYPE_WITH_CODE (EogScrollView, eog_scroll_view, GTK_TYPE_TABLE,
- G_IMPLEMENT_INTERFACE (EOG_TYPE_VIEW,
- eog_scroll_view_iface_init))
+G_DEFINE_TYPE (EogScrollView, eog_scroll_view, GTK_TYPE_TABLE)
/*===================================
@@ -1106,7 +1082,7 @@ set_zoom (EogScrollView *view, double zoom,
/* repaint the whole image */
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
- g_signal_emit_by_name (view, "zoom_changed", 0, priv->zoom);
+ g_signal_emit (view, view_signals [SIGNAL_ZOOM_CHANGED], 0, priv->zoom);
}
/* Zooms the image to fit the available allocation */
@@ -1144,7 +1120,7 @@ set_zoom_fit (EogScrollView *view)
priv->xofs = 0;
priv->yofs = 0;
- g_signal_emit_by_name (view, "zoom_changed", 0, priv->zoom);
+ g_signal_emit (view, view_signals [SIGNAL_ZOOM_CHANGED], 0, priv->zoom);
}
/*===================================
@@ -1688,57 +1664,51 @@ image_changed_cb (EogImage *img, gpointer data)
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
}
-/*=============================================
- "public" API (accessed through interface)
- ---------------------------------------------*/
+/*===================================
+ public API
+ ---------------------------------*/
-static void
-eog_scroll_view_hide_cursor (EogView *view)
+void
+eog_scroll_view_hide_cursor (EogScrollView *view)
{
- eog_scroll_view_set_cursor (EOG_SCROLL_VIEW (view), EOG_SCROLL_VIEW_CURSOR_HIDDEN);
+ eog_scroll_view_set_cursor (view, EOG_SCROLL_VIEW_CURSOR_HIDDEN);
}
-static void
-eog_scroll_view_show_cursor (EogView *view)
+void
+eog_scroll_view_show_cursor (EogScrollView *view)
{
- eog_scroll_view_set_cursor (EOG_SCROLL_VIEW (view), EOG_SCROLL_VIEW_CURSOR_NORMAL);
+ eog_scroll_view_set_cursor (view, EOG_SCROLL_VIEW_CURSOR_NORMAL);
}
/* general properties */
-static void
-eog_scroll_view_set_zoom_upscale (EogView *view, gboolean upscale)
+void
+eog_scroll_view_set_zoom_upscale (EogScrollView *view, gboolean upscale)
{
- EogScrollView *scroll_view;
EogScrollViewPrivate *priv;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- priv = scroll_view->priv;
+ priv = view->priv;
if (priv->upscale != upscale) {
priv->upscale = upscale;
if (priv->zoom_mode == ZOOM_MODE_FIT) {
- set_zoom_fit (scroll_view);
+ set_zoom_fit (view);
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
}
}
}
-static void
-eog_scroll_view_set_antialiasing_in (EogView *view, gboolean state)
+void
+eog_scroll_view_set_antialiasing_in (EogScrollView *view, gboolean state)
{
- EogScrollView *scroll_view;
EogScrollViewPrivate *priv;
GdkInterpType new_interp_type;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- priv = scroll_view->priv;
+ priv = view->priv;
new_interp_type = state ? GDK_INTERP_BILINEAR : GDK_INTERP_NEAREST;
@@ -1748,18 +1718,15 @@ eog_scroll_view_set_antialiasing_in (EogView *view, gboolean state)
}
}
-static void
-eog_scroll_view_set_antialiasing_out (EogView *view, gboolean state)
+void
+eog_scroll_view_set_antialiasing_out (EogScrollView *view, gboolean state)
{
- EogScrollView *scroll_view;
EogScrollViewPrivate *priv;
GdkInterpType new_interp_type;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- priv = scroll_view->priv;
+ priv = view->priv;
new_interp_type = state ? GDK_INTERP_BILINEAR : GDK_INTERP_NEAREST;
@@ -1769,10 +1736,9 @@ eog_scroll_view_set_antialiasing_out (EogView *view, gboolean state)
}
}
-static void
-eog_scroll_view_set_transparency (EogView *view, EogTransparencyStyle style, GdkColor *color)
+void
+eog_scroll_view_set_transparency (EogScrollView *view, EogTransparencyStyle style, GdkColor *color)
{
- EogScrollView *scroll_view;
EogScrollViewPrivate *priv;
guint32 col = 0;
guint32 red, green, blue;
@@ -1780,9 +1746,7 @@ eog_scroll_view_set_transparency (EogView *view, EogTransparencyStyle style, Gdk
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- priv = scroll_view->priv;
+ priv = view->priv;
if (color != NULL) {
red = (color->red >> 8) << 16;
@@ -1816,18 +1780,15 @@ static double preferred_zoom_levels[] = {
};
static const gint n_zoom_levels = (sizeof (preferred_zoom_levels) / sizeof (double));
-static void
-eog_scroll_view_zoom_in (EogView *view, gboolean smooth)
+void
+eog_scroll_view_zoom_in (EogScrollView *view, gboolean smooth)
{
- EogScrollView *scroll_view;
EogScrollViewPrivate *priv;
double zoom;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- priv = scroll_view->priv;
+ priv = view->priv;
if (smooth) {
zoom = priv->zoom * priv->zoom_multiplier;
@@ -1851,22 +1812,19 @@ eog_scroll_view_zoom_in (EogView *view, gboolean smooth)
zoom = preferred_zoom_levels [i];
}
}
- set_zoom (scroll_view, zoom, FALSE, 0, 0);
+ set_zoom (view, zoom, FALSE, 0, 0);
}
-static void
-eog_scroll_view_zoom_out (EogView *view, gboolean smooth)
+void
+eog_scroll_view_zoom_out (EogScrollView *view, gboolean smooth)
{
- EogScrollView *scroll_view;
EogScrollViewPrivate *priv;
double zoom;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- priv = scroll_view->priv;
+ priv = view->priv;
if (smooth) {
zoom = priv->zoom / priv->zoom_multiplier;
@@ -1889,56 +1847,52 @@ eog_scroll_view_zoom_out (EogView *view, gboolean smooth)
zoom = preferred_zoom_levels [i];
}
}
- set_zoom (scroll_view, zoom, FALSE, 0, 0);
+ set_zoom (view, zoom, FALSE, 0, 0);
}
-static void
-eog_scroll_view_zoom_fit (EogView *view)
+void
+eog_scroll_view_zoom_fit (EogScrollView *view)
{
- EogScrollView *scroll_view;
-
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- set_zoom_fit (scroll_view);
- check_scrollbar_visibility (scroll_view, NULL);
- gtk_widget_queue_draw (GTK_WIDGET (scroll_view->priv->display));
+ set_zoom_fit (view);
+ check_scrollbar_visibility (view, NULL);
+ gtk_widget_queue_draw (GTK_WIDGET (view->priv->display));
}
-static void
-eog_scroll_view_set_zoom (EogView *view, double zoom)
+void
+eog_scroll_view_set_zoom (EogScrollView *view, double zoom)
{
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- set_zoom (EOG_SCROLL_VIEW (view), zoom, FALSE, 0, 0);
+ set_zoom (view, zoom, FALSE, 0, 0);
}
-static double
-eog_scroll_view_get_zoom (EogView *view)
+double
+eog_scroll_view_get_zoom (EogScrollView *view)
{
g_return_val_if_fail (EOG_IS_SCROLL_VIEW (view), 0.0);
- return EOG_SCROLL_VIEW (view)->priv->zoom;
+ return view->priv->zoom;
}
-static gboolean
-eog_scroll_view_get_zoom_is_min (EogView *view)
+gboolean
+eog_scroll_view_get_zoom_is_min (EogScrollView *view)
{
g_return_val_if_fail (EOG_IS_SCROLL_VIEW (view), FALSE);
- set_minimum_zoom_factor (EOG_SCROLL_VIEW (view));
+ set_minimum_zoom_factor (view);
- return DOUBLE_EQUAL (EOG_SCROLL_VIEW (view)->priv->zoom, MIN_ZOOM_FACTOR) ||
- DOUBLE_EQUAL (EOG_SCROLL_VIEW (view)->priv->zoom, EOG_SCROLL_VIEW (view)->priv->min_zoom);
+ return DOUBLE_EQUAL (view->priv->zoom, MIN_ZOOM_FACTOR) ||
+ DOUBLE_EQUAL (view->priv->zoom, view->priv->min_zoom);
}
-static gboolean
-eog_scroll_view_get_zoom_is_max (EogView *view)
+gboolean
+eog_scroll_view_get_zoom_is_max (EogScrollView *view)
{
g_return_val_if_fail (EOG_IS_SCROLL_VIEW (view), FALSE);
- return DOUBLE_EQUAL (EOG_SCROLL_VIEW (view)->priv->zoom, MAX_ZOOM_FACTOR);
+ return DOUBLE_EQUAL (view->priv->zoom, MAX_ZOOM_FACTOR);
}
static void
@@ -1962,24 +1916,21 @@ display_next_frame_cb (EogImage *image, gint delay, gpointer data)
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
}
-static void
-eog_scroll_view_set_image (EogView *view, EogImage *image)
+void
+eog_scroll_view_set_image (EogScrollView *view, EogImage *image)
{
- EogScrollView *scroll_view;
EogScrollViewPrivate *priv;
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- scroll_view = EOG_SCROLL_VIEW (view);
-
- priv = scroll_view->priv;
+ priv = view->priv;
if (priv->image == image) {
return;
}
if (priv->image != NULL) {
- free_image_resources (scroll_view);
+ free_image_resources (view);
if (GTK_WIDGET_DRAWABLE (priv->display) && image == NULL) {
gdk_window_clear (GTK_WIDGET (priv->display)->window);
}
@@ -1994,13 +1945,13 @@ eog_scroll_view_set_image (EogView *view, EogImage *image)
if (priv->pixbuf == NULL) {
priv->pixbuf = eog_image_get_pixbuf (image);
priv->progressive_state = PROGRESSIVE_NONE;
- set_zoom_fit (scroll_view);
- check_scrollbar_visibility (scroll_view, NULL);
+ set_zoom_fit (view);
+ check_scrollbar_visibility (view, NULL);
gtk_widget_queue_draw (GTK_WIDGET (priv->display));
}
- else if ((is_zoomed_in (scroll_view) && priv->interp_type_in != GDK_INTERP_NEAREST) ||
- (is_zoomed_out (scroll_view) && priv->interp_type_out != GDK_INTERP_NEAREST))
+ else if ((is_zoomed_in (view) && priv->interp_type_in != GDK_INTERP_NEAREST) ||
+ (is_zoomed_out (view) && priv->interp_type_out != GDK_INTERP_NEAREST))
{
/* paint antialiased image version */
priv->progressive_state = PROGRESSIVE_POLISHING;
@@ -2008,22 +1959,22 @@ eog_scroll_view_set_image (EogView *view, EogImage *image)
}
priv->image_changed_id = g_signal_connect (image, "changed",
- (GCallback) image_changed_cb, scroll_view);
+ (GCallback) image_changed_cb, view);
if (eog_image_is_animation (image) == TRUE ) {
eog_image_start_animation (image);
priv->frame_changed_id = g_signal_connect (image, "next-frame",
- (GCallback) display_next_frame_cb, scroll_view);
+ (GCallback) display_next_frame_cb, view);
}
}
priv->image = image;
}
-static gboolean
-eog_scroll_view_scrollbars_visible (EogView *view)
+gboolean
+eog_scroll_view_scrollbars_visible (EogScrollView *view)
{
- if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (EOG_SCROLL_VIEW (view)->priv->hbar)) &&
- !GTK_WIDGET_VISIBLE (GTK_WIDGET (EOG_SCROLL_VIEW (view)->priv->vbar)))
+ if (!GTK_WIDGET_VISIBLE (GTK_WIDGET (view->priv->hbar)) &&
+ !GTK_WIDGET_VISIBLE (GTK_WIDGET (view->priv->vbar)))
return FALSE;
return TRUE;
@@ -2096,6 +2047,16 @@ eog_scroll_view_class_init (EogScrollViewClass *klass)
gobject_class->dispose = eog_scroll_view_dispose;
+ view_signals [SIGNAL_ZOOM_CHANGED] =
+ g_signal_new ("zoom_changed",
+ EOG_TYPE_SCROLL_VIEW,
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EogScrollViewClass, zoom_changed),
+ NULL, NULL,
+ eog_marshal_VOID__DOUBLE,
+ G_TYPE_NONE, 1,
+ G_TYPE_DOUBLE);
+
widget_class->size_allocate = eog_scroll_view_size_allocate;
widget_class->style_set = eog_scroll_view_style_set;
@@ -2103,30 +2064,6 @@ eog_scroll_view_class_init (EogScrollViewClass *klass)
}
static void
-eog_scroll_view_iface_init (EogViewClass *iface)
-{
- iface->set_image = eog_scroll_view_set_image;
- iface->set_scroll_wheel_zoom = eog_scroll_view_set_scroll_wheel_zoom;
- iface->set_zoom_upscale = eog_scroll_view_set_zoom_upscale;
- iface->set_zoom_multiplier = eog_scroll_view_set_zoom_multiplier;
- iface->set_antialiasing_in = eog_scroll_view_set_antialiasing_in;
- iface->set_antialiasing_out = eog_scroll_view_set_antialiasing_out;
- iface->set_transparency = eog_scroll_view_set_transparency;
- iface->scrollbars_visible = eog_scroll_view_scrollbars_visible;
- iface->set_popup = eog_scroll_view_set_popup;
- iface->set_bg_color = eog_scroll_view_set_bg_color;
- iface->zoom_in = eog_scroll_view_zoom_in;
- iface->zoom_out = eog_scroll_view_zoom_out;
- iface->zoom_fit = eog_scroll_view_zoom_fit;
- iface->set_zoom = eog_scroll_view_set_zoom;
- iface->get_zoom = eog_scroll_view_get_zoom;
- iface->get_zoom_is_max = eog_scroll_view_get_zoom_is_max;
- iface->get_zoom_is_min = eog_scroll_view_get_zoom_is_min;
- iface->show_cursor = eog_scroll_view_show_cursor;
- iface->hide_cursor = eog_scroll_view_hide_cursor;
-}
-
-static void
view_on_drag_begin_cb (GtkWidget *widget,
GdkDragContext *context,
gpointer user_data)
@@ -2294,30 +2231,25 @@ view_on_button_press_event_cb (GtkWidget *view, GdkEventButton *event,
return FALSE;
}
-static void
-eog_scroll_view_set_popup (EogView *view,
- GtkMenu *menu)
+void
+eog_scroll_view_set_popup (EogScrollView *view,
+ GtkMenu *menu)
{
- EogScrollView *scroll_view;
-
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
+ g_return_if_fail (view->priv->menu == NULL);
- scroll_view = EOG_SCROLL_VIEW (view);
-
- g_return_if_fail (scroll_view->priv->menu == NULL);
-
- scroll_view->priv->menu = g_object_ref (menu);
+ view->priv->menu = g_object_ref (menu);
- gtk_menu_attach_to_widget (GTK_MENU (scroll_view->priv->menu),
- GTK_WIDGET (scroll_view),
+ gtk_menu_attach_to_widget (GTK_MENU (view->priv->menu),
+ GTK_WIDGET (view),
NULL);
- g_signal_connect (G_OBJECT (scroll_view), "button_press_event",
+ g_signal_connect (G_OBJECT (view), "button_press_event",
G_CALLBACK (view_on_button_press_event_cb), NULL);
}
-static void
-eog_scroll_view_set_bg_color (EogView *view,
+void
+eog_scroll_view_set_bg_color (EogScrollView *view,
GdkColor *color)
{
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
@@ -2325,20 +2257,20 @@ eog_scroll_view_set_bg_color (EogView *view,
gtk_widget_modify_bg (GTK_WIDGET (view), GTK_STATE_NORMAL, color);
}
-static void
-eog_scroll_view_set_scroll_wheel_zoom (EogView *view,
- gboolean scroll_wheel_zoom)
+void
+eog_scroll_view_set_scroll_wheel_zoom (EogScrollView *view,
+ gboolean scroll_wheel_zoom)
{
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- EOG_SCROLL_VIEW (view)->priv->scroll_wheel_zoom = scroll_wheel_zoom;
+ view->priv->scroll_wheel_zoom = scroll_wheel_zoom;
}
-static void
-eog_scroll_view_set_zoom_multiplier (EogView *view,
- gdouble zoom_multiplier)
+void
+eog_scroll_view_set_zoom_multiplier (EogScrollView *view,
+ gdouble zoom_multiplier)
{
g_return_if_fail (EOG_IS_SCROLL_VIEW (view));
- EOG_SCROLL_VIEW (view)->priv->zoom_multiplier = 1.0 + zoom_multiplier;
+ view->priv->zoom_multiplier = 1.0 + zoom_multiplier;
}
diff --git a/src/eog-scroll-view.h b/src/eog-scroll-view.h
index 7f4c2bd..baaf6f0 100644
--- a/src/eog-scroll-view.h
+++ b/src/eog-scroll-view.h
@@ -2,7 +2,6 @@
#define _EOG_SCROLL_VIEW_H_
#include <gtk/gtk.h>
-#include "eog-view.h"
#include "eog-image.h"
G_BEGIN_DECLS
@@ -26,11 +25,44 @@ struct _EogScrollView {
struct _EogScrollViewClass {
GtkTableClass parent_class;
+
+ void (* zoom_changed) (EogScrollView *view, double zoom);
};
+typedef enum {
+ EOG_TRANSP_BACKGROUND,
+ EOG_TRANSP_CHECKED,
+ EOG_TRANSP_COLOR
+} EogTransparencyStyle;
+
GType eog_scroll_view_get_type (void) G_GNUC_CONST;
GtkWidget* eog_scroll_view_new (void);
+/* loading stuff */
+void eog_scroll_view_set_image (EogScrollView *view, EogImage *image);
+
+/* general properties */
+void eog_scroll_view_set_scroll_wheel_zoom (EogScrollView *view, gboolean scroll_wheel_zoom);
+void eog_scroll_view_set_zoom_upscale (EogScrollView *view, gboolean upscale);
+void eog_scroll_view_set_zoom_multiplier (EogScrollView *view, gdouble multiplier);
+void eog_scroll_view_set_antialiasing_in (EogScrollView *view, gboolean state);
+void eog_scroll_view_set_antialiasing_out (EogScrollView *view, gboolean state);
+void eog_scroll_view_set_transparency (EogScrollView *view, EogTransparencyStyle style, GdkColor *color);
+gboolean eog_scroll_view_scrollbars_visible (EogScrollView *view);
+void eog_scroll_view_set_popup (EogScrollView *view, GtkMenu *menu);
+void eog_scroll_view_set_bg_color (EogScrollView *view, GdkColor *color);
+
+/* zoom api */
+void eog_scroll_view_zoom_in (EogScrollView *view, gboolean smooth);
+void eog_scroll_view_zoom_out (EogScrollView *view, gboolean smooth);
+void eog_scroll_view_zoom_fit (EogScrollView *view);
+void eog_scroll_view_set_zoom (EogScrollView *view, double zoom);
+double eog_scroll_view_get_zoom (EogScrollView *view);
+gboolean eog_scroll_view_get_zoom_is_min (EogScrollView *view);
+gboolean eog_scroll_view_get_zoom_is_max (EogScrollView *view);
+void eog_scroll_view_show_cursor (EogScrollView *view);
+void eog_scroll_view_hide_cursor (EogScrollView *view);
+
G_END_DECLS
#endif /* _EOG_SCROLL_VIEW_H_ */
diff --git a/src/eog-window.c b/src/eog-window.c
index 15c88b4..7741a46 100644
--- a/src/eog-window.c
+++ b/src/eog-window.c
@@ -33,12 +33,6 @@
#include "eog-window.h"
#include "eog-scroll-view.h"
-#include "eog-view.h"
-#ifdef WITH_CLUTTER_BACKEND
-#include "eog-clutter-view.h"
-#else
-#include "eog-scroll-view.h"
-#endif
#include "eog-debug.h"
#include "eog-file-chooser.h"
#include "eog-thumb-view.h"
@@ -70,9 +64,6 @@
#include <gdk/gdkkeysyms.h>
#include <gtk/gtk.h>
#include <gconf/gconf-client.h>
-#ifdef WITH_HILDON_UI
-#include <hildon/hildon.h>
-#endif
#if HAVE_LCMS
#include <X11/Xlib.h>
@@ -86,11 +77,7 @@
#define EOG_WINDOW_GET_PRIVATE(object) \
(G_TYPE_INSTANCE_GET_PRIVATE ((object), EOG_TYPE_WINDOW, EogWindowPrivate))
-#ifdef WITH_HILDON_UI
-G_DEFINE_TYPE (EogWindow, eog_window, HILDON_TYPE_STACKABLE_WINDOW);
-#else
G_DEFINE_TYPE (EogWindow, eog_window, GTK_TYPE_WINDOW);
-#endif
#define EOG_WINDOW_MIN_WIDTH 440
#define EOG_WINDOW_MIN_HEIGHT 350
@@ -252,14 +239,14 @@ eog_window_interp_in_type_changed_cb (GConfClient *client,
priv = EOG_WINDOW (user_data)->priv;
- g_return_if_fail (EOG_IS_VIEW (priv->view));
+ g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
if (entry->value != NULL && entry->value->type == GCONF_VALUE_BOOL) {
interpolate_in = gconf_value_get_bool (entry->value);
}
- eog_view_set_antialiasing_in (EOG_VIEW (priv->view),
- interpolate_in);
+ eog_scroll_view_set_antialiasing_in (EOG_SCROLL_VIEW (priv->view),
+ interpolate_in);
}
static void
@@ -277,14 +264,14 @@ eog_window_interp_out_type_changed_cb (GConfClient *client,
priv = EOG_WINDOW (user_data)->priv;
- g_return_if_fail (EOG_IS_VIEW (priv->view));
+ g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
if (entry->value != NULL && entry->value->type == GCONF_VALUE_BOOL) {
interpolate_out = gconf_value_get_bool (entry->value);
}
- eog_view_set_antialiasing_out (EOG_VIEW (priv->view),
- interpolate_out);
+ eog_scroll_view_set_antialiasing_out (EOG_SCROLL_VIEW (priv->view),
+ interpolate_out);
}
static void
@@ -302,13 +289,13 @@ eog_window_scroll_wheel_zoom_changed_cb (GConfClient *client,
priv = EOG_WINDOW (user_data)->priv;
- g_return_if_fail (EOG_IS_VIEW (priv->view));
+ g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
if (entry->value != NULL && entry->value->type == GCONF_VALUE_BOOL) {
scroll_wheel_zoom = gconf_value_get_bool (entry->value);
}
- eog_view_set_scroll_wheel_zoom (EOG_VIEW (priv->view),
+ eog_scroll_view_set_scroll_wheel_zoom (EOG_SCROLL_VIEW (priv->view),
scroll_wheel_zoom);
}
@@ -327,13 +314,13 @@ eog_window_zoom_multiplier_changed_cb (GConfClient *client,
priv = EOG_WINDOW (user_data)->priv;
- g_return_if_fail (EOG_IS_VIEW (priv->view));
+ g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
if (entry->value != NULL && entry->value->type == GCONF_VALUE_FLOAT) {
multiplier = gconf_value_get_float (entry->value);
}
- eog_view_set_zoom_multiplier (EOG_VIEW (priv->view),
+ eog_scroll_view_set_zoom_multiplier (EOG_SCROLL_VIEW (priv->view),
multiplier);
}
@@ -352,7 +339,7 @@ eog_window_transparency_changed_cb (GConfClient *client,
priv = EOG_WINDOW (user_data)->priv;
- g_return_if_fail (EOG_IS_VIEW (priv->view));
+ g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
if (entry->value != NULL && entry->value->type == GCONF_VALUE_STRING) {
value = gconf_value_get_string (entry->value);
@@ -367,15 +354,15 @@ eog_window_transparency_changed_cb (GConfClient *client,
color_str = gconf_client_get_string (priv->client,
EOG_CONF_VIEW_TRANS_COLOR, NULL);
if (gdk_color_parse (color_str, &color)) {
- eog_view_set_transparency (EOG_VIEW (priv->view),
+ eog_scroll_view_set_transparency (EOG_SCROLL_VIEW (priv->view),
EOG_TRANSP_COLOR, &color);
}
g_free (color_str);
} else if (g_ascii_strcasecmp (value, "CHECK_PATTERN") == 0) {
- eog_view_set_transparency (EOG_VIEW (priv->view),
+ eog_scroll_view_set_transparency (EOG_SCROLL_VIEW (priv->view),
EOG_TRANSP_CHECKED, NULL);
} else {
- eog_view_set_transparency (EOG_VIEW (priv->view),
+ eog_scroll_view_set_transparency (EOG_SCROLL_VIEW (priv->view),
EOG_TRANSP_BACKGROUND, NULL);
}
}
@@ -397,7 +384,7 @@ eog_window_trans_color_changed_cb (GConfClient *client,
priv = EOG_WINDOW (user_data)->priv;
- g_return_if_fail (EOG_IS_VIEW (priv->view));
+ g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
value = gconf_client_get_string (priv->client,
EOG_CONF_VIEW_TRANSPARENCY,
@@ -412,7 +399,7 @@ eog_window_trans_color_changed_cb (GConfClient *client,
color_str = gconf_value_get_string (entry->value);
if (gdk_color_parse (color_str, &color)) {
- eog_view_set_transparency (EOG_VIEW (priv->view),
+ eog_scroll_view_set_transparency (EOG_SCROLL_VIEW (priv->view),
EOG_TRANSP_COLOR, &color);
}
}
@@ -434,7 +421,7 @@ eog_window_scroll_buttons_changed_cb (GConfClient *client,
priv = EOG_WINDOW (user_data)->priv;
- g_return_if_fail (EOG_IS_VIEW (priv->view));
+ g_return_if_fail (EOG_IS_SCROLL_VIEW (priv->view));
if (entry->value != NULL && entry->value->type == GCONF_VALUE_BOOL) {
show_buttons = gconf_value_get_bool (entry->value);
@@ -763,7 +750,7 @@ update_status_bar (EogWindow *window)
int zoom, width, height;
goffset bytes = 0;
- zoom = floor (100 * eog_view_get_zoom (EOG_VIEW (priv->view)) + 0.5);
+ zoom = floor (100 * eog_scroll_view_get_zoom (EOG_SCROLL_VIEW (priv->view)) + 0.5);
eog_image_get_size (priv->image, &width, &height);
@@ -1093,7 +1080,7 @@ eog_window_display_image (EogWindow *window, EogImage *image)
image_thumb_changed_cb (image, window);
}
- eog_view_set_image (EOG_VIEW (priv->view), image);
+ eog_scroll_view_set_image (EOG_SCROLL_VIEW (priv->view), image);
gtk_window_set_title (GTK_WINDOW (window), eog_image_get_caption (image));
@@ -1521,7 +1508,7 @@ eog_job_load_cb (EogJobLoad *job, gpointer data)
update_status_bar (window);
- eog_view_set_image (EOG_VIEW (priv->view), NULL);
+ eog_scroll_view_set_image (EOG_SCROLL_VIEW (priv->view), NULL);
if (window->priv->status == EOG_WINDOW_STATUS_INIT) {
update_action_groups_state (window);
@@ -1720,47 +1707,9 @@ view_zoom_changed_cb (GtkWidget *widget, double zoom, gpointer user_data)
"ViewZoomOut");
gtk_action_set_sensitive (action_zoom_in,
- !eog_view_get_zoom_is_max (EOG_VIEW (window->priv->view)));
+ !eog_scroll_view_get_zoom_is_max (EOG_SCROLL_VIEW (window->priv->view)));
gtk_action_set_sensitive (action_zoom_out,
- !eog_view_get_zoom_is_min (EOG_VIEW (window->priv->view)));
-}
-
-static void
-eog_window_activate_action (EogWindow *window, gchar *action_name)
-{
- EogWindowPrivate *priv;
- GtkAction *action;
-
- priv = window->priv;
-
- action = gtk_action_group_get_action (priv->actions_collection,
- action_name);
-
- gtk_action_activate (action);
-}
-
-static void
-next_image_cb (GtkWidget *widget, gpointer user_data)
-{
- EogWindow *window;
-
- g_return_if_fail (EOG_IS_WINDOW (user_data));
-
- window = EOG_WINDOW (user_data);
-
- eog_window_activate_action (window, "GoNext");
-}
-
-static void
-previous_image_cb (GtkWidget *widget, gpointer user_data)
-{
- EogWindow *window;
-
- g_return_if_fail (EOG_IS_WINDOW (user_data));
-
- window = EOG_WINDOW (user_data);
-
- eog_window_activate_action (window, "GoPrevious");
+ !eog_scroll_view_get_zoom_is_min (EOG_SCROLL_VIEW (window->priv->view)));
}
static void
@@ -1892,7 +1841,7 @@ fullscreen_timeout_cb (gpointer data)
gtk_widget_hide_all (window->priv->fullscreen_popup);
- eog_view_hide_cursor (EOG_VIEW (window->priv->view));
+ eog_scroll_view_hide_cursor (EOG_SCROLL_VIEW (window->priv->view));
fullscreen_clear_timeout (window);
@@ -1961,7 +1910,7 @@ fullscreen_set_timeout (EogWindow *window)
window->priv->fullscreen_timeout_source = source;
- eog_view_show_cursor (EOG_VIEW (window->priv->view));
+ eog_scroll_view_show_cursor (EOG_SCROLL_VIEW (window->priv->view));
}
static void
@@ -2272,13 +2221,13 @@ eog_window_run_fullscreen (EogWindow *window, gboolean slideshow)
EOG_CONF_FULLSCREEN_UPSCALE,
NULL);
- eog_view_set_zoom_upscale (EOG_VIEW (priv->view),
- upscale);
+ eog_scroll_view_set_zoom_upscale (EOG_SCROLL_VIEW (priv->view),
+ upscale);
gtk_widget_grab_focus (priv->view);
- eog_view_set_bg_color (EOG_VIEW (window->priv->view),
- &(GTK_WIDGET (window)->style->black));
+ eog_scroll_view_set_bg_color (EOG_SCROLL_VIEW (window->priv->view),
+ &(GTK_WIDGET (window)->style->black));
{
GtkStyle *style;
@@ -2352,9 +2301,9 @@ eog_window_stop_fullscreen (EogWindow *window, gboolean slideshow)
g_assert (GTK_IS_WIDGET (menubar));
gtk_widget_show (menubar);
- eog_view_set_zoom_upscale (EOG_VIEW (priv->view), FALSE);
+ eog_scroll_view_set_zoom_upscale (EOG_SCROLL_VIEW (priv->view), FALSE);
- eog_view_set_bg_color (EOG_VIEW (window->priv->view), NULL);
+ eog_scroll_view_set_bg_color (EOG_SCROLL_VIEW (window->priv->view), NULL);
gtk_widget_set_style (window->priv->view->parent, NULL);
gtk_window_unfullscreen (GTK_WINDOW (window));
@@ -2364,7 +2313,7 @@ eog_window_stop_fullscreen (EogWindow *window, gboolean slideshow)
eog_window_update_fullscreen_action (window);
}
- eog_view_show_cursor (EOG_VIEW (priv->view));
+ eog_scroll_view_show_cursor (EOG_SCROLL_VIEW (priv->view));
#ifdef HAVE_DBUS
eog_application_screensaver_enable (EOG_APP);
@@ -3469,7 +3418,7 @@ eog_window_cmd_zoom_in (GtkAction *action, gpointer user_data)
priv = EOG_WINDOW (user_data)->priv;
if (priv->view) {
- eog_view_zoom_in (EOG_VIEW (priv->view), FALSE);
+ eog_scroll_view_zoom_in (EOG_SCROLL_VIEW (priv->view), FALSE);
}
}
@@ -3485,7 +3434,7 @@ eog_window_cmd_zoom_out (GtkAction *action, gpointer user_data)
priv = EOG_WINDOW (user_data)->priv;
if (priv->view) {
- eog_view_zoom_out (EOG_VIEW (priv->view), FALSE);
+ eog_scroll_view_zoom_out (EOG_SCROLL_VIEW (priv->view), FALSE);
}
}
@@ -3501,7 +3450,7 @@ eog_window_cmd_zoom_normal (GtkAction *action, gpointer user_data)
priv = EOG_WINDOW (user_data)->priv;
if (priv->view) {
- eog_view_set_zoom (EOG_VIEW (priv->view), 1.0);
+ eog_scroll_view_set_zoom (EOG_SCROLL_VIEW (priv->view), 1.0);
}
}
@@ -3517,7 +3466,7 @@ eog_window_cmd_zoom_fit (GtkAction *action, gpointer user_data)
priv = EOG_WINDOW (user_data)->priv;
if (priv->view) {
- eog_view_zoom_fit (EOG_VIEW (priv->view));
+ eog_scroll_view_zoom_fit (EOG_SCROLL_VIEW (priv->view));
}
}
@@ -4063,28 +4012,6 @@ eog_window_finish_saving (EogWindow *window)
} while (priv->save_job != NULL);
}
-#ifdef WITH_HILDON_UI
-static GtkWidget *
-get_menu_from_menu_bar (GtkWidget *menu_bar) {
- GtkWidget *main_menu;
- GList *item;
-
- main_menu = gtk_menu_new ();
-
- item = gtk_container_get_children (GTK_CONTAINER (menu_bar));
- while (item) {
- GtkWidget *menu;
-
- menu = GTK_WIDGET (item->data);
- gtk_widget_reparent (menu, main_menu);
-
- item = g_list_next (item);
- }
-
- return main_menu;
-}
-#endif
-
static void
eog_window_construct_ui (EogWindow *window)
{
@@ -4178,6 +4105,8 @@ eog_window_construct_ui (EogWindow *window)
menubar = gtk_ui_manager_get_widget (priv->ui_mgr, "/MainMenu");
g_assert (GTK_IS_WIDGET (menubar));
+ gtk_box_pack_start (GTK_BOX (priv->box), menubar, FALSE, FALSE, 0);
+ gtk_widget_show (menubar);
menuitem = gtk_ui_manager_get_widget (priv->ui_mgr,
"/MainMenu/Image/EditFlipHorizontal");
@@ -4199,23 +4128,6 @@ eog_window_construct_ui (EogWindow *window)
gtk_image_menu_item_set_always_show_image (
GTK_IMAGE_MENU_ITEM (menuitem), TRUE);
-#ifdef WITH_HILDON_UI
- {
- GtkWidget *menu = get_menu_from_menu_bar (menubar);
-
- hildon_window_set_menu(HILDON_WINDOW (window), GTK_MENU (menu));
- }
-#else
- gtk_box_pack_start (GTK_BOX (priv->box), menubar, FALSE, FALSE, 0);
- gtk_widget_show (menubar);
-#endif
-
-#ifdef WITH_HILDON_UI
- priv-> toolbar = gtk_ui_manager_get_widget (priv->ui_mgr,
- "/FullscreenToolbar");
-
- hildon_window_add_toolbar (HILDON_WINDOW (window), GTK_TOOLBAR (priv->toolbar));
-#else
priv->toolbar = GTK_WIDGET
(g_object_new (EGG_TYPE_EDITABLE_TOOLBAR,
"ui-manager", priv->ui_mgr,
@@ -4230,7 +4142,6 @@ eog_window_construct_ui (EogWindow *window)
FALSE,
FALSE,
0);
-#endif
gtk_widget_show (priv->toolbar);
@@ -4254,13 +4165,10 @@ eog_window_construct_ui (EogWindow *window)
gtk_widget_show (priv->cbox);
priv->statusbar = eog_statusbar_new ();
-
-#ifndef WITH_HILDON_UI
gtk_box_pack_end (GTK_BOX (priv->box),
GTK_WIDGET (priv->statusbar),
FALSE, FALSE, 0);
gtk_widget_show (priv->statusbar);
-#endif
priv->image_info_message_cid =
gtk_statusbar_get_context_id (GTK_STATUSBAR (priv->statusbar),
@@ -4296,31 +4204,16 @@ eog_window_construct_ui (EogWindow *window)
G_CALLBACK (eog_window_sidebar_page_removed),
window);
-#ifdef WITH_CLUTTER_BACKEND
- priv->view = eog_clutter_view_new ();
-#else
- priv->view = eog_scroll_view_new ();
-#endif
+ priv->view = eog_scroll_view_new ();
gtk_widget_set_size_request (GTK_WIDGET (priv->view), 100, 100);
-
g_signal_connect (G_OBJECT (priv->view),
"zoom_changed",
G_CALLBACK (view_zoom_changed_cb),
window);
- g_signal_connect (G_OBJECT (priv->view),
- "next_image",
- G_CALLBACK (next_image_cb),
- window);
-
- g_signal_connect (G_OBJECT (priv->view),
- "previous_image",
- G_CALLBACK (previous_image_cb),
- window);
-
view_popup = gtk_ui_manager_get_widget (priv->ui_mgr, "/ViewPopup");
- eog_view_set_popup (EOG_VIEW (priv->view),
- GTK_MENU (view_popup));
+ eog_scroll_view_set_popup (EOG_SCROLL_VIEW (priv->view),
+ GTK_MENU (view_popup));
frame = gtk_widget_new (GTK_TYPE_FRAME,
"shadow-type", GTK_SHADOW_IN,
@@ -4338,6 +4231,8 @@ eog_window_construct_ui (EogWindow *window)
TRUE,
FALSE);
+ gtk_widget_show_all (hpaned);
+
gtk_box_pack_start (GTK_BOX (priv->layout), hpaned, TRUE, TRUE, 0);
priv->thumbview = eog_thumb_view_new ();
@@ -4363,7 +4258,6 @@ eog_window_construct_ui (EogWindow *window)
gtk_box_pack_end (GTK_BOX (priv->cbox), priv->layout, TRUE, TRUE, 0);
- gtk_widget_show_all (hpaned);
entry = gconf_client_get_entry (priv->client,
EOG_CONF_VIEW_EXTRAPOLATE,
@@ -4771,7 +4665,7 @@ eog_window_key_press (GtkWidget *widget, GdkEventKey *event)
break;
} /* else fall-trough is intended */
case GDK_Up:
- if (eog_view_scrollbars_visible (EOG_VIEW (EOG_WINDOW (widget)->priv->view))) {
+ if (eog_scroll_view_scrollbars_visible (EOG_SCROLL_VIEW (EOG_WINDOW (widget)->priv->view))) {
/* break to let scrollview handle the key */
break;
}
@@ -4802,7 +4696,7 @@ eog_window_key_press (GtkWidget *widget, GdkEventKey *event)
break;
} /* else fall-trough is intended */
case GDK_Down:
- if (eog_view_scrollbars_visible (EOG_VIEW (EOG_WINDOW (widget)->priv->view))) {
+ if (eog_scroll_view_scrollbars_visible (EOG_SCROLL_VIEW (EOG_WINDOW (widget)->priv->view))) {
/* break to let scrollview handle the key */
break;
}
@@ -4822,7 +4716,7 @@ eog_window_key_press (GtkWidget *widget, GdkEventKey *event)
break;
}
case GDK_Page_Up:
- if (!eog_view_scrollbars_visible (EOG_VIEW (EOG_WINDOW (widget)->priv->view))) {
+ if (!eog_scroll_view_scrollbars_visible (EOG_SCROLL_VIEW (EOG_WINDOW (widget)->priv->view))) {
if (!GTK_WIDGET_VISIBLE (EOG_WINDOW (widget)->priv->nav)) {
/* If the iconview is not visible skip to the
* previous image manually as it won't handle
@@ -4835,7 +4729,7 @@ eog_window_key_press (GtkWidget *widget, GdkEventKey *event)
}
break;
case GDK_Page_Down:
- if (!eog_view_scrollbars_visible (EOG_VIEW (EOG_WINDOW (widget)->priv->view))) {
+ if (!eog_scroll_view_scrollbars_visible (EOG_SCROLL_VIEW (EOG_WINDOW (widget)->priv->view))) {
if (!GTK_WIDGET_VISIBLE (EOG_WINDOW (widget)->priv->nav)) {
/* If the iconview is not visible skip to the
* next image manually as it won't handle
@@ -5492,7 +5386,7 @@ eog_window_reload_image (EogWindow *window)
window->priv->image = NULL;
view = eog_window_get_view (window);
- eog_view_set_image (EOG_VIEW (view), NULL);
+ eog_scroll_view_set_image (EOG_SCROLL_VIEW (view), NULL);
eog_thumb_view_select_single (EOG_THUMB_VIEW (window->priv->thumbview),
EOG_THUMB_VIEW_SELECT_CURRENT);
diff --git a/src/eog-window.h b/src/eog-window.h
index f125646..d5839ec 100644
--- a/src/eog-window.h
+++ b/src/eog-window.h
@@ -34,7 +34,6 @@
#include <glib.h>
#include <glib-object.h>
#include <gtk/gtk.h>
-#include <hildon/hildon.h>
G_BEGIN_DECLS
@@ -76,21 +75,13 @@ typedef enum {
} EogStartupFlags;
struct _EogWindow {
-#ifdef WITH_HILDON_UI
- HildonStackableWindow win;
-#else
GtkWindow win;
-#endif
EogWindowPrivate *priv;
};
struct _EogWindowClass {
-#ifdef WITH_HILDON_UI
- HildonStackableWindowClass parent_class;
-#else
GtkWindowClass parent_class;
-#endif
void (* prepared) (EogWindow *window);
};
diff --git a/src/main.c b/src/main.c
index ca5da0d..f1e746d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -47,9 +47,6 @@
#if HAVE_EXEMPI
#include <exempi/xmp.h>
#endif
-#ifdef WITH_CLUTTER_BACKEND
-#include <clutter/clutter.h>
-#endif
static EogStartupFlags flags;
@@ -219,14 +216,6 @@ main (int argc, char **argv)
}
#endif /* HAVE_DBUS */
-#ifdef WITH_CLUTTER_BACKEND
- gtk_clutter_init (&argc, &argv);
-#endif
-
-#if WITH_HILDON_UI
- hildon_init ();
-#endif
-
#ifdef HAVE_EXEMPI
xmp_init();
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]