Commit 8bd01855 authored by Darin Adler's avatar Darin Adler

This needs to return a g_free'able string, so I changed the placeholder to

	* libnautilus-extensions/nautilus-search-uri.c:
	(nautilus_search_uri_to_simple_search_criteria):
	This needs to return a g_free'able string, so I changed the
	placeholder to return NULL instead of "". (g_strdup ("") would
	also have been OK.)

	* src/nautilus-complex-search-bar.h:
	* src/nautilus-complex-search-bar.c:
	(nautilus_complex_search_bar_initialize_class),
	(nautilus_complex_search_bar_initialize),
	(nautilus_complex_search_bar_get_location),
	(nautilus_complex_search_bar_set_location):
	* src/nautilus-location-bar.c: (drag_data_received_callback),
	(drag_data_get_callback), (nautilus_location_bar_initialize_class),
	(nautilus_location_bar_initialize),
	(nautilus_location_bar_set_location),
	(nautilus_location_bar_get_location):
	* src/nautilus-navigation-bar.h:
	* src/nautilus-navigation-bar.c:
	(nautilus_navigation_bar_initialize_class),
	(nautilus_navigation_bar_get_location),
	(nautilus_navigation_bar_location_changed):
	* src/nautilus-search-bar.h:
	* src/nautilus-search-bar.c:
	(nautilus_search_bar_initialize_class),
	(nautilus_search_bar_initialize):
	* src/nautilus-simple-search-bar.h:
	* src/nautilus-simple-search-bar.c:
	(nautilus_simple_search_bar_initialize_class),
	(nautilus_simple_search_bar_initialize),
	(nautilus_simple_search_bar_set_location),
	(nautilus_simple_search_bar_get_location):
	* src/nautilus-switchable-navigation-bar.c:
	(nautilus_switchable_navigation_bar_initialize),
	(nautilus_switchable_navigation_bar_set_mode):
	* src/nautilus-switchable-search-bar.h:
	* src/nautilus-switchable-search-bar.c:
	(nautilus_switchable_search_bar_initialize_class),
	(nautilus_switchable_search_bar_set_mode),
	(search_activated_callback),
	(nautilus_switchable_search_bar_get_location),
	(nautilus_switchable_search_bar_set_location):
	Got rid of set_search_controls since set_location does exactly the
	same thing. Changed to use get_location in the
	NautilusNavigationBar base class instead of having lots of
	separate get_location. Fixed bug where get_location would return a
	non-g_strdup'd string, which callers would then g_free. Also
	changed to use simpler version of location_changed since the
	navigation bar can now get the location easily for itself so the
	subclasses need not do it. Callbacks now can call
	nautilus_navigation_bar_location_changed directly. Removed some
	empty destroy functions in classes where they are likely to be
	empty forever.

	* src/nautilus-window.c: (goto_uri_callback): Whitespace.
