summaryrefslogtreecommitdiff
path: root/src/nautilus-switchable-navigation-bar.h
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-switchable-navigation-bar.h
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-switchable-navigation-bar.h')
-rw-r--r--src/nautilus-switchable-navigation-bar.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/nautilus-switchable-navigation-bar.h b/src/nautilus-switchable-navigation-bar.h
new file mode 100644
index 000000000..eeeeaac2d
--- /dev/null
+++ b/src/nautilus-switchable-navigation-bar.h
@@ -0,0 +1,69 @@
+/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
+
+/* nautilus-switchable-navigation-bar.h - Navigation bar for Nautilus
+ that allows switching between the location bar and the search bar
+
+ 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> */
+
+#ifndef NAUTILUS_SWITCHABLE_NAVIGATION_BAR_H
+#define NAUTILUS_SWITCHABLE_NAVIGATION_BAR_H
+
+#include "nautilus-navigation-bar.h"
+#include <gtk/gtkhbox.h>
+#include "nautilus-location-bar.h"
+#include "nautilus-search-bar.h"
+
+#define NAUTILUS_TYPE_SWITCHABLE_NAVIGATION_BAR (nautilus_switchable_navigation_bar_get_type ())
+#define NAUTILUS_SWITCHABLE_NAVIGATION_BAR(obj) \
+ GTK_CHECK_CAST (obj, NAUTILUS_TYPE_SWITCHABLE_NAVIGATION_BAR, NautilusSwitchableNavigationBar)
+#define NAUTILUS_SWITCHABLE_NAVIGATION_BAR_CLASS(klass) \
+ GTK_CHECK_CLASS_CAST (klass, NAUTILUS_TYPE_SWITCHABLE_NAVIGATION_BAR, NautilusSwitchableNavigationBarClass)
+#define NAUTILUS_IS_SWITCHABLE_NAVIGATION_BAR(obj) \
+ GTK_CHECK_TYPE (obj, NAUTILUS_TYPE_SWITCHABLE_NAVIGATION_BAR)
+
+typedef enum {
+ NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_LOCATION,
+ NAUTILUS_SWITCHABLE_NAVIGATION_BAR_MODE_SEARCH
+} NautilusSwitchableNavigationBarMode;
+
+
+typedef struct NautilusSwitchableNavigationBar {
+ NautilusNavigationBar parent;
+
+ NautilusSwitchableNavigationBarMode mode;
+
+ GtkWidget *location_bar;
+ GtkWidget *search_bar;
+} NautilusSwitchableNavigationBar;
+
+typedef struct {
+ NautilusNavigationBarClass parent_class;
+
+ void (*mode_changed) (NautilusSwitchableNavigationBar *switchable_navigation_bar,
+ NautilusSwitchableNavigationBarMode mode);
+} NautilusSwitchableNavigationBarClass;
+
+GtkType nautilus_switchable_navigation_bar_get_type (void);
+GtkWidget* nautilus_switchable_navigation_bar_new (void);
+void nautilus_switchable_navigation_bar_set_mode (NautilusSwitchableNavigationBar *switchable_navigation_bar,
+ NautilusSwitchableNavigationBarMode mode);
+
+
+#endif /* NAUTILUS_SWITCHABLE_NAVIGATION_BAR_H */