[cheese/origin/libcheese-adelaney: 1/2] * reverted previous changes.



commit b0529081e2c0f9a8df0e77d79511cf3f150312c9
Author: Aidan Delaney <a j delaney brighton ac uk>
Date:   Sat Oct 24 18:35:59 2009 +0100

    * reverted previous changes.

 INSTALL                             |  110 +++++----------------------
 Makefile.am                         |    2 +-
 configure.ac                        |    3 +-
 libcheese/Makefile.am               |   22 ------
 src/Makefile.am                     |   20 +++++
 src/cheese-dbus-infos.xml           |    9 ++
 src/cheese-dbus.c                   |  138 +++++++++++++++++++++++++++++++++++
 src/cheese-dbus.h                   |   57 ++++++++++++++
 {libcheese => src}/cheese-gconf.c   |    0
 {libcheese => src}/cheese-gconf.h   |    0
 {libcheese => src}/cheese-webcam.c  |    0
 {libcheese => src}/cheese-webcam.h  |    0
 {libcheese => src}/eog-thumbnail.c  |    0
 {libcheese => src}/eog-thumbnail.h  |    0
 {libcheese => src}/gst-audio-play.c |    0
 {libcheese => src}/gst-audio-play.h |    0
 16 files changed, 247 insertions(+), 114 deletions(-)
---
diff --git a/INSTALL b/INSTALL
index 2550dab..5458714 100644
--- a/INSTALL
+++ b/INSTALL
@@ -2,15 +2,15 @@ Installation Instructions
 *************************
 
 Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
-2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+2006 Free Software Foundation, Inc.
 
-   This file is free documentation; the Free Software Foundation gives
+This file is free documentation; the Free Software Foundation gives
 unlimited permission to copy, distribute and modify it.
 
 Basic Installation
 ==================
 
-   Briefly, the shell commands `./configure; make; make install' should
+Briefly, the shell commands `./configure; make; make install' should
 configure, build, and install this package.  The following
 more-detailed instructions are generic; see the `README' file for
 instructions specific to this package.
@@ -67,15 +67,12 @@ The simplest way to compile this package is:
      all sorts of other programs in order to regenerate files that came
      with the distribution.
 
-  6. Often, you can also type `make uninstall' to remove the installed
-     files again.
-
 Compilers and Options
 =====================
 
-   Some systems require unusual options for compilation or linking that
-the `configure' script does not know about.  Run `./configure --help'
-for details on some of the pertinent environment variables.
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about.  Run `./configure --help' for
+details on some of the pertinent environment variables.
 
    You can give `configure' initial values for configuration parameters
 by setting variables in the command line or in the environment.  Here
@@ -88,7 +85,7 @@ is an example:
 Compiling For Multiple Architectures
 ====================================
 
-   You can compile the package for more than one kind of computer at the
+You can compile the package for more than one kind of computer at the
 same time, by placing the object files for each architecture in their
 own directory.  To do this, you can use GNU `make'.  `cd' to the
 directory where you want the object files and executables to go and run
@@ -100,24 +97,10 @@ architecture at a time in the source code directory.  After you have
 installed the package for one architecture, use `make distclean' before
 reconfiguring for another architecture.
 
-   On MacOS X 10.5 and later systems, you can create libraries and
-executables that work on multiple system types--known as "fat" or
-"universal" binaries--by specifying multiple `-arch' options to the
-compiler but only a single `-arch' option to the preprocessor.  Like
-this:
-
-     ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
-                 CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
-                 CPP="gcc -E" CXXCPP="g++ -E"
-
-   This is not guaranteed to produce working output in all cases, you
-may have to build one architecture at a time and combine the results
-using the `lipo' tool if you have problems.
-
 Installation Names
 ==================
 
-   By default, `make install' installs the package's commands under
+By default, `make install' installs the package's commands under
 `/usr/local/bin', include files under `/usr/local/include', etc.  You
 can specify an installation prefix other than `/usr/local' by giving
 `configure' the option `--prefix=PREFIX'.
@@ -140,7 +123,7 @@ option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
 Optional Features
 =================
 
-   Some packages pay attention to `--enable-FEATURE' options to
+Some packages pay attention to `--enable-FEATURE' options to
 `configure', where FEATURE indicates an optional part of the package.
 They may also pay attention to `--with-PACKAGE' options, where PACKAGE
 is something like `gnu-as' or `x' (for the X Window System).  The
