patches for a unique CD player app



What the attached patches (for gnome-media and gnome-applets) do do is
implement two extra command line options for gnome-cd:

  --unique                               Only start if there isn't already a
                                         CD player application running
  --play                                 Play the CD on startup

The use case for this is an app like magicdev that, when an audio CD
is inserted, if there isn't already a CD player running, starts
gnome-cd and plays the CD. If there is one, simply plays the CD.

The way that --play is implemented is; there is an X selection
_REDHAT_CD_PLAYER. [Temporary name]

When a CD player app/applet starts it sees if there is an existing
owner, if not, it claims the selection.  When the current selection
owner goes away, if there are other cd applets/apps running, one of
them takes over ownership of the selection.

This isn't quite finished perfect ... the selection name should be:

 _GNOME_CD_PLAYER:/dev/cdrom

Or maybe even:

 _GNOME_CD_PLAYER:fresnel.devel.redhat.com:/dev/cdrom

But before I tried to tweak it to perfect, I wanted to get a general
reaction to doing this via X properties rather than Bonobo.

The reasons I didn't use Bonobo are:

 - I don't know much about Bonobo; I know a lot about X selections.

 - Bonobo seemed more complex, since I'd need to install IDL files,
   server files, etc. For this simple case, it really seems
   like overkill. It's not full IPC, it's just a form of locking.

 - I wasn't sure that the right semantics were possible. It isn't
   a "unique application"; the behavior of:

    gnome-cd --unique

   Depends on whether there are zero cd players or one or more 
   cd players running currently; it's perfectly
   legitimate to have both the cd-player applet and gnome-cd
   running at the same time.

   It also is explicitely per-display, not per-user, per-home-dir,
   or whatever.

 - The X based protocol is more friendly to outside-of-GNOME a
   cooperation, even though I don't actually plan to campaign
   to get this standardize. (Too specialized)

Note that this is *not* the "CD player service" situation that
has come up in examples. This isn't about how to play a CD. 
It's about how to get a GUI for CD playing up on the screen 
without duplication.

If non-Bonobo isn't acceptable, I don't expect to have the time
to rewrite it using Bonobo, but it's really the behavior I
care about, not the implementation mechanism

Thanks,

                                    Owen

--- gnome-media-2.0.0/gnome-cd/cd-selection.c.uniquecd	Fri Aug 23 18:52:36 2002
+++ gnome-media-2.0.0/gnome-cd/cd-selection.c	Fri Aug 23 18:52:36 2002
@@ -0,0 +1,208 @@
+/*
+ * Copyright © 2002 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Red Hat makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author:  Owen Taylor, Red Hat, Inc.
+ */
+
+/* This file implements an X protocol for synchronizing multiple
+ * CD player applications. The convention is that there is one CD
+ * player application that is the "Master", which is identifies
+ * by owning the _REDHAT_CD_PLAYER selection. When a player
+ * reliquishes the "Master" role, it destroys the owner window
+ * of the selection.
+ */
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+
+#include "cd-selection.h"
+
+struct _CDSelection
+{
+  GdkWindow *owner_window;
+  GtkWidget *invisible;
+};
+
+#define SELECTION_NAME "_REDHAT_CD_PLAYER"
+
+static GdkFilterReturn cd_selection_filter     (GdkXEvent   *xevent,
+					        GdkEvent    *event,
+					        gpointer     data);
+static void            cd_selection_negotiate  (CDSelection *cd_selection);
+
+static void
+cd_selection_reset (CDSelection *cd_selection)
+{
+  if (cd_selection->owner_window)
+    {
+      gdk_window_remove_filter (cd_selection->owner_window,
+				cd_selection_filter, cd_selection);
+      gdk_window_unref (cd_selection->owner_window);
+      cd_selection->owner_window = NULL;
+    }
+
+  if (cd_selection->invisible)
+    {
+      gtk_widget_destroy (cd_selection->invisible);
+      cd_selection->invisible = NULL;
+    }
+}
+
+static void
+cd_selection_clear (GtkWidget         *widget,
+		    GdkEventSelection *event,
+		    gpointer           user_data)
+{
+  CDSelection *cd_selection = user_data;
+
+  cd_selection_reset (cd_selection);
+  cd_selection_negotiate (cd_selection);
+}
+
+static gboolean
+cd_selection_find_existing (CDSelection *cd_selection)
+{
+  Display *xdisplay = GDK_DISPLAY ();
+  Window old;
+
+  gdk_error_trap_push ();
+  old = XGetSelectionOwner (xdisplay,
+			    gdk_x11_get_xatom_by_name (SELECTION_NAME));
+  if (old)
+    {
+      XSelectInput (xdisplay, old, StructureNotifyMask);
+      cd_selection->owner_window = gdk_window_foreign_new (old);
+    }
+  XSync (xdisplay, False);
+  
+  if (gdk_error_trap_pop () == 0 && cd_selection->owner_window)
+    {
+      gdk_window_add_filter (cd_selection->owner_window,
+			     cd_selection_filter, cd_selection);
+      
+      XUngrabServer (xdisplay);
+      
+      return TRUE;
+    }
+  else
+    {
+      if (cd_selection->owner_window)
+	{
+	  gdk_window_unref (cd_selection->owner_window);
+	  cd_selection->owner_window = NULL;
+	}
+
+      return FALSE;
+    }
+}
+
+static gboolean
+cd_selection_claim (CDSelection *cd_selection)
+{
+  cd_selection->invisible = gtk_invisible_new ();
+  g_signal_connect (cd_selection->invisible, "selection-clear-event",
+		    G_CALLBACK (cd_selection_clear), cd_selection);
+  
+  
+  if (gtk_selection_owner_set (cd_selection->invisible,
+			       gdk_atom_intern (SELECTION_NAME, FALSE),
+			       GDK_CURRENT_TIME))
+    {
+      return TRUE;
+    }
+  else
+    {
+      cd_selection_reset (cd_selection);
+      return FALSE;
+    }
+}
+
+static void
+cd_selection_negotiate (CDSelection *cd_selection)
+{
+  Display *xdisplay = GDK_DISPLAY ();
+  gboolean found = FALSE;
+
+  /* We don't need both the XGrabServer() and the loop here;
+   * the XGrabServer() should make sure that we only go through
+   * the loop once. It also works if you remove the XGrabServer()
+   * and just have the loop, but then the selection ownership
+   * can get transfered a bunch of times before things
+   * settle down.
+   */
+  while (!found)
+    {
+      XGrabServer (xdisplay);
+
+      if (cd_selection_find_existing (cd_selection))
+	found = TRUE;
+      else if (cd_selection_claim (cd_selection))
+	found = TRUE;
+
+      XUngrabServer (xdisplay);
+    }
+}
+
+static GdkFilterReturn
+cd_selection_filter (GdkXEvent *xevent,
+		     GdkEvent  *event,
+		     gpointer   data)
+{
+  CDSelection *cd_selection = data;
+  XEvent *xev = (XEvent *)xevent;
+
+  if (xev->xany.type == DestroyNotify &&
+      xev->xdestroywindow.window == xev->xdestroywindow.event)
+    {
+      cd_selection_reset (cd_selection);
+      cd_selection_negotiate (cd_selection);
+
+      return GDK_FILTER_REMOVE;
+    }
+
+  return GDK_FILTER_CONTINUE;
+}
+
+CDSelection *
+cd_selection_start ()
+{
+  CDSelection *cd_selection = g_new (CDSelection, 1);
+  
+  cd_selection->owner_window = NULL;
+  cd_selection->invisible = NULL;
+
+  cd_selection_negotiate (cd_selection);
+
+  return cd_selection;
+}
+
+void
+cd_selection_stop (CDSelection *cd_selection)
+{
+  cd_selection_reset (cd_selection);
+  g_free (cd_selection);
+}
+
+gboolean
+cd_selection_is_master (CDSelection *cd_selection)
+{
+  return cd_selection->invisible != NULL;
+}
--- gnome-media-2.0.0/gnome-cd/gnome-cd.c.uniquecd	Wed May 29 18:00:02 2002
+++ gnome-media-2.0.0/gnome-cd/gnome-cd.c	Fri Aug 23 18:52:36 2002
@@ -21,6 +21,7 @@
 #include "display.h"
 #include "callbacks.h"
 #include "preferences.h"
+#include "cd-selection.h"
 #include "access/factory.h"
 
 #define DEFAULT_THEME "lcd"
@@ -28,6 +29,9 @@
 /* Debugging? */
 gboolean debug_mode = FALSE;
 
+static gboolean cd_option_unique = FALSE;
+static gboolean cd_option_play = FALSE;
+
 void
 gcd_warning (const char *message,
 	     GError *error)
@@ -617,7 +621,16 @@
 int 
 main (int argc, char *argv[])
 {
+	static const struct poptOption cd_popt_options [] = {
+		{ "unique", '\0', POPT_ARG_NONE, &cd_option_unique, 0,
+		  N_("Only start if there isn't already a CD player application running"), NULL },
+		{ "play",   '\0', POPT_ARG_NONE, &cd_option_play, 0,
+		  N_("Play the CD on startup"), NULL },
+		{ NULL, '\0', 0, NULL, 0 },
+	};
+
 	GnomeCD *gcd;
+	CDSelection *cd_selection;
 	GnomeClient *client;
 
 	free (malloc (8)); /* -lefence */
@@ -631,7 +644,15 @@
 	textdomain (GETTEXT_PACKAGE);
 
 	gnome_program_init ("Gnome-CD", VERSION, LIBGNOMEUI_MODULE, 
-			    argc, argv, NULL);
+			    argc, argv,
+			    GNOME_PARAM_POPT_TABLE, cd_popt_options,
+			    NULL);
+
+	cd_selection = cd_selection_start ();
+	if (cd_option_unique && !cd_option_play &&
+	    !cd_selection_is_master (cd_selection))
+		return 0;
+	
 	client = gnome_master_client ();
     	g_signal_connect (client, "save_yourself",
                          G_CALLBACK (save_session), (gpointer) argv[0]);
@@ -651,7 +672,11 @@
 		gnome_cdrom_close_tray (gcd->cdrom, NULL);
 	}
 #endif
-	
+
+	if (cd_option_play) {
+		/* Just fake a click on the button */
+		play_cb (NULL, gcd);
+	} else {
 	switch (gcd->preferences->start) {
 	case GNOME_CD_PREFERENCES_START_NOTHING:
 		break;
@@ -668,6 +693,11 @@
 	default:
 		break;
 	}
+	}
+	
+	if (cd_option_unique &&
+	    !cd_selection_is_master (cd_selection))
+		return 0;
 	
 	gtk_widget_show (gcd->window);
 
--- gnome-media-2.0.0/gnome-cd/Makefile.am.uniquecd	Wed May 29 15:42:18 2002
+++ gnome-media-2.0.0/gnome-cd/Makefile.am	Fri Aug 23 18:52:36 2002
@@ -51,6 +51,8 @@
 	$(CDROM_HOST)-cdrom.h	\
 	preferences.c		\
 	preferences.h		\
+	cd-selection.c		\
+	cd-selection.h		\
 	theme.c
 
 ACCESS_LT_LIB = $(top_builddir)/gnome-cd/access/libgnomecdaccess.la
--- gnome-media-2.0.0/gnome-cd/cd-selection.h.uniquecd	Fri Aug 23 18:52:36 2002
+++ gnome-media-2.0.0/gnome-cd/cd-selection.h	Fri Aug 23 18:56:58 2002
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2002 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Red Hat makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author:  Owen Taylor, Red Hat, Inc.
+ */
+
+#ifndef __CD_SELECTION_H__
+#define __CD_SELECTION_H__
+
+typedef struct _CDSelection  CDSelection;
+
+CDSelection *cd_selection_start     ();
+void         cd_selection_stop      (CDSelection *cd_selection);
+gboolean     cd_selection_is_master (CDSelection *cd_selection);
+
+#endif /* __CD_SELECTION_H__ */
--- gnome-applets-2.0.1/cdplayer/cdplayer.c.uniquecd	Sun Jul 21 11:23:44 2002
+++ gnome-applets-2.0.1/cdplayer/cdplayer.c	Fri Aug 23 19:05:51 2002
@@ -138,6 +138,8 @@
     gnome_window_icon_set_default_from_file (GNOME_ICONDIR"/gnome-cdplayer-icon.png");
     
     cd = g_new0(CDPlayerData, 1);
+    cd->cd_selection = cd_selection_start ();
+    
     cd->panel.applet = GTK_WIDGET (applet);
     
     /* the rest of the widgets go in here */