parent 5af5d90f
2000-07-27 Darin Adler <darin@eazel.com>
* libnautilus-extensions/nautilus-search-uri.c:
(nautilus_search_uri_to_simple_search_criteria):
This needs to return a g_free'able string, so I changed the
placeholder to return NULL instead of "". (g_strdup ("") would
also have been OK.)
* src/nautilus-complex-search-bar.h:
* src/nautilus-complex-search-bar.c:
(nautilus_complex_search_bar_initialize_class),
(nautilus_complex_search_bar_initialize),
(nautilus_complex_search_bar_get_location),
(nautilus_complex_search_bar_set_location):
* src/nautilus-location-bar.c: (drag_data_received_callback),
(drag_data_get_callback), (nautilus_location_bar_initialize_class),
(nautilus_location_bar_initialize),
(nautilus_location_bar_set_location),
(nautilus_location_bar_get_location):
* src/nautilus-navigation-bar.h:
* src/nautilus-navigation-bar.c:
(nautilus_navigation_bar_initialize_class),
(nautilus_navigation_bar_get_location),
(nautilus_navigation_bar_location_changed):
* src/nautilus-search-bar.h:
* src/nautilus-search-bar.c:
(nautilus_search_bar_initialize_class),
(nautilus_search_bar_initialize):
* src/nautilus-simple-search-bar.h:
* src/nautilus-simple-search-bar.c:
(nautilus_simple_search_bar_initialize_class),
(nautilus_simple_search_bar_initialize),
(nautilus_simple_search_bar_set_location),
(nautilus_simple_search_bar_get_location):
* src/nautilus-switchable-navigation-bar.c:
(nautilus_switchable_navigation_bar_initialize),
(nautilus_switchable_navigation_bar_set_mode):
* src/nautilus-switchable-search-bar.h:
* src/nautilus-switchable-search-bar.c:
(nautilus_switchable_search_bar_initialize_class),
(nautilus_switchable_search_bar_set_mode),
(search_activated_callback),
(nautilus_switchable_search_bar_get_location),
(nautilus_switchable_search_bar_set_location):
Got rid of set_search_controls since set_location does exactly the
same thing. Changed to use get_location in the
NautilusNavigationBar base class instead of having lots of
separate get_location. Fixed bug where get_location would return a
non-g_strdup'd string, which callers would then g_free. Also
changed to use simpler version of location_changed since the
navigation bar can now get the location easily for itself so the
subclasses need not do it. Callbacks now can call
nautilus_navigation_bar_location_changed directly. Removed some
empty destroy functions in classes where they are likely to be
empty forever.
* src/nautilus-window.c: (goto_uri_callback): Whitespace.
2000-07-27 Robey Pointer <robey@eazel.com>
*
components/services/install/command-line/eazel-alt-install-corba.c:
* components/services/install/command-line/eazel-alt-install-corba.c:
(eazel_install_progress_signal):
* components/services/install/lib/eazel-install-object.c:
(eazel_install_install_packages):
......@@ -15,12 +72,11 @@
* icons/eazel/*.png
Images became corrupt in the last batch... fixed.
2000-07-27 set REAL_NAME environment variable <set EMAIL_ADDRESS environment variable>
2000-07-27 J Shane Culpepper <pepper@eazel.com>
*
components/services/summary/nautilus-view/nautilus-summary-view.c:
* components/services/summary/nautilus-view/nautilus-summary-view.c:
(generate_summary_form):
Fixing title so thaqt it displays correctly.
Fixing title so that it displays correctly.
2000-07-27 Arlo Rose <arlo@eazel.com>
......
......@@ -29,10 +29,11 @@
static NautilusSearchBarMode other_search_mode (NautilusSearchBarMode mode);
char*
char *
nautilus_search_uri_to_simple_search_criteria (const char *uri)
{
return "";
/* FIXME: Not yet implemented. */
return NULL;
}
......
......@@ -29,10 +29,11 @@
static NautilusSearchBarMode other_search_mode (NautilusSearchBarMode mode);
char*
char *
nautilus_search_uri_to_simple_search_criteria (const char *uri)
{
return "";
/* FIXME: Not yet implemented. */
return NULL;
}
......
......@@ -47,57 +47,35 @@ struct NautilusComplexSearchBarDetails {
gboolean undo_registered;
};
static char * nautilus_complex_search_bar_get_location (NautilusComplexSearchBar *bar);
static void nautilus_complex_search_bar_set_search_controls (NautilusSearchBar *bar,
const char *location);
static void nautilus_complex_search_bar_initialize_class (NautilusComplexSearchBarClass *class);
static void nautilus_complex_search_bar_initialize (NautilusComplexSearchBar *bar);
static void attach_criterion_to_search_bar (NautilusComplexSearchBar *bar,
NautilusSearchBarCriterion *criterion,
int row_number);
static void unattach_criterion_from_search_bar (NautilusComplexSearchBar *bar,
NautilusSearchBarCriterion *criterion);
static void destroy (GtkObject *object);
static void more_options_callback (GtkObject *object,
gpointer data);
static void fewer_options_callback (GtkObject *object,
gpointer data);
static char *nautilus_complex_search_bar_get_location (NautilusNavigationBar *bar);
static void nautilus_complex_search_bar_set_location (NautilusNavigationBar *bar,
const char *location);
static void nautilus_complex_search_bar_initialize_class (NautilusComplexSearchBarClass *class);
static void nautilus_complex_search_bar_initialize (NautilusComplexSearchBar *bar);
static void attach_criterion_to_search_bar (NautilusComplexSearchBar *bar,
NautilusSearchBarCriterion *criterion,
int row_number);
static void unattach_criterion_from_search_bar (NautilusComplexSearchBar *bar,
NautilusSearchBarCriterion *criterion);
static void more_options_callback (GtkObject *object,
gpointer data);
static void fewer_options_callback (GtkObject *object,
gpointer data);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusComplexSearchBar, nautilus_complex_search_bar, NAUTILUS_TYPE_SEARCH_BAR)
static void
nautilus_complex_search_bar_initialize_class (NautilusComplexSearchBarClass *klass)
{
GtkObjectClass *object_class;
NautilusSearchBarClass *search_bar_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = destroy;
search_bar_class = NAUTILUS_SEARCH_BAR_CLASS (klass);
search_bar_class->set_search_controls = nautilus_complex_search_bar_set_search_controls;
klass->get_location = nautilus_complex_search_bar_get_location;
NAUTILUS_NAVIGATION_BAR_CLASS (klass)->get_location = nautilus_complex_search_bar_get_location;
NAUTILUS_NAVIGATION_BAR_CLASS (klass)->set_location = nautilus_complex_search_bar_set_location;
}
static void
destroy (GtkObject *object)
{
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
static void
nautilus_complex_search_bar_initialize (NautilusComplexSearchBar *bar)
{
NautilusSearchBarCriterion *file_name_criterion;
GtkWidget *hbox;
bar->details = g_new0 (NautilusComplexSearchBarDetails, 1);
......@@ -146,17 +124,27 @@ nautilus_complex_search_bar_initialize (NautilusComplexSearchBar *bar)
}
static char *
nautilus_complex_search_bar_get_location (NautilusComplexSearchBar *bar)
static char *
nautilus_complex_search_bar_get_location (NautilusNavigationBar *navigation_bar)
{
return "search:[file:///]";
NautilusComplexSearchBar *bar;
bar = NAUTILUS_COMPLEX_SEARCH_BAR (navigation_bar);
/* FIXME: Not implemented. */
return g_strdup ("search:[file:///]");
}
static void
nautilus_complex_search_bar_set_search_controls (NautilusSearchBar *bar,
const char *location)
nautilus_complex_search_bar_set_location (NautilusNavigationBar *navigation_bar,
const char *location)
{
/* FIXME */
NautilusComplexSearchBar *bar;
bar = NAUTILUS_COMPLEX_SEARCH_BAR (navigation_bar);
/* FIXME: Not implemented. */
}
static void
......
......@@ -24,16 +24,10 @@
Author: Rebecca Schulman <rebecka@eazel.com>
*/
#ifndef NAUTILUS_COMPLEX_SEARCH_BAR_H
#define NAUTILUS_COMPLEX_SEARCH_BAR_H
#include "nautilus-navigation-bar.h"
#include "nautilus-search-bar.h"
#include <gtk/gtkhbox.h>
#include <gtk/gtklabel.h>
#include <gtk/gtkentry.h>
#define NAUTILUS_TYPE_COMPLEX_SEARCH_BAR (nautilus_complex_search_bar_get_type ())
#define NAUTILUS_COMPLEX_SEARCH_BAR(obj) \
......@@ -45,19 +39,17 @@
typedef struct NautilusComplexSearchBarDetails NautilusComplexSearchBarDetails;
typedef struct NautilusComplexSearchBar {
NautilusNavigationBar parent;
NautilusComplexSearchBarDetails *details;
typedef struct {
NautilusSearchBar parent_slot;
NautilusComplexSearchBarDetails *details;
} NautilusComplexSearchBar;
typedef struct {
NautilusSearchBarClass parent_class;
char* (*get_location) (NautilusComplexSearchBar *search_bar);
NautilusSearchBarClass parent_slot;
} NautilusComplexSearchBarClass;
GtkType nautilus_complex_search_bar_get_type (void);
GtkWidget* nautilus_complex_search_bar_new (void);
GtkType nautilus_complex_search_bar_get_type (void);
GtkWidget *nautilus_complex_search_bar_new (void);
#endif /* NAUTILUS_COMPLEX_SEARCH_BAR_H */
......@@ -76,19 +76,14 @@ static GtkTargetEntry drop_types [] = {
{ NAUTILUS_DND_URL_TYPE, 0, NAUTILUS_DND_URL }
};
static gchar *nautilus_location_bar_get_location (NautilusLocationBar *bar);
static void nautilus_location_bar_set_location (NautilusNavigationBar *navigation_bar,
const char *location);
static void nautilus_location_bar_initialize_class (NautilusLocationBarClass *class);
static void nautilus_location_bar_initialize (NautilusLocationBar *bar);
static char *nautilus_location_bar_get_location (NautilusNavigationBar *navigation_bar);
static void nautilus_location_bar_set_location (NautilusNavigationBar *navigation_bar,
const char *location);
static void nautilus_location_bar_initialize_class (NautilusLocationBarClass *class);
static void nautilus_location_bar_initialize (NautilusLocationBar *bar);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusLocationBar, nautilus_location_bar, NAUTILUS_TYPE_NAVIGATION_BAR)
static NautilusWindow *
nautilus_location_bar_get_window (GtkWidget *widget)
{
......@@ -150,8 +145,7 @@ drag_data_received_callback (GtkWidget *widget,
nautilus_navigation_bar_set_location (NAUTILUS_NAVIGATION_BAR (widget),
names->data);
nautilus_navigation_bar_location_changed (NAUTILUS_NAVIGATION_BAR (widget),
names->data);
nautilus_navigation_bar_location_changed (NAUTILUS_NAVIGATION_BAR (widget));
if (new_windows_for_extras) {
application = nautilus_location_bar_get_window (widget)->application;
......@@ -177,7 +171,7 @@ drag_data_get_callback (GtkWidget *widget,
g_assert (selection_data != NULL);
entry_text = nautilus_location_bar_get_location (NAUTILUS_LOCATION_BAR (widget->parent));
entry_text = nautilus_navigation_bar_get_location (NAUTILUS_NAVIGATION_BAR (widget->parent));
switch (info) {
case NAUTILUS_DND_URI_LIST:
......@@ -194,22 +188,6 @@ drag_data_get_callback (GtkWidget *widget,
g_free (entry_text);
}
static void
editable_activated_callback (GtkEditable *editable,
NautilusLocationBar *bar)
{
gchar *uri;
g_assert (GTK_IS_EDITABLE (editable));
g_assert (NAUTILUS_IS_LOCATION_BAR (bar));
uri = nautilus_location_bar_get_location (NAUTILUS_LOCATION_BAR (bar));
nautilus_navigation_bar_location_changed (NAUTILUS_NAVIGATION_BAR (bar),
uri);
g_free (uri);
}
/* utility routine to determine the string to expand to. If we don't have anything yet, accept
the whole string, otherwise accept the largest part common to both */
......@@ -396,6 +374,7 @@ nautilus_location_bar_initialize_class (NautilusLocationBarClass *class)
navigation_bar_class = NAUTILUS_NAVIGATION_BAR_CLASS (class);
navigation_bar_class->get_location = nautilus_location_bar_get_location;
navigation_bar_class->set_location = nautilus_location_bar_set_location;
}
......@@ -420,8 +399,8 @@ nautilus_location_bar_initialize (NautilusLocationBar *bar)
GNOME_PAD_SMALL);
entry = nautilus_entry_new ();
gtk_signal_connect (GTK_OBJECT (entry), "activate",
editable_activated_callback, bar);
gtk_signal_connect_object (GTK_OBJECT (entry), "activate",
nautilus_navigation_bar_location_changed, GTK_OBJECT (bar));
/* The callback uses the marshal interface directly
* so it can both read and write the return value.
......@@ -471,7 +450,7 @@ nautilus_location_bar_set_location (NautilusNavigationBar *navigation_bar,
const char *location)
{
NautilusLocationBar *bar;
gchar *formatted_location;
char *formatted_location;
g_assert (location != NULL);
......@@ -499,10 +478,13 @@ nautilus_location_bar_set_location (NautilusNavigationBar *navigation_bar,
*
**/
static gchar *
nautilus_location_bar_get_location (NautilusLocationBar *bar)
static char *
nautilus_location_bar_get_location (NautilusNavigationBar *navigation_bar)
{
gchar *user_location, *best_uri;
NautilusLocationBar *bar;
char *user_location, *best_uri;
bar = NAUTILUS_LOCATION_BAR (navigation_bar);
user_location = gtk_editable_get_chars (GTK_EDITABLE (bar->entry), 0, -1);
best_uri = nautilus_make_uri_from_input (user_location);
......
......@@ -23,7 +23,6 @@
*/
#include <config.h>
#include "nautilus-navigation-bar.h"
#include <gtk/gtksignal.h>
......@@ -40,23 +39,15 @@ static void nautilus_navigation_bar_initialize (NautilusNavigationBar
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusNavigationBar, nautilus_navigation_bar, NAUTILUS_TYPE_GENEROUS_BIN)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (nautilus_navigation_bar, get_location)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (nautilus_navigation_bar, set_location)
static void
destroy (GtkObject *object)
{
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
static void
nautilus_navigation_bar_initialize_class (NautilusNavigationBarClass *klass)
{
GtkObjectClass *object_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = destroy;
signals[LOCATION_CHANGED]
= gtk_signal_new ("location_changed",
......@@ -64,11 +55,12 @@ nautilus_navigation_bar_initialize_class (NautilusNavigationBarClass *klass)
object_class->type,
GTK_SIGNAL_OFFSET (NautilusNavigationBarClass,
location_changed),
gtk_marshal_NONE__STRING,
GTK_TYPE_NONE, 1, GTK_TYPE_STRING);
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
gtk_object_class_add_signals (object_class, signals, LAST_SIGNAL);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, nautilus_navigation_bar, get_location);
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, nautilus_navigation_bar, set_location);
}
......@@ -77,8 +69,21 @@ nautilus_navigation_bar_initialize (NautilusNavigationBar *bar)
{
}
/**
* nautilus_navigation_bar_get_location
*
* Change the location displayed in the navigation bar.
*
* @bar: A NautilusNavigationBar.
* @location: The uri that should be displayed.
*/
char *
nautilus_navigation_bar_get_location (NautilusNavigationBar *bar)
{
g_return_val_if_fail (NAUTILUS_IS_NAVIGATION_BAR (bar), NULL);
return (* NAUTILUS_NAVIGATION_BAR_CLASS (GTK_OBJECT (bar)->klass)->get_location) (bar);
}
/**
* nautilus_navigation_bar_set_location
......@@ -97,15 +102,16 @@ nautilus_navigation_bar_set_location (NautilusNavigationBar *bar,
(* NAUTILUS_NAVIGATION_BAR_CLASS (GTK_OBJECT (bar)->klass)->set_location) (bar, location);
}
void
nautilus_navigation_bar_location_changed (NautilusNavigationBar *bar,
const char *location)
nautilus_navigation_bar_location_changed (NautilusNavigationBar *bar)
{
char *location;
g_return_if_fail (NAUTILUS_IS_NAVIGATION_BAR (bar));
location = nautilus_navigation_bar_get_location (bar);
gtk_signal_emit (GTK_OBJECT (bar),
signals[LOCATION_CHANGED],
location);
g_free (location);
}
......@@ -35,7 +35,7 @@
#define NAUTILUS_IS_NAVIGATION_BAR(obj) \
GTK_CHECK_TYPE (obj, NAUTILUS_TYPE_NAVIGATION_BAR)
typedef struct NautilusNavigationBar {
typedef struct {
NautilusGenerousBin parent;
} NautilusNavigationBar;
......@@ -43,23 +43,22 @@ typedef struct {
NautilusGenerousBinClass parent_class;
/* signals */
void (*location_changed) (NautilusNavigationBar *navigation_bar,
const char *location);
void (* location_changed) (NautilusNavigationBar *bar,
const char *location);
/* virtual methods */
void (*set_location) (NautilusNavigationBar *navigation_bar,
const char *location);
char * (* get_location) (NautilusNavigationBar *bar);
void (* set_location) (NautilusNavigationBar *bar,
const char *location);
} NautilusNavigationBarClass;
GtkType nautilus_navigation_bar_get_type (void);
void nautilus_navigation_bar_set_location (NautilusNavigationBar *bar,
const char *location);
GtkType nautilus_navigation_bar_get_type (void);
char * nautilus_navigation_bar_get_location (NautilusNavigationBar *bar);
void nautilus_navigation_bar_set_location (NautilusNavigationBar *bar,
const char *location);
/* `protected' function meant to be used by subclasses to emit the `location_changed' signal */
void nautilus_navigation_bar_location_changed (NautilusNavigationBar *bar,
const char *location);
void nautilus_navigation_bar_location_changed (NautilusNavigationBar *bar);
#endif /* NAUTILUS_NAVIGATION_BAR_H */
......@@ -195,8 +195,8 @@ nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
static void
goto_uri_callback (GtkWidget *widget,
const char *uri,
GtkWidget *window)
const char *uri,
GtkWidget *window)
{
nautilus_window_goto_uri (NAUTILUS_WINDOW (window), uri);
}
......
......@@ -195,8 +195,8 @@ nautilus_window_goto_uri (NautilusWindow *window, const char *uri)
static void
goto_uri_callback (GtkWidget *widget,
const char *uri,
GtkWidget *window)
const char *uri,
GtkWidget *window)
{
nautilus_window_goto_uri (NAUTILUS_WINDOW (window), uri);
}
......
......@@ -25,94 +25,24 @@
#include <config.h>
#include "nautilus-search-bar.h"
#include "nautilus-simple-search-bar.h"
#include "nautilus-complex-search-bar.h"
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkeventbox.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libnautilus-extensions/nautilus-gtk-macros.h>
#include <libnautilus-extensions/nautilus-entry.h>
#include <libnautilus-extensions/nautilus-global-preferences.h>
#include <libnautilus-extensions/nautilus-directory.h>
static void nautilus_search_bar_initialize_class (NautilusSearchBarClass *class);
static void nautilus_search_bar_initialize (NautilusSearchBar *bar);
/* FIXME: This adds nothing to NautilusNavigationBar.
* Perhaps we can remove it.
*/
static void nautilus_search_bar_set_location (NautilusNavigationBar *navigation_bar,
const char *location);
static void nautilus_search_bar_initialize_class (NautilusSearchBarClass *class);
static void nautilus_search_bar_initialize (NautilusSearchBar *bar);
NAUTILUS_DEFINE_CLASS_BOILERPLATE (NautilusSearchBar, nautilus_search_bar, NAUTILUS_TYPE_NAVIGATION_BAR)
NAUTILUS_IMPLEMENT_MUST_OVERRIDE_SIGNAL (nautilus_search_bar, set_search_controls)
static void
destroy (GtkObject *object)
{
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
}
GtkWidget *
nautilus_search_bar_new (void)
{
return gtk_widget_new (NAUTILUS_TYPE_SEARCH_BAR, NULL);
}
static void
nautilus_search_bar_initialize_class (NautilusSearchBarClass *klass)
{
GtkObjectClass *object_class;
NautilusNavigationBarClass *navigation_bar_class;
object_class = GTK_OBJECT_CLASS (klass);
object_class->destroy = destroy;
navigation_bar_class = NAUTILUS_NAVIGATION_BAR_CLASS (klass);
navigation_bar_class->set_location = nautilus_search_bar_set_location;
NAUTILUS_ASSIGN_MUST_OVERRIDE_SIGNAL (klass, nautilus_search_bar, set_search_controls);
}
static void
nautilus_search_bar_initialize (NautilusSearchBar *bar)
{
}
static void
nautilus_search_bar_set_location (NautilusNavigationBar *navigation_bar,
const char *location)
{
NautilusSearchBar *search_bar;
search_bar = NAUTILUS_SEARCH_BAR (navigation_bar);
(* NAUTILUS_SEARCH_BAR_CLASS (GTK_OBJECT (search_bar)->klass)->set_search_controls)
(search_bar, location);
}
/* This is here for children (nautilus-switchable-search-bar, for one)
to use */
void
nautilus_search_bar_set_search_controls (NautilusSearchBar *search_bar,
const char *location)
{
(* NAUTILUS_SEARCH_BAR_CLASS (GTK_OBJECT (search_bar)->klass)->set_search_controls)
(search_bar, location);
}
......@@ -41,28 +41,14 @@
#define NAUTILUS_IS_SEARCH_BAR(obj) \
GTK_CHECK_TYPE (obj, NAUTILUS_TYPE_SEARCH_BAR)
typedef struct NautilusSearchBarDetails NautilusSearchBarDetails;
typedef struct NautilusSearchBar {
typedef struct {
NautilusNavigationBar parent;
} NautilusSearchBar;
typedef struct {
NautilusNavigationBarClass parent_class;
/* virtual method */
void (*set_search_controls) (NautilusSearchBar *search_bar,
const char *location);
} NautilusSearchBarClass;
GtkType nautilus_search_bar_get_type (void);
GtkWidget* nautilus_search_bar_new (void);
GtkType nautilus_search_bar_get_type (void);
void nautilus_search_bar_set_search_controls (NautilusSearchBar *search_bar,
const char *location);
/* FIXME:Do we need a protected location_changed function here too? */
#endif /* NAUTILUS_SEARCH_BAR_H */
......@@ -22,83 +22,51 @@
Author: Rebecca Schulman <rebecka@eazel.com>
*/
#include "nautilus-search-bar.h"
#include "nautilus-switchable-search-bar.h"
#include <config.h>
#include "nautilus-simple-search-bar.h"
#include <glib.h>
#include <gtk/gtkentry.h>
#include <gtk/gtkeventbox.h>
#include <libnautilus-extensions/nautilus-gtk-macros.h>
#include <libnautilus-extensions/nautilus-search-uri.h>
struct NautilusSimpleSearchBarDetails {
GtkEntry *entry;
gchar undo_text;
gboolean undo_registered;
GtkEntry *entry;
};
static char *nautilus_simple_search_bar_get_location (NautilusNavigationBar *bar);
static void nautilus_simple_search_bar_set_location (NautilusNavigationBar *bar,
const char *location);
static void nautilus_simple_search_bar_initialize_class (NautilusSimpleSearchBarClass *class);
static void nautilus_simple_search_bar_initialize (NautilusSimpleSearchBar *bar);
static char * nautilus_simple_search_bar_get_location (NautilusSimpleSearchBar *bar);
static void nautilus_simple_search_bar_set_search_controls (NautilusSearchBar *bar,
const char *location);