@@ -152,46 +135,14 @@ find the X include and library files automatically, but if it doesn't,
 you can use the `configure' options `--x-includes=DIR' and
 `--x-libraries=DIR' to specify their locations.
 
-Particular systems
-==================
-
-   On HP-UX, the default C compiler is not ANSI C compatible.  If GNU
-CC is not installed, it is recommended to use the following options in
-order to use an ANSI C compiler:
-
-     ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
-
-and if that doesn't work, install pre-built binaries of GCC for HP-UX.
-
-   On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
-parse its `<wchar.h>' header file.  The option `-nodtk' can be used as
-a workaround.  If GNU CC is not installed, it is therefore recommended
-to try
-
-     ./configure CC="cc"
-
-and if that doesn't work, try
-
-     ./configure CC="cc -nodtk"
-
-   On Solaris, don't put `/usr/ucb' early in your `PATH'.  This
-directory contains several dysfunctional programs; working variants of
-these programs are available in `/usr/bin'.  So, if you need `/usr/ucb'
-in your `PATH', put it _after_ `/usr/bin'.
-
-   On Haiku, software installed for all users goes in `/boot/common',
-not `/usr/local'.  It is recommended to use the following options:
-
-     ./configure --prefix=/boot/common
-
 Specifying the System Type
 ==========================
 
-   There may be some features `configure' cannot figure out
-automatically, but needs to determine by the type of machine the package
-will run on.  Usually, assuming the package is built to be run on the
-_same_ architectures, `configure' can figure that out, but if it prints
-a message saying it cannot guess the machine type, give it the
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
 `--build=TYPE' option.  TYPE can either be a short name for the system
 type, such as `sun4', or a canonical name which has the form:
 
@@ -199,8 +150,7 @@ type, such as `sun4', or a canonical name which has the form:
 
 where SYSTEM can have one of these forms:
 
-     OS
-     KERNEL-OS
+     OS KERNEL-OS
 
    See the file `config.sub' for the possible values of each field.  If
 `config.sub' isn't included in this package, then this package doesn't
@@ -218,9 +168,9 @@ eventually be run) with `--host=TYPE'.
 Sharing Defaults
 ================
 
-   If you want to set default values for `configure' scripts to share,
-you can create a site shell script called `config.site' that gives
-default values for variables like `CC', `cache_file', and `prefix'.
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
 `configure' looks for `PREFIX/share/config.site' if it exists, then
 `PREFIX/etc/config.site' if it exists.  Or, you can set the
 `CONFIG_SITE' environment variable to the location of the site script.
@@ -229,7 +179,7 @@ A warning: not all `configure' scripts look for a site script.
 Defining Variables
 ==================
 
-   Variables not defined in a site shell script can be set in the
+Variables not defined in a site shell script can be set in the
 environment passed to `configure'.  However, some packages may run
 configure again during the build, and the customized values of these
 variables may be lost.  In order to avoid this problem, you should set
@@ -248,19 +198,11 @@ an Autoconf bug.  Until the bug is fixed you can use this workaround:
 `configure' Invocation
 ======================
 
-   `configure' recognizes the following options to control how it
-operates.
+`configure' recognizes the following options to control how it operates.
 
 `--help'
 `-h'
-     Print a summary of all of the options to `configure', and exit.
-
-`--help=short'
-`--help=recursive'
-     Print a summary of the options unique to this package's
-     `configure', and exit.  The `short' variant lists options used
-     only in the top level, while the `recursive' variant lists options
-     also present in any nested packages.
+     Print a summary of the options to `configure', and exit.
 
 `--version'
 `-V'
@@ -287,16 +229,6 @@ operates.
      Look for the package's source code in directory DIR.  Usually
      `configure' can determine that directory automatically.
 
-`--prefix=DIR'
-     Use DIR as the installation prefix.  *Note Installation Names::
-     for more details, including other options available for fine-tuning
-     the installation locations.
-
-`--no-create'
-`-n'
-     Run the configure checks, but stop before creating any output
-     files.
-
 `configure' also accepts some other, not widely useful, options.  Run
 `configure --help' for more details.
 
diff --git a/Makefile.am b/Makefile.am
index b5b9889..3a3f9ee 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = libcheese src po data help
+SUBDIRS = src po data help
 
 EXTRA_DIST =			\
 	$(cheesedoc_DATA)	\
diff --git a/configure.ac b/configure.ac
index f47cf38..c91af8f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -92,7 +92,7 @@ PKG_CHECK_MODULES(CHEESE, \
   librsvg-2.0 >= $LIBRSVG_REQUIRED)
 AC_SUBST(CHEESE_CFLAGS)
 
-CHEESE_LIBS="$CHEESE_LIBS -lgstinterfaces-0.10 -l../libcheese/libcheese.la"
+CHEESE_LIBS="$CHEESE_LIBS -lgstinterfaces-0.10"
 
 AC_SUBST(CHEESE_LIBS)
 
@@ -150,7 +150,6 @@ data/icons/scalable/actions/Makefile
 data/pixmaps/Makefile
 data/sounds/Makefile
 help/Makefile
-libcheese/Makefile
 src/Makefile
 po/Makefile.in
 ])
