Commit c83cda4e authored by Lucas Rocha's avatar Lucas Rocha Committed by Lucas Almeida Rocha

new "Fullscreen with double-click" plugin. Fixes bug #478695.

2007-11-13  Lucas Rocha  <lucasr@gnome.org>

	* reload/eog-reload-plugin.c, reload/eog-reload-plugin.h,
	reload/reload.eog-plugin.desktop.in, reload/Makefile.am, configure.ac: 
	new "Fullscreen with double-click" plugin. Fixes bug #478695.

svn path=/trunk/; revision=8
parent 2a0cf427
2007-11-13 Lucas Rocha <lucasr@gnome.org>
* reload/eog-reload-plugin.c, reload/eog-reload-plugin.h,
reload/reload.eog-plugin.desktop.in, reload/Makefile.am, configure.ac:
new "Fullscreen with double-click" plugin. Fixes bug #478695.
2007-11-13 Lucas Rocha <lucasr@gnome.org>
* reload/eog-reload-plugin.c, reload/eog-reload-plugin.h,
......
......@@ -66,9 +66,9 @@ EOG_HAS_PYTHON=1
AC_MSG_CHECKING([which plugins to build])
ALL_PLUGINS="postr reload"
USEFUL_PLUGINS="postr reload"
DEFAULT_PLUGINS="postr reload"
ALL_PLUGINS="postr reload fullscreen"
USEFUL_PLUGINS="postr reload fullscreen"
DEFAULT_PLUGINS="postr reload fullscreen"
PYTHON_ALL_PLUGINS=""
PYTHON_USEFUL_PLUGINS=""
......@@ -88,7 +88,7 @@ fi
AC_ARG_WITH([plugins],
[ --with-plugins=plugin1,plugin2,...
build the specified plugins. Available:
postr, reload, as well as the aliases default,
postr, reload, fullscreen, as well as the aliases default,
all, and really-all],
[plugins=$with_plugins],
[plugins="default"])
......@@ -311,6 +311,7 @@ Makefile
plugins/Makefile
plugins/postr/Makefile
plugins/reload/Makefile
plugins/fullscreen/Makefile
po/Makefile.in])
AC_OUTPUT
......
# Postr plugin
plugindir = $(libdir)/eog/plugins
INCLUDES = \
-I$(top_srcdir) \
$(EOG_CFLAGS) \
$(WARN_CFLAGS) \
-DEOG_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
plugin_LTLIBRARIES = libfullscreen.la
libfullscreen_la_SOURCES = \
eog-fullscreen-plugin.h \
eog-fullscreen-plugin.c
libfullscreen_la_LDFLAGS = \
$(PLUGIN_LIBTOOL_FLAGS) \
$(EOG_LIBS)
# Plugin Info
plugin_in_files = fullscreen.eog-plugin.desktop.in
%.eog-plugin: %.eog-plugin.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*po) ; $(INTLTOOL_MERGE) $(top_srcdir)/po $< $@ -d -u -c $(top_builddir)/po/.intltool-merge-cache
plugin_DATA = $(plugin_in_files:.eog-plugin.desktop.in=.eog-plugin)
EXTRA_DIST = $(plugin_in_files)
CLEANFILES = $(plugin_DATA)
DISTCLEANFILES = $(plugin_DATA)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "eog-fullscreen-plugin.h"
#include <gmodule.h>
#include <glib/gi18n-lib.h>
#include <eog/eog-debug.h>
#include <eog/eog-scroll-view.h>
#define WINDOW_DATA_KEY "EogFullscreenWindowData"
EOG_PLUGIN_REGISTER_TYPE(EogFullscreenPlugin, eog_fullscreen_plugin)
typedef struct
{
gulong signal_id;
} WindowData;
static gboolean
on_button_press (GtkWidget *button, GdkEventButton *event, EogWindow *window)
{
if (event->button == 1 && event->type == GDK_2BUTTON_PRESS) {
EogWindowMode mode = eog_window_get_mode (window);
if (mode == EOG_WINDOW_MODE_SLIDESHOW ||
mode == EOG_WINDOW_MODE_FULLSCREEN)
eog_window_set_mode (window, EOG_WINDOW_MODE_NORMAL);
else if (mode == EOG_WINDOW_MODE_NORMAL)
eog_window_set_mode (window, EOG_WINDOW_MODE_FULLSCREEN);
return TRUE;
}
return FALSE;
}
static void
free_window_data (WindowData *data)
{
g_return_if_fail (data != NULL);
eog_debug (DEBUG_PLUGINS);
g_free (data);
}
static void
eog_fullscreen_plugin_init (EogFullscreenPlugin *plugin)
{
eog_debug_message (DEBUG_PLUGINS, "EogFullscreenPlugin initializing");
}
static void
eog_fullscreen_plugin_finalize (GObject *object)
{
eog_debug_message (DEBUG_PLUGINS, "EogFullscreenPlugin finalizing");
G_OBJECT_CLASS (eog_fullscreen_plugin_parent_class)->finalize (object);
}
static void
impl_activate (EogPlugin *plugin,
EogWindow *window)
{
GtkWidget *view = eog_window_get_view (window);
WindowData *data;
eog_debug (DEBUG_PLUGINS);
data = g_new (WindowData, 1);
data->signal_id = g_signal_connect (G_OBJECT (view),
"button-press-event",
G_CALLBACK (on_button_press),
window);
g_object_set_data_full (G_OBJECT (window),
WINDOW_DATA_KEY,
data,
(GDestroyNotify) free_window_data);
}
static void
impl_deactivate (EogPlugin *plugin,
EogWindow *window)
{
GtkWidget *view = eog_window_get_view (window);
WindowData *data;
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
g_signal_handler_disconnect (view, data->signal_id);
g_object_set_data (G_OBJECT (window),
WINDOW_DATA_KEY,
NULL);
}
static void
impl_update_ui (EogPlugin *plugin,
EogWindow *window)
{
}
static void
eog_fullscreen_plugin_class_init (EogFullscreenPluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
EogPluginClass *plugin_class = EOG_PLUGIN_CLASS (klass);
object_class->finalize = eog_fullscreen_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;
plugin_class->update_ui = impl_update_ui;
}
#ifndef __EOG_FULLSCREEN_PLUGIN_H__
#define __EOG_FULLSCREEN_PLUGIN_H__
#include <glib.h>
#include <glib-object.h>
#include <eog/eog-plugin.h>
G_BEGIN_DECLS
/*
* Type checking and casting macros
*/
#define EOG_TYPE_FULLSCREEN_PLUGIN (eog_fullscreen_plugin_get_type ())
#define EOG_FULLSCREEN_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EOG_TYPE_FULLSCREEN_PLUGIN, EogFullscreenPlugin))
#define EOG_FULLSCREEN_PLUGIN_CLASS(k) G_TYPE_CHECK_CLASS_CAST((k), EOG_TYPE_FULLSCREEN_PLUGIN, EogFullscreenPluginClass))
#define EOG_IS_FULLSCREEN_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOG_TYPE_FULLSCREEN_PLUGIN))
#define EOG_IS_FULLSCREEN_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EOG_TYPE_FULLSCREEN_PLUGIN))
#define EOG_FULLSCREEN_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EOG_TYPE_FULLSCREEN_PLUGIN, EogFullscreenPluginClass))
/* Private structure type */
typedef struct _EogFullscreenPluginPrivate EogFullscreenPluginPrivate;
/*
* Main object structure
*/
typedef struct _EogFullscreenPlugin EogFullscreenPlugin;
struct _EogFullscreenPlugin
{
EogPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _EogFullscreenPluginClass EogFullscreenPluginClass;
struct _EogFullscreenPluginClass
{
EogPluginClass parent_class;
};
/*
* Public methods
*/
GType eog_fullscreen_plugin_get_type (void) G_GNUC_CONST;
/* All the plugins must implement this function */
G_MODULE_EXPORT GType register_eog_plugin (GTypeModule *module);
G_END_DECLS
#endif /* __EOG_FULLSCREEN_PLUGIN_H__ */
[Eog Plugin]
Module=fullscreen
IAge=2
_Name=Fullscreen with double-click
Icon=gtk-fullscreen
_Description=Activate fullscreen mode with double-click
Authors=Lucas Rocha <lucasr@gnome.org>
Copyright=Copyright © 2007 Lucas Rocha
Website=http://www.gnome.org/projects/eog
......@@ -2,3 +2,5 @@ plugins/postr/postr.eog-plugin.desktop.in
plugins/postr/eog-postr-plugin.c
plugins/reload/reload.eog-plugin.desktop.in
plugins/reload/eog-reload-plugin.c
plugins/fullscreen/fullscreen.eog-plugin.desktop.in
plugins/fullscreen/eog-fullscreen-plugin.c
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment