[monkey-bubble: 280/753] Derive from GnomeSelectorClient. Use GnomeSelectorComponent.



commit 45380cbf6e9947355ab75e961ceacb7639714e9b
Author: Martin Baulig <baulig suse de>
Date:   Thu May 10 20:19:13 2001 +0000

    Derive from GnomeSelectorClient. Use GnomeSelectorComponent.
    
    2001-05-10  Martin Baulig  <baulig suse de>
    
    	* gnome-file-entry.h (GnomeFileEntry): Derive from GnomeSelectorClient.
    	* gnome-file-entry.c (gnome_file_entry_new): Use GnomeSelectorComponent.
    
    	* gnome-image-entry-component.h (GnomeImageEntryComponent): Derive from
    	GnomeSelectorComponent.

 libgnomeui/ChangeLog           |    8 +++
 libgnomeui/Makefile.am         |    1 -
 libgnomeui/gnome-file-entry.c  |  101 +++++++++++++++++++++------------------
 libgnomeui/gnome-file-entry.h  |   12 ++--
 libgnomeui/gnome-image-entry.c |    2 +
 5 files changed, 70 insertions(+), 54 deletions(-)
---
diff --git a/libgnomeui/ChangeLog b/libgnomeui/ChangeLog
index 24dd429..ca46a3d 100644
--- a/libgnomeui/ChangeLog
+++ b/libgnomeui/ChangeLog
@@ -1,3 +1,11 @@
+2001-05-10  Martin Baulig  <baulig suse de>
+
+	* gnome-file-entry.h (GnomeFileEntry): Derive from GnomeSelectorClient.
+	* gnome-file-entry.c (gnome_file_entry_new): Use GnomeSelectorComponent.
+
+	* gnome-image-entry-component.h (GnomeImageEntryComponent): Derive from
+	GnomeSelectorComponent.
+
 2001-05-09  Martin Baulig  <baulig suse de>
 
 	* gnome-selector-component.[ch]: New files.
diff --git a/libgnomeui/Makefile.am b/libgnomeui/Makefile.am
index 7de6b7a..78fa77b 100644
--- a/libgnomeui/Makefile.am
+++ b/libgnomeui/Makefile.am
@@ -70,7 +70,6 @@ unused_SOURCES = \
 libgnomeui_2_la_SOURCES = \
 	gnome-stock-icons.c		\
 	gnome-about.c			\
-	gnome-animator.c		\
 	gnome-canvas-init.c		\
 	gnome-client.c			\
 	gnome-color-picker.c		\
diff --git a/libgnomeui/gnome-file-entry.c b/libgnomeui/gnome-file-entry.c
index 2360912..7df9564 100644
--- a/libgnomeui/gnome-file-entry.c
+++ b/libgnomeui/gnome-file-entry.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 /*
  * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
  * All rights reserved.
@@ -40,6 +40,7 @@
 #include <gtk/gtksignal.h>
 #include <libgnome/gnome-i18n.h>
 #include <libgnome/gnome-file-selector.h>
+#include <libgnomeui/gnome-selector-component.h>
 #include "gnome-macros.h"
 #include "gnome-file-entry.h"
 
@@ -51,49 +52,49 @@ static void   gnome_file_entry_class_init   (GnomeFileEntryClass *class);
 static void   gnome_file_entry_init         (GnomeFileEntry      *gentry);
 static void   gnome_file_entry_finalize     (GObject         *object);
 
-static GnomeEntryClass *parent_class;
+static GnomeSelectorClientClass *parent_class;
 
 GType
 gnome_file_entry_get_type (void)
 {
-	static GType entry_type = 0;
-
-	if (!entry_type) {
-		GtkTypeInfo entry_info = {
-			"GnomeFileEntry",
-			sizeof (GnomeFileEntry),
-			sizeof (GnomeFileEntryClass),
-			(GtkClassInitFunc) gnome_file_entry_class_init,
-			(GtkObjectInitFunc) gnome_file_entry_init,
-			NULL,
-			NULL,
-			NULL
-		};
-
-		entry_type = gtk_type_unique (gnome_entry_get_type (), &entry_info);
-	}
-
-	return entry_type;
+    static GType entry_type = 0;
+
+    if (!entry_type) {
+	GtkTypeInfo entry_info = {
+	    "GnomeFileEntry",
+	    sizeof (GnomeFileEntry),
+	    sizeof (GnomeFileEntryClass),
+	    (GtkClassInitFunc) gnome_file_entry_class_init,
+	    (GtkObjectInitFunc) gnome_file_entry_init,
+	    NULL,
+	    NULL,
+	    NULL
+	};
+
+	entry_type = gtk_type_unique (gnome_selector_client_get_type (), &entry_info);
+    }
+
+    return entry_type;
 }
 
 static void
 gnome_file_entry_class_init (GnomeFileEntryClass *class)
 {
-	GtkObjectClass *object_class;
-	GObjectClass *gobject_class;
+    GtkObjectClass *object_class;
+    GObjectClass *gobject_class;
 
-	object_class = (GtkObjectClass *) class;
-	gobject_class = (GObjectClass *) class;
+    object_class = (GtkObjectClass *) class;
+    gobject_class = (GObjectClass *) class;
 
-	parent_class = gtk_type_class (gnome_entry_get_type ());
+    parent_class = gtk_type_class (gnome_selector_client_get_type ());
 
-	gobject_class->finalize = gnome_file_entry_finalize;
+    gobject_class->finalize = gnome_file_entry_finalize;
 }
 
 static void
 gnome_file_entry_init (GnomeFileEntry *gentry)
 {
-	gentry->_priv = g_new0 (GnomeFileEntryPrivate, 1);
+    gentry->_priv = g_new0 (GnomeFileEntryPrivate, 1);
 }
 
 GtkWidget *
@@ -101,50 +102,56 @@ gnome_file_entry_construct (GnomeFileEntry     *fentry,
 			    GNOME_Selector      corba_selector,
 			    Bonobo_UIContainer  uic)
 {
-	g_return_val_if_fail (fentry != NULL, NULL);
-	g_return_val_if_fail (GNOME_IS_FILE_ENTRY (fentry), NULL);
-	g_return_val_if_fail (corba_selector != CORBA_OBJECT_NIL, NULL);
+    g_return_val_if_fail (fentry != NULL, NULL);
+    g_return_val_if_fail (GNOME_IS_FILE_ENTRY (fentry), NULL);
+    g_return_val_if_fail (corba_selector != CORBA_OBJECT_NIL, NULL);
 
-	return (GtkWidget *) gnome_entry_construct
-		(GNOME_ENTRY (fentry), corba_selector, uic);
+    return (GtkWidget *) gnome_selector_client_construct
+	(GNOME_SELECTOR_CLIENT (fentry), corba_selector, uic);
 }
 
 GtkWidget *
 gnome_file_entry_new (void)
 {
-	GnomeSelector *selector;
+    GnomeSelector *selector;
 
-	selector = g_object_new (gnome_file_selector_get_type (), NULL);
+    selector = g_object_new (gnome_selector_component_get_type (),
+			     "use_default_entry_widget", TRUE,
+			     "want_browse_button", TRUE,
+			     "want_default_button", FALSE,
+			     "want_clear_button", FALSE,
+			     NULL);
 
-	return gnome_entry_new_full (selector, CORBA_OBJECT_NIL);
+    return gnome_file_entry_new_from_selector (BONOBO_OBJREF (selector),
+					       CORBA_OBJECT_NIL);
 }
 
 GtkWidget *
 gnome_file_entry_new_from_selector (GNOME_Selector     corba_selector,
 				    Bonobo_UIContainer uic)
 {
-	GnomeFileEntry *fentry;
+    GnomeFileEntry *fentry;
 
-	g_return_val_if_fail (corba_selector != CORBA_OBJECT_NIL, NULL);
+    g_return_val_if_fail (corba_selector != CORBA_OBJECT_NIL, NULL);
 
-	fentry = g_object_new (gnome_file_entry_get_type (), NULL);
+    fentry = g_object_new (gnome_file_entry_get_type (), NULL);
 
-	return gnome_file_entry_construct (fentry, corba_selector, uic);
+    return gnome_file_entry_construct (fentry, corba_selector, uic);
 }
 
 static void
 gnome_file_entry_finalize (GObject *object)
 {
-	GnomeFileEntry *gentry;
+    GnomeFileEntry *gentry;
 
-	g_return_if_fail (object != NULL);
-	g_return_if_fail (GNOME_IS_ENTRY (object));
+    g_return_if_fail (object != NULL);
+    g_return_if_fail (GNOME_IS_FILE_ENTRY (object));
 
-	gentry = GNOME_FILE_ENTRY (object);
+    gentry = GNOME_FILE_ENTRY (object);
 
-	g_free (gentry->_priv);
-	gentry->_priv = NULL;
+    g_free (gentry->_priv);
+    gentry->_priv = NULL;
 
-	if (G_OBJECT_CLASS (parent_class)->finalize)
-		(* G_OBJECT_CLASS (parent_class)->finalize) (object);
+    if (G_OBJECT_CLASS (parent_class)->finalize)
+	(* G_OBJECT_CLASS (parent_class)->finalize) (object);
 }
diff --git a/libgnomeui/gnome-file-entry.h b/libgnomeui/gnome-file-entry.h
index 9b21497..a3c826c 100644
--- a/libgnomeui/gnome-file-entry.h
+++ b/libgnomeui/gnome-file-entry.h
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
 /*
  * Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation
  * All rights reserved.
@@ -34,7 +34,7 @@
 
 
 #include <libgnome/gnome-selector.h>
-#include <libgnomeui/gnome-entry.h>
+#include <libgnomeui/gnome-selector-client.h>
 
 
 G_BEGIN_DECLS
@@ -52,14 +52,14 @@ typedef struct _GnomeFileEntryPrivate GnomeFileEntryPrivate;
 typedef struct _GnomeFileEntryClass   GnomeFileEntryClass;
 
 struct _GnomeFileEntry {
-	GnomeEntry entry;
+    GnomeSelectorClient client;
 
-	/*< private >*/
-	GnomeFileEntryPrivate *_priv;
+    /*< private >*/
+    GnomeFileEntryPrivate *_priv;
 };
 
 struct _GnomeFileEntryClass {
-	GnomeEntryClass parent_class;
+    GnomeSelectorClientClass parent_class;
 };
 
 
diff --git a/libgnomeui/gnome-image-entry.c b/libgnomeui/gnome-image-entry.c
index 8e3784f..ce79f0e 100644
--- a/libgnomeui/gnome-image-entry.c
+++ b/libgnomeui/gnome-image-entry.c
@@ -114,6 +114,7 @@ gnome_image_entry_new_icon_entry (void)
 	GnomeSelector *selector;
 
 	selector = g_object_new (gnome_image_entry_component_get_type (),
+				 "want_default_behaviour", TRUE,
 				 "is_pixmap_entry", FALSE, NULL);
 
 	return gnome_image_entry_new_from_selector (BONOBO_OBJREF (selector),
@@ -126,6 +127,7 @@ gnome_image_entry_new_pixmap_entry (guint preview_x, guint preview_y)
 	GnomeSelector *selector;
 
 	selector = g_object_new (gnome_image_entry_component_get_type (),
+				 "want_default_behaviour", TRUE,
 				 "preview_x", preview_x, "preview_y", preview_y,
 				 "is_pixmap_entry", TRUE, NULL);
 



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