diff --git a/src/Makefile.am b/src/Makefile.am
index 1591517..21cb8a9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -22,14 +22,22 @@ cheese_SOURCES = \
 	cheese-effect-chooser.h \
 	cheese-fileutil.c \
 	cheese-fileutil.h \
+	cheese-gconf.c \
+	cheese-gconf.h \
 	cheese-thumb-view.c \
 	cheese-thumb-view.h \
+	cheese-webcam.c \
+	cheese-webcam.h \
 	cheese-window.c \
 	cheese-window.h \
+	eog-thumbnail.c \
+	eog-thumbnail.h \
 	eog-thumb-nav.c \
 	eog-thumb-nav.h \
 	ephy-spinner.c \
 	ephy-spinner.h \
+	gst-audio-play.c \
+	gst-audio-play.h \
 	cheese-no-camera.c \
 	cheese-no-camera.h \
 	cheese-prefs-widget.h \
@@ -52,4 +60,16 @@ cheese_SOURCES = \
 cheese_LDADD = \
 	$(CHEESE_LIBS)
 
+#dbus
+BUILT_SOURCES = cheese-dbus-infos.h
+# We don't want to install this header
+noinst_HEADERS = $(BUILT_SOURCES)
+
+# Correctly clean the generated headers, but keep the xml description
+CLEANFILES = $(BUILT_SOURCES)
+EXTRA_DIST = cheese-dbus-infos.xml
+
+#Rule to generate the binding headers
+cheese-dbus-infos.h:  cheese-dbus-infos.xml
+	dbus-binding-tool --prefix=cheese_dbus --mode=glib-server $<> $@
 
