summaryrefslogtreecommitdiff
path: root/src/nautilus-search-bar.c
diff options
context:
space:
mode:
authorMaciej Stachowiak <mstachow@src.gnome.org>2000-06-16 16:33:36 +0000
committerMaciej Stachowiak <mstachow@src.gnome.org>2000-06-16 16:33:36 +0000
commita5fa2e8a5116d195e000dfbec17f38162ac75a7c (patch)
tree164dc8fc8cca1aeac03f273a49d21fd011a6e890 /src/nautilus-search-bar.c
parent9c7276fd4a51ce959b0a2d3c20db539e6b8ebfab (diff)
downloadnautilus-a5fa2e8a5116d195e000dfbec17f38162ac75a7c.tar.gz
Task 1351: implement controllers to allow location bar and the
search/browse button * src/nautilus-location-bar.h, src/nautilus-location-bar.c: Factored this into two classes, NautilusNavigationBar, a class that defines the abstract interface (the set_location function and the location_changed signal), and NautilusLocationBar, a concrete implementation that works like the previous location bar. (nautilus_location_bar_set_location, nautilus_location_bar_get_location): Made static. Made `nautilus_location_bar_set_location' the handler for the set_location virtual method. * src/nautilus-navigation-bar.h, src/nautilus-navigation-bar.c: Abstract superclass for navigation bars. * src/nautilus-search-bar.h, src/nautilus-search-bar.c: New subclass of NautilusNavigationBar. Contains placeholder widgets for now, will eventually be the search bar. * src/nautilus-switchable-navigation-bar.h, src/nautilus-switchable-navigation-bar.c: New subclass of NautilusNavigationBar that allows switching between the location bar and the search bar. * src/nautilus-window.h: Rename `ent_uri' member of the window struct to `navigation_bar'. * src/nautilus-window.c (nautilus_window_navigation_bar_mode_changed_callback): Callback to sync the "search" toggle button to the mode of the switchable navigation bar. (nautilus_window_constructed): Create a NautilusSwitchableNavigationBar instead of a NautilusLocationBar. (nautilus_window_set_search_mode): New function to be used by the search toggle button callback; simply sets the mode of the switchable navigation bar appropriately. * src/nautilus-window-toolbars.c: Made Search button a toggle button. (toolbar_search_callback): Call `nautilus_window_set_search_mode'. * src/nautilus-window-manage-views.c (nautilus_window_update_internals, nautilus_window_end_location_change_callback): Use NautlusNavigationBar calls instead of NautilusLocationBar ones. * src/Makefile.am: Add new files to the build, and split all headers into noinst_HEADERS out from the nautilus_SOURCES variable.
Diffstat (limited to 'src/nautilus-search-bar.c')
-rw-r--r--src/nautilus-search-bar.c95
1 files changed, 95 insertions, 0 deletions
diff --git a/src/nautilus-search-bar.c b/src/nautilus-search-bar.c
new file mode 100644
index 000000000..25cec7c9d
--- /dev/null
+++ b/src/nautilus-search-bar.c
@@ -0,0 +1,95 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
+/* nautilus-search-bar.c - Search bar for Nautilus
+
+ Copyright (C) 2000 Eazel, Inc.
+
+ 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; see the file COPYING. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA.
+
+ Author: Maciej Stachowiak <mjs@eazel.com>
+*/
+
+#include <config.h>
+#include "nautilus-search-bar.h"
+
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-i18n.h>
+
+#include <gtk/gtklabel.h>
+
+#include <libnautilus-extensions/nautilus-gtk-macros.h>
+
+static void nautilus_search_bar_set_location (NautilusNavigationBar *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)
+
+
+static void
+destroy (GtkObject *object)
+{
+ NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
+}
+
+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;
+}
+
+static void
+nautilus_search_bar_initialize (NautilusSearchBar *bar)
+{
+ GtkWidget *label;
+
+ /* FIXME: set up the widgetry here. */
+
+ label = gtk_label_new (_("The search bar goes here"));
+
+ gtk_widget_show (label);
+
+ gtk_container_add (GTK_CONTAINER (bar), label);
+}
+
+
+GtkWidget *
+nautilus_search_bar_new (void)
+{
+ return gtk_widget_new (nautilus_search_bar_get_type (), NULL);
+}
+
+
+static void
+nautilus_search_bar_set_location (NautilusNavigationBar *bar,
+ const char *location)
+{
+ /* FIXME: should check if URI is search URI, and if so,
+ set up the controls properly. */
+}
+