Commit 67e2f4e1 authored by Lucas Rocha's avatar Lucas Rocha Committed by Lucas Almeida Rocha

moved fullscreen and reload to main eog module as default plugins.

2008-03-17  Lucas Rocha  <lucasr@gnome.org>

	* configure.ac, plugins/Makefile.am, plugins/fullscreen/*,
	plugins/reload/*: moved fullscreen and reload to main eog
	module as default plugins.

svn path=/trunk/; revision=29
parent db0f7985
2008-03-17 Lucas Rocha <lucasr@gnome.org>
* configure.ac, plugins/Makefile.am, plugins/fullscreen/*,
plugins/reload/*: moved fullscreen and reload to main eog
module as default plugins.
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 fullscreen"
USEFUL_PLUGINS="postr reload fullscreen"
DEFAULT_PLUGINS="postr reload fullscreen"
ALL_PLUGINS="postr"
USEFUL_PLUGINS="postr"
DEFAULT_PLUGINS="postr"
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, fullscreen, as well as the aliases default,
postr, as well as the aliases default,
all, and really-all],
[plugins=$with_plugins],
[plugins="default"])
......@@ -310,8 +310,6 @@ AC_CONFIG_FILES([
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
# Postr plugin
plugindir = $(libdir)/eog/plugins
INCLUDES = \
-I$(top_srcdir) \
$(EOG_CFLAGS) \
$(WARN_CFLAGS) \
-DEOG_LOCALEDIR=\""$(prefix)/$(DATADIRNAME)/locale"\"
plugin_LTLIBRARIES = libreload.la
libreload_la_SOURCES = \
eog-reload-plugin.h \
eog-reload-plugin.c
libreload_la_LDFLAGS = \
$(PLUGIN_LIBTOOL_FLAGS) \
$(EOG_LIBS)
# Plugin Info
plugin_in_files = reload.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-reload-plugin.h"
#include <gmodule.h>
#include <glib/gi18n-lib.h>
#include <eog/eog-debug.h>
#include <eog/eog-scroll-view.h>
#include <eog/eog-thumb-view.h>
#include <eog/eog-image.h>
#define WINDOW_DATA_KEY "EogReloadWindowData"
/*#define MENU_PATH "/MainMenu/ImageMenu/Reload"*/
#define MENU_PATH "/MainMenu/ToolsMenu/ToolsOps_3"
EOG_PLUGIN_REGISTER_TYPE(EogReloadPlugin, eog_reload_plugin)
typedef struct
{
GtkActionGroup *ui_action_group;
guint ui_id;
} WindowData;
static void
reload_cb (GtkAction *action,
EogWindow *window)
{
static EogImage *current_image = NULL;
GtkWidget *thumbview = eog_window_get_thumb_view (window);
GtkWidget *view = eog_window_get_view (window);
eog_scroll_view_set_image (EOG_SCROLL_VIEW (view), NULL);
/* Re-select current image in order to trigger the image reload */
eog_thumb_view_select_single (EOG_THUMB_VIEW (thumbview),
EOG_THUMB_VIEW_SELECT_CURRENT);
}
static const GtkActionEntry action_entries[] =
{
{ "RunReload",
GTK_STOCK_REFRESH,
N_("Reload Image"),
"<control><shift>R",
N_("Reload current image"),
G_CALLBACK (reload_cb) }
};
static void
free_window_data (WindowData *data)
{
g_return_if_fail (data != NULL);
eog_debug (DEBUG_PLUGINS);
g_object_unref (data->ui_action_group);
g_free (data);
}
static void
eog_reload_plugin_init (EogReloadPlugin *plugin)
{
eog_debug_message (DEBUG_PLUGINS, "EogReloadPlugin initializing");
}
static void
eog_reload_plugin_finalize (GObject *object)
{
eog_debug_message (DEBUG_PLUGINS, "EogReloadPlugin finalizing");
G_OBJECT_CLASS (eog_reload_plugin_parent_class)->finalize (object);
}
static void
impl_activate (EogPlugin *plugin,
EogWindow *window)
{
GtkUIManager *manager;
GList *action_groups, i;
WindowData *data;
eog_debug (DEBUG_PLUGINS);
data = g_new (WindowData, 1);
manager = eog_window_get_ui_manager (window);
action_groups = gtk_ui_manager_get_action_groups (manager);
data->ui_action_group = gtk_action_group_new ("EogReloadPluginActions");
gtk_action_group_set_translation_domain (data->ui_action_group,
GETTEXT_PACKAGE);
gtk_action_group_add_actions (data->ui_action_group,
action_entries,
G_N_ELEMENTS (action_entries),
window);
gtk_ui_manager_insert_action_group (manager,
data->ui_action_group,
-1);
data->ui_id = gtk_ui_manager_new_merge_id (manager);
g_object_set_data_full (G_OBJECT (window),
WINDOW_DATA_KEY,
data,
(GDestroyNotify) free_window_data);
gtk_ui_manager_add_ui (manager,
data->ui_id,
MENU_PATH,
"RunReload",
"RunReload",
GTK_UI_MANAGER_MENUITEM,
FALSE);
}
static void
impl_deactivate (EogPlugin *plugin,
EogWindow *window)
{
GtkUIManager *manager;
WindowData *data;
eog_debug (DEBUG_PLUGINS);
manager = eog_window_get_ui_manager (window);
data = (WindowData *) g_object_get_data (G_OBJECT (window),
WINDOW_DATA_KEY);
g_return_if_fail (data != NULL);
gtk_ui_manager_remove_ui (manager,
data->ui_id);
gtk_ui_manager_remove_action_group (manager,
data->ui_action_group);
g_object_set_data (G_OBJECT (window),
WINDOW_DATA_KEY,
NULL);
}
static void
impl_update_ui (EogPlugin *plugin,
EogWindow *window)
{
}
static void
eog_reload_plugin_class_init (EogReloadPluginClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
EogPluginClass *plugin_class = EOG_PLUGIN_CLASS (klass);
object_class->finalize = eog_reload_plugin_finalize;
plugin_class->activate = impl_activate;
plugin_class->deactivate = impl_deactivate;
plugin_class->update_ui = impl_update_ui;
}
#ifndef __EOG_RELOAD_PLUGIN_H__
#define __EOG_RELOAD_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_RELOAD_PLUGIN (eog_reload_plugin_get_type ())
#define EOG_RELOAD_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), EOG_TYPE_RELOAD_PLUGIN, EogReloadPlugin))
#define EOG_RELOAD_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), EOG_TYPE_RELOAD_PLUGIN, EogReloadPluginClass))
#define EOG_IS_RELOAD_PLUGIN(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), EOG_TYPE_RELOAD_PLUGIN))
#define EOG_IS_RELOAD_PLUGIN_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), EOG_TYPE_RELOAD_PLUGIN))
#define EOG_RELOAD_PLUGIN_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), EOG_TYPE_RELOAD_PLUGIN, EogReloadPluginClass))
/* Private structure type */
typedef struct _EogReloadPluginPrivate EogReloadPluginPrivate;
/*
* Main object structure
*/
typedef struct _EogReloadPlugin EogReloadPlugin;
struct _EogReloadPlugin
{
EogPlugin parent_instance;
};
/*
* Class definition
*/
typedef struct _EogReloadPluginClass EogReloadPluginClass;
struct _EogReloadPluginClass
{
EogPluginClass parent_class;
};
/*
* Public methods
*/
GType eog_reload_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_RELOAD_PLUGIN_H__ */
[Eog Plugin]
Module=reload
IAge=2
_Name=Reload Image
Icon=gtk-refresh
_Description=Reload current image
Authors=Lucas Rocha <lucasr@gnome.org>
Copyright=Copyright © 2007 Lucas Rocha
Website=http://www.gnome.org/projects/eog
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