diff --git a/src/cheese-dbus-infos.xml b/src/cheese-dbus-infos.xml
new file mode 100644
index 0000000..d441a96
--- /dev/null
+++ b/src/cheese-dbus-infos.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<node name="/org/gnome/cheese">
+	<interface name="org.gnome.Cheese">
+		<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="cheese_dbus"/>
+		<method name="notify">
+		</method>
+	</interface>
+</node>
diff --git a/src/cheese-dbus.c b/src/cheese-dbus.c
new file mode 100644
index 0000000..2c5ec62
--- /dev/null
+++ b/src/cheese-dbus.c
@@ -0,0 +1,138 @@
+/*
+ * Copyright © 2007,2008 daniel g. siegel <dgsiegel gnome org>
+ * Copyright © 2007,2008 Jaap Haitsma <jaap haitsma org>
+ * Copyright © 2008 Felix Kaser <f kaser gmx net>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifdef HAVE_CONFIG_H
+  #include <cheese-config.h>
+#endif
+
+#include <dbus/dbus-glib-bindings.h>
+#include <dbus/dbus-glib.h>
+#include <dbus/dbus.h>
+#include <glib.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <gtk/gtk.h>
+#include "cheese-dbus.h"
+#include "cheese-window.h"
+#include "cheese-dbus-infos.h"
+
+gpointer window_pointer;
+
+G_DEFINE_TYPE (CheeseDbus, cheese_dbus, G_TYPE_OBJECT);
+
+void
+cheese_dbus_set_window (gpointer data)
+{
+  if (data != NULL)
+    window_pointer = data;
+}
+
+gboolean
+cheese_dbus_notify ()
+{
+  cheese_window_bring_to_front (window_pointer);
+  return TRUE;
+}
+
+void
+cheese_dbus_class_init (CheeseDbusClass *klass)
+{
+  GError *error = NULL;
+
+  /* Init the DBus connection, per-klass */
+  klass->connection = dbus_g_bus_get (DBUS_BUS_SESSION, &error);
+  if (klass->connection == NULL)
+  {
+    g_warning ("Unable to connect to dbus: %s", error->message);
+    g_error_free (error);
+    return;
+  }
+
+  dbus_g_object_type_install_info (CHEESE_TYPE_DBUS, &dbus_glib_cheese_dbus_object_info);
+}
+
+void
+cheese_dbus_init (CheeseDbus *server)
+{
+  CheeseDbusClass *klass = CHEESE_DBUS_GET_CLASS (server);
+
+  /* Register DBUS path */
+  dbus_g_connection_register_g_object (klass->connection,
+                                       "/org/gnome/cheese",
+                                       G_OBJECT (server));
+}
+
+CheeseDbus *
+cheese_dbus_new ()
+{
+  CheeseDbus      *server;
+  GError          *error = NULL;
+  DBusGProxy      *proxy;
+  guint            request_ret;
+  CheeseDbusClass *klass;
+
+  server = g_object_new (CHEESE_TYPE_DBUS, NULL);
+
+  klass = CHEESE_DBUS_GET_CLASS (server);
+
+  /* Register the service name, the constant here are defined in dbus-glib-bindings.h */
+  proxy = dbus_g_proxy_new_for_name (klass->connection,
+                                     DBUS_SERVICE_DBUS,
+                                     DBUS_PATH_DBUS,
+                                     DBUS_INTERFACE_DBUS);
+
+  if (!org_freedesktop_DBus_request_name (proxy,
+                                          "org.gnome.Cheese",
+                                          0, &request_ret,
+                                          &error))
+  {
+    g_warning ("Unable to register service: %s", error->message);
+    g_error_free (error);
+  }
+
+  /* check if there is already a instance running -> exit*/
+  if (request_ret == DBUS_REQUEST_NAME_REPLY_EXISTS ||
+      request_ret == DBUS_REQUEST_NAME_REPLY_IN_QUEUE)
+  {
+    g_warning ("Another instance of cheese is already running!");
+
+    /* notify the other instance of cheese*/
+    proxy = dbus_g_proxy_new_for_name (klass->connection,
+                                       "org.gnome.Cheese",
+                                       "/org/gnome/cheese",
+                                       "org.gnome.Cheese");
+
+    if (!dbus_g_proxy_call (proxy, "notify", &error, G_TYPE_INVALID, G_TYPE_INVALID))
+    {
+      /* Method failed, the GError is set, let's warn everyone */
+      g_warning ("Notifying the other cheese instance failed: %s", error->message);
+      g_error_free (error);
+    }
+
+    g_object_unref (server);
+    server = NULL;
+  }
+
+  g_object_unref (proxy);
+
+  return server;
+}
diff --git a/src/cheese-dbus.h b/src/cheese-dbus.h
new file mode 100644
index 0000000..9114a31
--- /dev/null
+++ b/src/cheese-dbus.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright © 2007,2008 daniel g. siegel <dgsiegel gnome org>
+ * Copyright © 2007,2008 Jaap Haitsma <jaap haitsma org>
+ * Copyright © 2008 Felix Kaser <f kaser gmx net>
+ *
+ * Licensed under the GNU General Public License Version 2
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _CHEESE_DBUS_H_
+#define _CHEESE_DBUS_H_
+
+#include <dbus/dbus-glib.h>
+#include <glib.h>
+
+G_BEGIN_DECLS
+
+typedef struct
+{
+  GObjectClass parent_class;
+  DBusGConnection *connection;
+} CheeseDbusClass;
+
+typedef struct _CheeseDbus
+{
+  GObject parent;
+} CheeseDbus;
+
+
+#define CHEESE_TYPE_DBUS (cheese_dbus_get_type ())
+#define CHEESE_DBUS(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), CHEESE_TYPE_DBUS, CheeseDbus))
+#define CHEESE_DBUS_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), CHEESE_TYPE_DBUS, CheeseDbusClass))
+#define CHEESE_IS_DBUS(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CHEESE_TYPE_DBUS))
+#define CHEESE_IS_DBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CHEESE_TYPE_DBUS))
+#define CHEESE_DBUS_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), CHEESE_TYPE_DBUS, CheeseDbusClass))
+
+GType       cheese_dbus_get_type (void);
+CheeseDbus *cheese_dbus_new (void);
+
+void     cheese_dbus_set_window (gpointer);
+gboolean cheese_dbus_notify (void);
+
+G_END_DECLS
+
+#endif /* _CHEESE_DBUS_H_ */
diff --git a/libcheese/cheese-gconf.c b/src/cheese-gconf.c
similarity index 100%
rename from libcheese/cheese-gconf.c
rename to src/cheese-gconf.c
diff --git a/libcheese/cheese-gconf.h b/src/cheese-gconf.h
similarity index 100%
rename from libcheese/cheese-gconf.h
rename to src/cheese-gconf.h
diff --git a/libcheese/cheese-webcam.c b/src/cheese-webcam.c
similarity index 100%
rename from libcheese/cheese-webcam.c
rename to src/cheese-webcam.c
diff --git a/libcheese/cheese-webcam.h b/src/cheese-webcam.h
similarity index 100%
rename from libcheese/cheese-webcam.h
rename to src/cheese-webcam.h
diff --git a/libcheese/eog-thumbnail.c b/src/eog-thumbnail.c
similarity index 100%
rename from libcheese/eog-thumbnail.c
rename to src/eog-thumbnail.c
diff --git a/libcheese/eog-thumbnail.h b/src/eog-thumbnail.h
similarity index 100%
rename from libcheese/eog-thumbnail.h
rename to src/eog-thumbnail.h
diff --git a/libcheese/gst-audio-play.c b/src/gst-audio-play.c
similarity index 100%
rename from libcheese/gst-audio-play.c
rename to src/gst-audio-play.c
diff --git a/libcheese/gst-audio-play.h b/src/gst-audio-play.h
similarity index 100%
rename from libcheese/gst-audio-play.h
rename to src/gst-audio-play.h



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]