@@ -219,6 +221,8 @@
     CDPlayerData *cd = data;
     GtkTooltips *tooltips;
 
+    cd_selection_stop (cd->cd_selection);
+
     if (cd->timeout != 0)
         gtk_timeout_remove(cd->timeout);
     cd->timeout = 0;
--- gnome-applets-2.0.1/cdplayer/cd-selection.c.uniquecd	Fri Aug 23 19:05:51 2002
+++ gnome-applets-2.0.1/cdplayer/cd-selection.c	Fri Aug 23 19:05:51 2002
@@ -0,0 +1,208 @@
+/*
+ * Copyright © 2002 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Red Hat makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author:  Owen Taylor, Red Hat, Inc.
+ */
+
+/* This file implements an X protocol for synchronizing multiple
+ * CD player applications. The convention is that there is one CD
+ * player application that is the "Master", which is identifies
+ * by owning the _REDHAT_CD_PLAYER selection. When a player
+ * reliquishes the "Master" role, it destroys the owner window
+ * of the selection.
+ */
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <gdk/gdkx.h>
+
+#include "cd-selection.h"
+
+struct _CDSelection
+{
+  GdkWindow *owner_window;
+  GtkWidget *invisible;
+};
+
+#define SELECTION_NAME "_REDHAT_CD_PLAYER"
+
+static GdkFilterReturn cd_selection_filter     (GdkXEvent   *xevent,
+					        GdkEvent    *event,
+					        gpointer     data);
+static void            cd_selection_negotiate  (CDSelection *cd_selection);
+
+static void
+cd_selection_reset (CDSelection *cd_selection)
+{
+  if (cd_selection->owner_window)
+    {
+      gdk_window_remove_filter (cd_selection->owner_window,
+				cd_selection_filter, cd_selection);
+      gdk_window_unref (cd_selection->owner_window);
+      cd_selection->owner_window = NULL;
+    }
+
+  if (cd_selection->invisible)
+    {
+      gtk_widget_destroy (cd_selection->invisible);
+      cd_selection->invisible = NULL;
+    }
+}
+
+static void
+cd_selection_clear (GtkWidget         *widget,
+		    GdkEventSelection *event,
+		    gpointer           user_data)
+{
+  CDSelection *cd_selection = user_data;
+
+  cd_selection_reset (cd_selection);
+  cd_selection_negotiate (cd_selection);
+}
+
+static gboolean
+cd_selection_find_existing (CDSelection *cd_selection)
+{
+  Display *xdisplay = GDK_DISPLAY ();
+  Window old;
+
+  gdk_error_trap_push ();
+  old = XGetSelectionOwner (xdisplay,
+			    gdk_x11_get_xatom_by_name (SELECTION_NAME));
+  if (old)
+    {
+      XSelectInput (xdisplay, old, StructureNotifyMask);
+      cd_selection->owner_window = gdk_window_foreign_new (old);
+    }
+  XSync (xdisplay, False);
+  
+  if (gdk_error_trap_pop () == 0 && cd_selection->owner_window)
+    {
+      gdk_window_add_filter (cd_selection->owner_window,
+			     cd_selection_filter, cd_selection);
+      
+      XUngrabServer (xdisplay);
+      
+      return TRUE;
+    }
+  else
+    {
+      if (cd_selection->owner_window)
+	{
+	  gdk_window_unref (cd_selection->owner_window);
+	  cd_selection->owner_window = NULL;
+	}
+
+      return FALSE;
+    }
+}
+
+static gboolean
+cd_selection_claim (CDSelection *cd_selection)
+{
+  cd_selection->invisible = gtk_invisible_new ();
+  g_signal_connect (cd_selection->invisible, "selection-clear-event",
+		    G_CALLBACK (cd_selection_clear), cd_selection);
+  
+  
+  if (gtk_selection_owner_set (cd_selection->invisible,
+			       gdk_atom_intern (SELECTION_NAME, FALSE),
+			       GDK_CURRENT_TIME))
+    {
+      return TRUE;
+    }
+  else
+    {
+      cd_selection_reset (cd_selection);
+      return FALSE;
+    }
+}
+
+static void
+cd_selection_negotiate (CDSelection *cd_selection)
+{
+  Display *xdisplay = GDK_DISPLAY ();
+  gboolean found = FALSE;
+
+  /* We don't need both the XGrabServer() and the loop here;
+   * the XGrabServer() should make sure that we only go through
+   * the loop once. It also works if you remove the XGrabServer()
+   * and just have the loop, but then the selection ownership
+   * can get transfered a bunch of times before things
+   * settle down.
+   */
+  while (!found)
+    {
+      XGrabServer (xdisplay);
+
+      if (cd_selection_find_existing (cd_selection))
+	found = TRUE;
+      else if (cd_selection_claim (cd_selection))
+	found = TRUE;
+
+      XUngrabServer (xdisplay);
+    }
+}
+
+static GdkFilterReturn
+cd_selection_filter (GdkXEvent *xevent,
+		     GdkEvent  *event,
+		     gpointer   data)
+{
+  CDSelection *cd_selection = data;
+  XEvent *xev = (XEvent *)xevent;
+
+  if (xev->xany.type == DestroyNotify &&
+      xev->xdestroywindow.window == xev->xdestroywindow.event)
+    {
+      cd_selection_reset (cd_selection);
+      cd_selection_negotiate (cd_selection);
+
+      return GDK_FILTER_REMOVE;
+    }
+
+  return GDK_FILTER_CONTINUE;
+}
+
+CDSelection *
+cd_selection_start ()
+{
+  CDSelection *cd_selection = g_new (CDSelection, 1);
+  
+  cd_selection->owner_window = NULL;
+  cd_selection->invisible = NULL;
+
+  cd_selection_negotiate (cd_selection);
+
+  return cd_selection;
+}
+
+void
+cd_selection_stop (CDSelection *cd_selection)
+{
+  cd_selection_reset (cd_selection);
+  g_free (cd_selection);
+}
+
+gboolean
+cd_selection_is_master (CDSelection *cd_selection)
+{
+  return cd_selection->invisible != NULL;
+}
--- gnome-applets-2.0.1/cdplayer/cd-selection.h.uniquecd	Fri Aug 23 19:05:51 2002
+++ gnome-applets-2.0.1/cdplayer/cd-selection.h	Fri Aug 23 19:05:51 2002
@@ -0,0 +1,33 @@
+/*
+ * Copyright © 2002 Red Hat, Inc.
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of Red Hat not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission.  Red Hat makes no representations about the
+ * suitability of this software for any purpose.  It is provided "as is"
+ * without express or implied warranty.
+ *
+ * RED HAT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL RED HAT
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ *
+ * Author:  Owen Taylor, Red Hat, Inc.
+ */
+
+#ifndef __CD_SELECTION_H__
+#define __CD_SELECTION_H__
+
+typedef struct _CDSelection  CDSelection;
+
+CDSelection *cd_selection_start     ();
+void         cd_selection_stop      (CDSelection *cd_selection);
+gboolean     cd_selection_is_master (CDSelection *cd_selection);
+
+#endif /* __CD_SELECTION_H__ */
--- gnome-applets-2.0.1/cdplayer/cdplayer.h.uniquecd	Sun Jul 21 11:23:44 2002
+++ gnome-applets-2.0.1/cdplayer/cdplayer.h	Fri Aug 23 19:05:51 2002
@@ -23,6 +23,7 @@
 #include <gtk/gtk.h>
 #include <panel-applet.h>
 #include "cdrom-interface.h"
+#include "cd-selection.h"
 
 #ifndef __CDPLAYER_H__
 #define __CDPLAYER_H__
@@ -33,6 +34,7 @@
 {
     int timeout;
     cdrom_device_t cdrom_device;
+    CDSelection *cd_selection;
     int size;
     PanelAppletOrient orient;
     char *devpath;
--- gnome-applets-2.0.1/cdplayer/Makefile.am.uniquecd	Fri Aug 23 19:08:13 2002
+++ gnome-applets-2.0.1/cdplayer/Makefile.am	Fri Aug 23 19:08:29 2002
@@ -21,6 +21,8 @@
 cdplayer.c \
 cdplayer.h \
 cdrom-interface.h \
+cd-selection.c \
+cd-selection.h \
 led.c \
 led.h \
 reader-solaris.h \


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