Commit 7e668edf authored by Alexander Larsson's avatar Alexander Larsson Committed by Alexander Larsson

eel/ Import eel into nautilus.

2008-12-15  Alexander Larsson  <alexl@redhat.com>

        * Makefile.am:
        * acconfig.h:
        * configure.in:
	* eel/
        * libnautilus-private/Makefile.am:
	Import eel into nautilus.


svn path=/trunk/; revision=14815
parent d4b4c188
2008-12-15 Alexander Larsson <alexl@redhat.com>
* Makefile.am:
* acconfig.h:
* configure.in:
* eel/
* libnautilus-private/Makefile.am:
Import eel into nautilus.
2008-12-15 Matthias Clasen <mclasen@redhat.com>
Bug 564207 – don't look for old kde trash
......
......@@ -14,6 +14,7 @@ desktop_in_files = \
nautilus-autorun-software.desktop.in
SUBDIRS = \
eel \
libnautilus-extension \
cut-n-paste-code \
libnautilus-private \
......
......@@ -24,3 +24,4 @@
#undef HAVE_STARTUP_NOTIFICATION
#undef HAVE_EXIF
#undef HAVE_OLD_EXIF
#undef HAVE_RENDER
AC_PREREQ(2.54)
oAC_PREREQ(2.54)
dnl ===========================================================================
m4_define(eel_minver, 2.25.1)
m4_define(glib_minver, 2.19.0)
m4_define(gnome_desktop_minver, 2.9.91)
m4_define(pango_minver, 1.1.2)
......@@ -13,6 +12,8 @@ m4_define(beagle_minver, 0.2.4)
m4_define(tracker_minver, 0.0.1)
m4_define(exempi_minver, 1.99.2)
m4_define(exempi_minver_newapi, 1.99.5)
m4_define(gail_minver, 0.16)
dnl 1. If the library code has changed at all since last release, then increment revision.
dnl 2. If any interfaces have been added, then increment current and set revision to 0.
......@@ -32,12 +33,12 @@ AM_INIT_AUTOMAKE([1.9 tar-ustar])
AM_MAINTAINER_MODE
AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])
AC_SUBST(EEL_REQUIRED, [eel_minver])
AC_SUBST(GLIB_REQUIRED, [glib_minver])
AC_SUBST(GNOME_DESKTOP_REQUIRED, [gnome_desktop_minver])
AC_SUBST(PANGO_REQUIRED, [pango_minver])
AC_SUBST(GTK_REQUIRED, [gtk_minver])
AC_SUBST(XML_REQUIRED, [xml_minver])
AC_SUBST(GAIL_REQUIRED)
dnl We need to decrement current by one in the calculation of the age because
dnl the library was started with version "1:0:0" instead of "0:0:0"
......@@ -56,7 +57,6 @@ AM_PROG_LIBTOOL
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
PKG_CHECK_MODULES(ALL, [
eel-2.0 >= eel_minver
glib-2.0 >= glib_minver
gnome-desktop-2.0 >= gnome_desktop_minver
gio-unix-2.0
......@@ -64,6 +64,7 @@ PKG_CHECK_MODULES(ALL, [
pango >= pango_minver
gtk+-2.0 >= gtk_minver
libxml-2.0 >= xml_minver
gail >= gail_minver
unique-1.0
dbus-glib-1
])
......@@ -104,6 +105,7 @@ AM_CONDITIONAL(ENABLE_PROFILER, test "x$ENABLE_PROFILER" = "x1")
dnl ==========================================================================
AC_CHECK_PROGS(PERL, perl5 perl)
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
dnl ==========================================================================
......@@ -370,6 +372,45 @@ else
AC_MSG_RESULT(no)
fi
dnl ===========================================================================
dnl strftime checks
AC_TRY_RUN([#include <time.h>
int main ()
{
char buf[100];
struct tm tm = {0};
tm.tm_year = 99;
if (strftime(buf, 100, "%EY", &tm) == 4 &&
strcmp (buf, "1999")==0)
return 0;
return 1;
}
],
AC_DEFINE(HAVE_STRFTIME_EXTENSION, 1, [Define if strftime supports %E and %O modifiers.])
)
dnl ===========================================================================
#
# Checks for Xft/XRender
#
have_render=false
RENDER_LIBS=""
AC_CHECK_LIB(Xrender, XRenderFindFormat,
have_render=true,:,-lXext)
if $have_render ; then
RENDER_LIBS="-lXrender -lXext"
AC_DEFINE(HAVE_RENDER)
fi
AC_SUBST(RENDER_LIBS)
dnl ==========================================================================
dnl libegg
......@@ -386,7 +427,7 @@ LIBNAUTILUS_EXTENSION_LIBS="`$PKG_CONFIG --libs $LIBNAUTILUS_EXTENSION_MODULES`"
AC_SUBST(LIBNAUTILUS_EXTENSION_LIBS)
dnl core nautilus
CORE_MODULES="glib-2.0 eel-2.0 gnome-desktop-2.0 gio-2.0 gio-unix-2.0 unique-1.0 dbus-glib-1 $EXTRA_CORE_MODULES"
CORE_MODULES="glib-2.0 gnome-desktop-2.0 gio-2.0 gio-unix-2.0 unique-1.0 dbus-glib-1 gail gconf-2.0 libxml-2.0 $EXTRA_CORE_MODULES"
CORE_CFLAGS="`$PKG_CONFIG --cflags $CORE_MODULES` $x_cflags $WARNING_CFLAGS"
AC_SUBST(CORE_CFLAGS)
CORE_LIBS="`$PKG_CONFIG --libs $CORE_MODULES` $x_libs"
......@@ -454,6 +495,8 @@ docs/Makefile
docs/reference/Makefile
docs/reference/libnautilus-extension/Makefile
docs/reference/libnautilus-extension/version.xml
eel/Makefile
eel/eel-features.h
icons/Makefile
libnautilus-private/Makefile
libnautilus-extension/Makefile
......
This diff is collapsed.
NULL=
noinst_LTLIBRARIES=libeel-2.la
INCLUDES = \
-DG_LOG_DOMAIN=\"Eel\" \
-I$(top_srcdir) \
$(CORE_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DSOURCE_DATADIR=\""$(top_srcdir)/data"\" \
-DGNOMELOCALEDIR=\""$(prefix)/${DATADIRNAME}/locale"\" \
-DG_DISABLE_DEPRECATED \
-DGDK_DISABLE_DEPRECATED \
-DGDK_PIXBUF_DISABLE_DEPRECATED \
-DGMENU_I_KNOW_THIS_IS_UNSTABLE \
$(NULL)
libeel_2_la_LDFLAGS = \
-version-info @EEL_VERSION_INFO@ \
-no-undefined \
$(CORE_LIBS) \
$(RENDER_LIBS) \
$(X_LIBS) \
$(NULL)
libeel_2_la_SOURCES = \
eel-accessibility.c \
eel-alert-dialog.c \
eel-art-extensions.c \
eel-art-gtk-extensions.c \
eel-background.c \
eel-background-box.c \
eel-canvas.c \
eel-canvas-util.c \
eel-canvas-rect-ellipse.c \
eel-debug-drawing.c \
eel-debug.c \
eel-editable-label.c \
eel-enumeration.c \
eel-gconf-extensions.c \
eel-gdk-extensions.c \
eel-gdk-pixbuf-extensions.c \
eel-glib-extensions.c \
eel-gnome-extensions.c \
eel-graphic-effects.c \
eel-gtk-container.c \
eel-gtk-extensions.c \
eel-i18n.c \
eel-image-table.c \
eel-labeled-image.c \
eel-lib-self-check-functions.c \
eel-pango-extensions.c \
eel-preferences-builder.c \
eel-preferences.c \
eel-self-checks.c \
eel-stock-dialogs.c \
eel-string.c \
eel-types.c \
eel-vfs-extensions.c \
eel-wrap-table.c \
eel-xml-extensions.c \
eel-lib-self-check-functions.h \
$(NULL)
libeelincludedir = $(includedir)/eel-2/eel
eel_headers = \
eel-accessibility.h \
eel-alert-dialog.h \
eel-art-extensions.h \
eel-art-gtk-extensions.h \
eel-background.h \
eel-background-box.h \
eel-canvas.h \
eel-canvas-util.h \
eel-canvas-rect-ellipse.h \
eel-debug-drawing.h \
eel-debug.h \
eel-editable-label.h \
eel-enumeration.h \
eel-gconf-extensions.h \
eel-gdk-extensions.h \
eel-gdk-pixbuf-extensions.h \
eel-glib-extensions.h \
eel-gnome-extensions.h \
eel-graphic-effects.h \
eel-gtk-container.h \
eel-gtk-extensions.h \
eel-gtk-macros.h \
eel-i18n.h \
eel-image-table.h \
eel-labeled-image.h \
eel-pango-extensions.h \
eel-preferences.h \
eel-self-checks.h \
eel-stock-dialogs.h \
eel-string.h \
eel-types.h \
eel-vfs-extensions.h \
eel-wrap-table.h \
eel-xml-extensions.h \
eel.h \
$(NULL)
libeelinclude_HEADERS = \
$(eel_headers) \
eel-type-builtins.h \
eel-marshal.h \
$(NULL)
marshal_sources = \
eel-marshal.h \
eel-marshal.c \
$(NULL)
eel-marshal.h: eelmarshal.list $(GLIB_GENMARSHAL)
$(GLIB_GENMARSHAL) $< --header --prefix=eel_marshal > $@
eel-marshal.c: eelmarshal.list $(GLIB_GENMARSHAL)
$(GLIB_GENMARSHAL) $< --body --prefix=eel_marshal > $@
stamp_sources = \
eel-enums.defs \
eel-type-builtins-evals.c \
$(NULL)
stamps = \
eel-makeenums-stamp \
eel-stamp \
$(NULL)
eel-makeenums-stamp: makeenums.pl $(eel_headers)
$(PERL) $< defs $(filter-out $<,$^) > xgen-eed \
&& (cmp -s xgen-eed eel-enums.defs || mv -f xgen-eed eel-enums.defs) \
&& rm -f xgen-eed \
&& $(PERL) $< arrays $(filter-out $<,$^) > xgen-etbe \
&& (cmp -s xgen-etbe eel-type-builtins-evals.c || mv -f xgen-etbe eel-type-builtins-evals.c) \
&& rm -f xgen-etbe \
&& echo timestamp > $@
maketypes_sources = \
eel-type-builtins.h \
eel-type-builtins-ids.c \
eel-type-builtins-vars.c \
$(NULL)
eel-stamp: eel-makeenums-stamp $(maketypes_sources)
echo timestamp > $@
eel-type-builtins.h: eel-enums.defs maketypes.awk eel-makeenums-stamp
LC_ALL=C $(AWK) -f $(srcdir)/maketypes.awk $< macros > $@
eel-type-builtins-vars.c: eel-enums.defs maketypes.awk eel-makeenums-stamp
LC_ALL=C $(AWK) -f $(srcdir)/maketypes.awk $< variables > $@
eel-type-builtins-ids.c: eel-enums.defs maketypes.awk eel-makeenums-stamp
LC_ALL=C $(AWK) -f $(srcdir)/maketypes.awk $< entries > $@
noinst_PROGRAMS = check-program
check_program_SOURCES = check-program.c
check_program_DEPENDENCIES = libeel-2.la
check_program_LDADD = $(EEL_LIBS)
check_program_LDFLAGS = $(check_program_DEPENDENCIES) -lm
TESTS = check-eel
EXTRA_DIST = \
check-eel \
eelmarshal.list \
makeenums.pl \
maketypes.awk \
$(NULL)
$(libeel_2_la_OBJECTS): $(marshal_sources)
# This trick causes the stamp file to be built first.
Makefile: eel-stamp
# This trick causes the generated files to be built the first time.
$(stamp_sources): # never add any dependencies
test -f $@ || touch $@
built_sources = $(stamps) $(stamp_sources) $(maketypes_sources) $(marshal_sources)
CLEANFILES = $(built_sources)
DONT_DIST_FILES = $(built_sources)
dist-hook:
for file in $(DONT_DIST_FILES) ; do \
rm -f $(distdir)/$$file ; \
done
README for eel/eel
Writeme
eel-canvas is a cut-and-pasted version of some parts foo-canvas.
Please do not change the cut and pasted parts. If you need to
upgrade to a new foo-canvas, use this:
FOODIR=../../foocanvas/libfoocanvas
cp $FOODIR/foo-canvas.c eel-canvas.c
cp $FOODIR/foo-canvas.h eel-canvas.h
cp $FOODIR/foo-canvas-util.c eel-canvas-util.c
cp $FOODIR/foo-canvas-util.h eel-canvas-util.h
cp $FOODIR/foo-canvas-rect-ellipse.h eel-canvas-rect-ellipse.h
cp $FOODIR/foo-canvas-rect-ellipse.c eel-canvas-rect-ellipse.c
perl -pi -e 's/foo_canvas_marshal_/eel_marshal_/s' eel-canvas.c
perl -pi -e 's/foo-canvas-marshal\.h/eel-marshal\.h/s' eel-canvas.c
perl -pi -e 's/#include\ \"foo-canvas-marshal\.c\"//s' eel-canvas.c
perl -pi -e 's/foo-canvas-i18n\.h/eel-i18n\.h/s' eel-canvas.c
perl -pi -e 's/foo_canvas_/eel_canvas_/g' eel-canvas*.[ch]
perl -pi -e 's/FOO_CANVAS/EEL_CANVAS/g' eel-canvas*.[ch]
perl -pi -e 's/FooCanvas/EelCanvas/g' eel-canvas*.[ch]
perl -pi -e 's/foo-canvas/eel-canvas/g' eel-canvas*.[ch]
perl -pi -e 's/libfoocanvas/eel/g' eel-canvas*.[ch]
perl -pi -e 's/FOO_TYPE_/EEL_TYPE_/g' eel-canvas*.[ch]
perl -pi -e 's/FOO_IS_/EEL_IS_/g' eel-canvas*.[ch]
#!/bin/sh
./check-program --g-fatal-warnings --sm-disable
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* check-program.c: A simple driver for eel self checks.
Copyright (C) 2000 Eazel, Inc.
The Gnome Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Gnome Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Gnome Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors: Ramiro Estrugo <ramiro@eazel.com>
*/
#include <config.h>
#include <eel/eel-debug.h>
#include <eel/eel-glib-extensions.h>
#include <eel/eel-lib-self-check-functions.h>
#include <eel/eel-self-checks.h>
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <libxml/parser.h>
#include <stdlib.h>
int
main (int argc, char *argv[])
{
#if !defined (EEL_OMIT_SELF_CHECK)
eel_make_warnings_and_criticals_stop_in_debugger ();
LIBXML_TEST_VERSION
gtk_init (&argc, &argv);
/* Run the checks for eel twice. */
eel_run_lib_self_checks ();
eel_exit_if_self_checks_failed ();
eel_run_lib_self_checks ();
eel_exit_if_self_checks_failed ();
eel_debug_shut_down ();
#endif /* !EEL_OMIT_SELF_CHECK */
return EXIT_SUCCESS;
}
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* eel-accessibility.h - Utility functions for accessibility
Copyright (C) 2002 Anders Carlsson, Sun Microsystems, Inc.
The Eel Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The Eel Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the Eel Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
Authors:
Anders Carlsson <andersca@gnu.org>
Michael Meeks <michael@ximian.com>
*/
#include <config.h>
#include <gtk/gtk.h>
#include <atk/atkrelationset.h>
#include <eel/eel-accessibility.h>
void
eel_accessibility_set_up_label_widget_relation (GtkWidget *label, GtkWidget *widget)
{
AtkObject *atk_widget, *atk_label;
atk_label = gtk_widget_get_accessible (label);
atk_widget = gtk_widget_get_accessible (widget);
/* Create the label -> widget relation */
atk_object_add_relationship (atk_label, ATK_RELATION_LABEL_FOR, atk_widget);
/* Create the widget -> label relation */
atk_object_add_relationship (atk_widget, ATK_RELATION_LABELLED_BY, atk_label);
}
/*
* Hacks to make re-using gail somewhat easier.
*/
/**
* eel_accessibility_create_derived_type:
* @type_name: the name for the new accessible type eg. NautilusIconCanvasItemAccessible
* @existing_gobject_with_proxy: the GType of an object that has a registered factory that
* manufactures the type we want to inherit from. ie. to inherit from a GailCanvasItem
* we need to pass GNOME_TYPE_CANVAS_ITEM - since GailCanvasItem is registered against
* that type.
* @opt_gail_parent_class: the name of the Gail class to derive from eg. GailCanvasItem
* @class_init: the init function to run for this class
*
* This should be run to register the type, it can subsequently be run with
* the same name and will not re-register it, but simply return it.
*
* NB. to do instance init, you prolly want to override AtkObject::initialize
*
* Return value: the registered type, or 0 on failure.
**/
GType
eel_accessibility_create_derived_type (const char *type_name,
GType existing_gobject_with_proxy,
EelAccessibilityClassInitFn class_init)
{
GType type;
GType parent_atk_type;
GTypeInfo tinfo = { 0 };
GTypeQuery query;
AtkObjectFactory *factory;
if ((type = g_type_from_name (type_name))) {
return type;
}
factory = atk_registry_get_factory
(atk_get_default_registry (),
existing_gobject_with_proxy);
if (!factory) {
return G_TYPE_INVALID;
}
parent_atk_type = atk_object_factory_get_accessible_type (factory);
if (!parent_atk_type) {
return G_TYPE_INVALID;
}
/*
* Figure out the size of the class and instance
* we are deriving from
*/
g_type_query (parent_atk_type, &query);
if (class_init) {
tinfo.class_init = (GClassInitFunc) class_init;
}
tinfo.class_size = query.class_size;
tinfo.instance_size = query.instance_size;
/* Register the type */
type = g_type_register_static (
parent_atk_type, type_name, &tinfo, 0);
return type;
}
static GQuark
get_quark_accessible (void)
{
static GQuark quark_accessible_object = 0;
if (!quark_accessible_object) {
quark_accessible_object = g_quark_from_static_string
("accessible-object");
}
return quark_accessible_object;
}
static GQuark
get_quark_gobject (void)
{
static GQuark quark_accessible_gobject = 0;
if (!quark_accessible_gobject) {
quark_accessible_gobject = g_quark_from_static_string
("object-for-accessible");
}
return quark_accessible_gobject;
}
/**
* eel_accessibility_get_atk_object:
* @object: a GObject of some sort
*
* gets an AtkObject associated with a GObject
*
* Return value: the associated accessible if one exists or NULL
**/
AtkObject *
eel_accessibility_get_atk_object (gpointer object)
{
return g_object_get_qdata (object, get_quark_accessible ());
}
/**
* eel_accessibilty_for_object:
* @object: a GObject of some sort
*
* gets an AtkObject associated with a GObject and if it doesn't
* exist creates a suitable accessible object.
*
* Return value: an associated accessible.
**/
AtkObject *
eel_accessibility_for_object (gpointer object)
{
if (GTK_IS_WIDGET (object))
return gtk_widget_get_accessible (object);
return atk_gobject_accessible_for_object (object);
}
/**
* eel_accessibility_get_gobject:
* @object: an AtkObject
*
* gets the GObject associated with the AtkObject, for which
* @object provides accessibility support.
*
* Return value: the accessible's associated GObject
**/
gpointer
eel_accessibility_get_gobject (AtkObject *object)
{
return g_object_get_qdata (G_OBJECT (object), get_quark_gobject ());
}
static void
eel_accessibility_destroy (gpointer data,
GObject *where_the_object_was)
{
atk_object_notify_state_change
(ATK_OBJECT (data), ATK_STATE_DEFUNCT, TRUE);
}
/**
* eel_accessibility_set_atk_object_return:
* @object: a GObject
* @atk_object: it's AtkObject
*
* used to register and return a new accessible object for something
*
* Return value: @atk_object.
**/
AtkObject *
eel_accessibility_set_atk_object_return (gpointer object,
AtkObject *atk_object)
{
atk_object_initialize (atk_object, object);
if (!ATK_IS_GOBJECT_ACCESSIBLE (atk_object)) {
g_object_set_qdata_full
(object, get_quark_accessible (), atk_object,
(GDestroyNotify)eel_accessibility_destroy);
g_object_set_qdata
(G_OBJECT (atk_object), get_quark_gobject (), object);
}
return atk_object;
}
static GailTextUtil *
get_simple_text (gpointer object)
{
GObject *gobject;
EelAccessibleTextIface *aif;
if (GTK_IS_ACCESSIBLE (object)) {
gobject = G_OBJECT (GTK_ACCESSIBLE (object)->widget);
} else {
gobject = eel_accessibility_get_gobject (object);
}
if (!gobject) {
return NULL;
}
aif = EEL_ACCESSIBLE_TEXT_GET_IFACE (gobject);
if (!aif) {
g_warning ("No accessible text inferface on '%s'",
g_type_name_from_instance ((gpointer) gobject));
} else if (aif->get_text) {
return aif->get_text (gobject);
}
return NULL;
}
char *
eel_accessibility_text_get_text (AtkText *text,
gint start_pos,
gint end_pos)
{
GailTextUtil *util = get_simple_text (text);
g_return_val_if_fail (util != NULL, NULL);
return gail_text_util_get_substring (util, start_pos, end_pos);
}
gunichar
eel_accessibility_text_get_character_at_offset (AtkText *text,
gint offset)
{
char *txt, *index;
gint sucks1 = 0, sucks2 = -1;
gunichar c;
GailTextUtil *util = get_simple_text (text);
g_return_val_if_fail (util != NULL, 0);
txt = gail_text_util_get_substring (util, sucks1, sucks2);
index = g_utf8_offset_to_pointer (txt, offset);
c = g_utf8_get_char (index);