Commit 6efd7c1b authored by Darin Adler's avatar Darin Adler

Some build fixes.

	* acconfig.h:
	* configure.in:
	Removed the NAUTILUS_PREFIX that I added. I did it wrong.

	* libnautilus-extensions/nautilus-file-utilities.h:
	* libnautilus-extensions/nautilus-file-utilities.c:
	(nautilus_pixmap_file):
	* components/hardware/nautilus-hardware-view.c:
	(setup_overview_form):
	* components/services/startup/nautilus-view/nautilus-service-startup-view.c:
	(setup_form_title), (setup_signup_form), (setup_config_form):
	* libnautilus-extensions/nautilus-icon-canvas-item.c: (map_pixbuf):
	* libnautilus-extensions/nautilus-icon-factory.c:
	(make_full_icon_path):
	* src/nautilus-application.c: (display_caveat):
	* src/nautilus-property-browser.c:
	(nautilus_property_browser_initialize),
	(nautilus_emblem_dialog_new), (make_category_link):
	* src/nautilus-zoom-control.c: (nautilus_zoom_control_initialize):
	Replaced most uses of gnome_pixmap_file on "nautilus/"
	with a call to a new nautilus_pixmap_file in an attempt to
	make installations where nautilus has a different prefix
	from gnome-libs work. I now think this is a waste of time,
	but Mathieu Lacage says this is still an improvement.

	* components/help/Makefile.am:
	* components/help/hyperbola-filefmt.c: (fmt_map_entry):
	Use HYPERBOLA_DATADIR instead of NAUTILUS_PREFIX.

	* components/websearch/ntl-web-search.c:
	(web_search_populate_engines):
	Use WEB_SEARCH_DATADIR instead of NAUTILUS_PREFIX.

	* components/mozilla/nautilus-mozilla-content-view.c:
	(nautilus_mozilla_content_view_initialize),
	(mozilla_content_view_set_busy_cursor),
	(mozilla_content_view_request_progress_change),
	(mozilla_content_view_clear_busy_cursor),
	(mozilla_load_location_callback), (bonobo_mozilla_callback),
	(mozilla_merge_bonobo_items_callback),
	(mozilla_title_changed_callback),
	(mozilla_location_changed_callback), (mozilla_net_status_callback),
	(mozilla_link_message_callback), (mozilla_progress_callback),
	(mozilla_open_uri_callback):
	Took a cut at fixing the Mozilla component for the new API.
	Ramiro will have to take care of the rest.

	* components/services/install/lib/Makefile.am:
	* components/services/time/command-line/Makefile.am:
	* components/services/time/nautilus-view/Makefile.am:
	* components/services/time/service/Makefile.am:
	* components/services/trilobite/libtrilobite/Makefile.am:
	* components/services/trilobite/sample/command-line/Makefile.am:
	* components/services/trilobite/sample/service/Makefile.am:
	* libnautilus/Makefile.am:
	Updated all ORBit IDL compiles to use IDL_CFLAGS as suggested
	in the form of a patch by Martijn van Beers.

	* libnautilus-extensions/Makefile.am:
	* libnautilus-extensions/nautilus-file-utilities.c:
	(nautilus_get_user_main_directory),
	(nautilus_get_pixmap_directory):
	* libnautilus-extensions/nautilus-link-set.c:
	(get_link_set_document):
	* src/Makefile.am:
	* src/nautilus-property-browser.c:
	(nautilus_property_browser_drag_data_get), (make_drag_image),
	(get_xml_path), (make_properties_from_directory):
	* src/nautilus-link-set-window.c: (get_link_set_names):
	* src/file-manager/Makefile.am:
	* src/file-manager/fm-properties-window.c: (get_property_names):
	Used NAUTILUS_DATADIR and DATADIR instead of NAUTILUS_PREFIX.

	* libnautilus-extensions/nautilus-file-utilities.h:
	* libnautilus-extensions/nautilus-file-utilities.c:
	(nautilus_get_uri_from_local_path): Added a new helper function for
	use when you have a path and need a URI. This does a better job
	than just adding a "file://" on the front.

	* libnautilus-extensions/nautilus-gtk-extensions.h:
	* libnautilus-extensions/nautilus-gtk-extensions.c:
	(get_first_callback), (nautilus_gtk_container_get_first_child):
	* src/nautilus-window-toolbars.c: (setup_button):
	* src/nautilus-window.c:
	(replace_special_current_view_in_content_view_menu):
	Implemented the first_child function and used it where appropriate.

	* libnautilus-extensions/nautilus-preferences-item.c:
	(add_icon_themes): Use nautilus_get_pixmap_directory intead of
	misusing gnome_pixmap_file by calling it on a directory name.

	* nautilus-installer/src/support.c: (create_pixmap),
	(create_image): Added FIXMEs since it isn't clear if this code
	will work with a Nautilus prefix that's not the same as the
	gnome-libs prefix.

	* Makefile.am: Tweaked white space.
parent 9f8da03d
......@@ -6,4 +6,3 @@
#undef HAVE_PAM
#undef HAVE_RPM
#undef HAVE_STPCPY
#undef NAUTILUS_PREFIX
......@@ -330,8 +330,8 @@ static void setup_overview_form(NautilusHardwareView *view)
gtk_box_pack_start (GTK_BOX (container_box), temp_box, 0, 0, 24);
gtk_widget_show (temp_box);
file_name = gnome_pixmap_file ("nautilus/cpu.png");
temp_widget = GTK_WIDGET (gnome_pixmap_new_from_file (file_name));
file_name = nautilus_pixmap_file ("cpu.png");
temp_widget = GTK_WIDGET (gnome_pixmap_new_from_file (file_name));
gtk_box_pack_start(GTK_BOX(temp_box), temp_widget, 0, 0, 0);
gtk_widget_show(temp_widget);
g_free (file_name);
......@@ -351,7 +351,7 @@ static void setup_overview_form(NautilusHardwareView *view)
gtk_box_pack_start (GTK_BOX (container_box), temp_box, 0, 0, 24);
gtk_widget_show (temp_box);
file_name = gnome_pixmap_file ("nautilus/memory_chip.gif");
file_name = nautilus_pixmap_file ("memory_chip.gif");
temp_widget = GTK_WIDGET (gnome_pixmap_new_from_file (file_name));
gtk_box_pack_start(GTK_BOX(temp_box), temp_widget, 0, 0, 0);
gtk_widget_show(temp_widget);
......
......@@ -271,14 +271,14 @@ fmt_map_entry(HyperbolaDocTree *tree, const char *name, char section)
/* Because mapping entries are prepended, we have to read the items in reverse order of preference */
tmapfile = NAUTILUS_PREFIX "/share/hyperbola/maps/pages.map";
tmapfile = HYPERBOLA_DATADIR "/maps/pages.map";
fmt_read_mapping(tinfo, g_file_exists(tmapfile)?tmapfile:"pages.map");
for(cur = langlist = g_list_reverse(g_list_copy(gnome_i18n_get_language_list(NULL)));
cur; cur = cur->next)
{
g_snprintf(mapfile, sizeof(mapfile),
NAUTILUS_PREFIX "/share/hyperbola/maps/pages.map.%s",
HYPERBOLA_DATADIR "/maps/pages.map.%s",
(char *)cur->data);
fmt_read_mapping(tinfo, g_file_exists(mapfile)?mapfile:g_basename(mapfile));
}
......
......@@ -50,8 +50,8 @@ struct NautilusMozillaContentViewDetails {
static void nautilus_mozilla_content_view_initialize_class (NautilusMozillaContentViewClass *klass);
static void nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view);
static void nautilus_mozilla_content_view_destroy (GtkObject *object);
static void mozilla_notify_location_change_callback (NautilusView *nautilus_view,
Nautilus_NavigationInfo *navinfo,
static void mozilla_load_location_callback (NautilusView *nautilus_view,
const char *location,
NautilusMozillaContentView *view);
static void mozilla_merge_bonobo_items_callback (BonoboObject *control,
gboolean state,
......@@ -78,14 +78,8 @@ static gint mozilla_open_uri_callback (GtkMozEmbed
/* Other mozilla content view functions */
static void mozilla_content_view_set_busy_cursor (NautilusMozillaContentView *view);
static void mozilla_content_view_clear_busy_cursor (NautilusMozillaContentView *view);
static void mozilla_content_view_request_progress_change (NautilusMozillaContentView *view,
Nautilus_ProgressType progress_type,
gdouble progress_amount);
static void mozilla_content_view_request_location_change (NautilusMozillaContentView *view,
const char *new_location_uri);
static gboolean mozilla_is_uri_handled_by_nautilus (const char *uri);
static GtkVBoxClass *parent_class = NULL;
static void
......@@ -148,8 +142,8 @@ nautilus_mozilla_content_view_initialize (NautilusMozillaContentView *view)
view->details->nautilus_view = nautilus_view_new (GTK_WIDGET (view));
gtk_signal_connect (GTK_OBJECT (view->details->nautilus_view),
"notify_location_change",
GTK_SIGNAL_FUNC (mozilla_notify_location_change_callback),
"load_location",
GTK_SIGNAL_FUNC (mozilla_load_location_callback),
view);
/*
......@@ -231,7 +225,6 @@ nautilus_mozilla_content_view_load_uri (NautilusMozillaContentView *view,
static void
mozilla_content_view_set_busy_cursor (NautilusMozillaContentView *view)
{
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (view));
if (!view->details->busy_cursor) {
......@@ -249,12 +242,11 @@ mozilla_content_view_set_busy_cursor (NautilusMozillaContentView *view)
static void
mozilla_content_view_request_progress_change (NautilusMozillaContentView *view,
Nautilus_ProgressType progress_type,
gdouble progress_amount)
Nautilus_ProgressType progress_type,
gdouble progress_amount)
{
Nautilus_ProgressRequestInfo progress_request;
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (view));
memset (&progress_request, 0, sizeof (progress_request));
......@@ -266,28 +258,9 @@ mozilla_content_view_request_progress_change (NautilusMozillaContentView *view,
&progress_request);
}
static void
mozilla_content_view_request_location_change (NautilusMozillaContentView *view,
const char *new_uri)
{
Nautilus_NavigationRequestInfo navigation_request;
g_assert (view != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (view));
g_assert (new_uri != NULL);
memset (&navigation_request, 0, sizeof (navigation_request));
navigation_request.requested_uri = (char *) new_uri;
nautilus_view_request_location_change (view->details->nautilus_view,
&navigation_request);
}
static void
mozilla_content_view_clear_busy_cursor (NautilusMozillaContentView *view)
{
g_return_if_fail (view != NULL);
g_return_if_fail (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (view));
g_assert (GTK_WIDGET_REALIZED (GTK_WIDGET (view->details->mozilla)));
......@@ -296,43 +269,15 @@ mozilla_content_view_clear_busy_cursor (NautilusMozillaContentView *view)
}
static void
mozilla_notify_location_change_callback (NautilusView *nautilus_view,
Nautilus_NavigationInfo *navinfo,
NautilusMozillaContentView *view)
mozilla_load_location_callback (NautilusView *nautilus_view,
const char *location,
NautilusMozillaContentView *view)
{
g_assert (nautilus_view == view->details->nautilus_view);
g_assert (navinfo != NULL);
if (navinfo->self_originated) {
#ifdef DEBUG_ramiro
g_print ("ignoring self_originating location change for '%s'\n", navinfo->actual_uri);
#endif
return;
}
/*
* It's mandatory to send a PROGRESS_UNDERWAY message once the
* component starts loading, otherwise nautilus will assume it
* failed. In a real component, this will probably happen in
* some sort of callback from whatever loading mechanism it is
* using to load the data; this component loads no data, so it
* gives the progrss update here.
*/
mozilla_content_view_request_progress_change (view, Nautilus_PROGRESS_UNDERWAY, 0.0);
/* Do the actual load. */
mozilla_content_view_report_load_underway (view);
nautilus_mozilla_content_view_load_uri (view, navinfo->actual_uri);
/*
* It's mandatory to send a PROGRESS_DONE_OK message once the
* component is done loading successfully, or
* PROGRESS_DONE_ERROR if it completes unsuccessfully. In a
* real component, this will probably happen in some sort of
* callback from whatever loading mechanism it is using to
* load the data; this component loads no data, so it gives
* the progrss upodate here.
*/
mozilla_content_view_request_progress_change (view, Nautilus_PROGRESS_DONE_OK, 100.0);
mozilla_content_view_report_load_complete (view);
}
static void
......@@ -341,8 +286,6 @@ bonobo_mozilla_callback (BonoboUIHandler *ui_handler, gpointer user_data, const
NautilusMozillaContentView *view;
char *label_text;
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
if (strcmp (path, "/File/Mozilla") == 0) {
......@@ -364,8 +307,6 @@ mozilla_merge_bonobo_items_callback (BonoboObject *control, gboolean state, gpoi
NautilusMozillaContentView *view;
BonoboUIHandler *local_ui_handler;
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
local_ui_handler = bonobo_control_get_ui_handler (BONOBO_CONTROL (control));
......@@ -429,19 +370,14 @@ mozilla_title_changed_callback (GtkMozEmbed *mozilla, gpointer user_data)
NautilusMozillaContentView *view;
char *new_title;
g_assert (mozilla != NULL);
g_assert (GTK_IS_MOZ_EMBED (mozilla));
g_assert (user_data != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla));
new_title = gtk_moz_embed_get_title (GTK_MOZ_EMBED (view->details->mozilla));
nautilus_view_request_title_change (view->details->nautilus_view,
new_title);
nautilus_view_set_title (view->details->nautilus_view,
new_title);
g_free (new_title);
}
......@@ -452,11 +388,6 @@ mozilla_location_changed_callback (GtkMozEmbed *mozilla, gpointer user_data)
NautilusMozillaContentView *view;
char *new_location;
g_assert (mozilla != NULL);
g_assert (GTK_IS_MOZ_EMBED (mozilla));
g_assert (user_data != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla));
......@@ -467,7 +398,8 @@ mozilla_location_changed_callback (GtkMozEmbed *mozilla, gpointer user_data)
g_print ("mozilla_location_changed_callback (%s)\n", new_location);
#endif
mozilla_content_view_request_location_change (view, new_location);
nautilus_view_report_location_change
(view->details->nautilus_view, new_location);
g_free (new_location);
}
......@@ -477,11 +409,6 @@ mozilla_net_status_callback (GtkMozEmbed *mozilla, gint flags, gpointer user_dat
{
NautilusMozillaContentView *view;
g_assert (mozilla != NULL);
g_assert (GTK_IS_MOZ_EMBED (mozilla));
g_assert (user_data != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla));
......@@ -577,26 +504,15 @@ static void
mozilla_link_message_callback (GtkMozEmbed *mozilla, gpointer user_data)
{
NautilusMozillaContentView *view;
Nautilus_StatusRequestInfo status_request;
char *link_message;
g_assert (mozilla != NULL);
g_assert (GTK_IS_MOZ_EMBED (mozilla));
g_assert (user_data != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla));
link_message = gtk_moz_embed_get_link_message (GTK_MOZ_EMBED (view->details->mozilla));
memset (&status_request, 0, sizeof (status_request));
status_request.status_string = link_message;
nautilus_view_request_status_change (view->details->nautilus_view,
&status_request);
nautilus_view_report_status (view->details->nautilus_view,
link_message);
g_free (link_message);
}
......@@ -607,15 +523,9 @@ mozilla_progress_callback (GtkMozEmbed *mozilla,
gpointer user_data)
{
NautilusMozillaContentView *view;
gdouble percent;
gdouble fraction;
g_assert (mozilla != NULL);
g_assert (GTK_IS_MOZ_EMBED (mozilla));
g_assert (user_data != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla));
#ifdef DEBUG_ramiro
......@@ -624,13 +534,12 @@ mozilla_progress_callback (GtkMozEmbed *mozilla,
/* The check for 0.0 is just anal paranoia on my part */
if (max_progress == 0.0) {
percent = 100.0;
}
else {
percent = current_progress / max_progress;
fraction = 1.0;
} else {
fraction = current_progress / max_progress;
}
mozilla_content_view_request_progress_change (view, Nautilus_PROGRESS_UNDERWAY, percent);
nautilus_view_report_load_progress (view->details->nautilus_view, fraction);
}
static gint
......@@ -642,11 +551,6 @@ mozilla_open_uri_callback (GtkMozEmbed *mozilla,
NautilusMozillaContentView *view;
g_assert (mozilla != NULL);
g_assert (GTK_IS_MOZ_EMBED (mozilla));
g_assert (user_data != NULL);
g_assert (NAUTILUS_IS_MOZILLA_CONTENT_VIEW (user_data));
view = NAUTILUS_MOZILLA_CONTENT_VIEW (user_data);
g_assert (GTK_MOZ_EMBED (mozilla) == GTK_MOZ_EMBED (view->details->mozilla));
......@@ -661,8 +565,8 @@ mozilla_open_uri_callback (GtkMozEmbed *mozilla,
#endif
/* Let nautilus grok the uri instead */
if (abort_uri_open == TRUE) {
mozilla_content_view_request_location_change (view, uri);
if (abort_uri_open) {
nautilus_view_open_location (view->details->nautilus_view, uri);
}
return abort_uri_open;
......
......@@ -57,7 +57,7 @@ IDLDIR = $(top_srcdir)/components/services/install/idl
IDL = $(IDLDIR)/trilobite-eazel-install.idl
trilobite-eazel-install.h: $(IDL)
$(ORBIT_IDL) -I $(IDLDIR) -I${datadir}/idl $(IDL)
$(ORBIT_IDL) $(IDL_CFLAGS) -I$(IDLDIR) $(IDL)
eazel-install-object.c : trilobite-eazel-install.h
......
......@@ -473,7 +473,7 @@ setup_form_title (NautilusServicesContentView* view,
gtk_box_pack_start (GTK_BOX (view->details->form), temp_container, 0, 0, 4);
gtk_widget_show (temp_container);
file_name = gnome_pixmap_file ("nautilus/eazel-logo.gif");
file_name = nautilus_pixmap_file ("eazel-logo.gif");
temp_widget = GTK_WIDGET (gnome_pixmap_new_from_file (file_name));
gtk_box_pack_start (GTK_BOX(temp_container), temp_widget, 0, 0, 8);
gtk_widget_show (temp_widget);
......@@ -515,7 +515,7 @@ setup_signup_form(NautilusServicesContentView* view) {
temp_box = gtk_hbox_new (FALSE, 4);
gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, 0, 0, 12);
gtk_widget_show (temp_box);
file_name = gnome_pixmap_file ("nautilus/register.png");
file_name = nautilus_pixmap_file ("register.png");
temp_widget = GTK_WIDGET (gnome_pixmap_new_from_file (file_name));
gtk_box_pack_start (GTK_BOX (temp_box), temp_widget, 0, 0, 8);
gtk_widget_show (temp_widget);
......@@ -643,7 +643,7 @@ setup_config_form (NautilusServicesContentView* view) {
gtk_box_pack_start (GTK_BOX (view->details->form), temp_box, 0, 0, 12);
gtk_widget_show (temp_box);
file_name = gnome_pixmap_file ("nautilus/config-gather.png");
file_name = nautilus_pixmap_file ("config-gather.png");
temp_widget = GTK_WIDGET (gnome_pixmap_new_from_file (file_name));
gtk_box_pack_start (GTK_BOX (temp_box), temp_widget, 0, 0, 8);
gtk_widget_show (temp_widget);
......
......@@ -37,7 +37,7 @@ IDL = $(IDLDIR)/trilobite-eazel-time-service.idl
$(CORBA_GENERATED): trilobite_eazel_time_service_idl_stamp
trilobite_eazel_time_service_idl_stamp: $(IDL)
$(ORBIT_IDL) -I${datadir}/idl $(IDL)
$(ORBIT_IDL) $(IDL_CFLAGS) $(IDL)
touch trilobite_eazel_time_service_idl_stamp
main.c: $(CORBA_GENERATED)
......
......@@ -54,7 +54,7 @@ IDL = $(IDLDIR)/trilobite-eazel-time-service.idl
$(CORBA_GENERATED): trilobite_eazel_time_service_idl_stamp
trilobite_eazel_time_service_idl_stamp: $(IDL)
$(ORBIT_IDL) -I $(IDLDIR) -I${datadir}/idl $(IDL)
$(ORBIT_IDL) $(IDL_CFLAGS) -I$(IDLDIR) $(IDL)
touch trilobite_eazel_time_service_idl_stamp
trilobite-eazel-time-service.c main.c: $(CORBA_GENERATED)
......
......@@ -74,7 +74,7 @@ $(TRILOBITE_CORBA_GENERATED): trilobite-service.h
IDL = $(top_srcdir)/components/services/trilobite/idl/trilobite-service.idl
trilobite-service.h: $(IDL)
$(ORBIT_IDL) -I${datadir}/idl $(IDL)
$(ORBIT_IDL) $(IDL_CFLAGS) $(IDL)
CLEANFILES= $(TRILOBITE_CORBA_GENERATED) trilobite-service.h
......
......@@ -31,7 +31,7 @@ IDLDIR = $(top_srcdir)/components/services/trilobite/idl
IDL = $(IDLDIR)/sample-service.idl
sample-service.h: $(IDL)
$(ORBIT_IDL) -I${datadir}/idl $(IDL)
$(ORBIT_IDL) $(IDL_CFLAGS) $(IDL)
main.c: sample-service.h
......
......@@ -43,7 +43,7 @@ IDLDIR = $(top_srcdir)/components/services/trilobite/idl
IDL = $(IDLDIR)/sample-service.idl
sample-service.h: $(IDL)
$(ORBIT_IDL) -I $(IDLDIR) -I${datadir}/idl $(IDL)
$(ORBIT_IDL) $(IDL_CFLAGS) -I$(IDLDIR) $(IDL)
sample-service-impl.c: sample-service.h
......
......@@ -107,7 +107,7 @@ web_search_populate_engines(WebSearchView *hview)
FILE *fh;
char aline[LINE_MAX];
fh = fopen(NAUTILUS_PREFIX "/share/ntl-web-search/standard.eng", "r");
fh = fopen(WEB_SEARCH_DATADIR "/ntl-web-search/standard.eng", "r");
g_return_if_fail(fh);
while(fgets(aline, sizeof(aline), fh))
......
......@@ -39,17 +39,6 @@ if test "$GCC" = "yes"; then
fi
AC_SUBST(WERROR)
dnl prefix so Nautilus can find its installed files
if test "x$prefix" = "xNONE"; then
nautilus_prefix=${ac_default_prefix}
else
nautilus_prefix=${prefix}
fi
AC_DEFINE_UNQUOTED(NAUTILUS_PREFIX, "${nautilus_prefix}")
dnl ORBit
AM_PATH_ORBIT
......@@ -192,7 +181,7 @@ AC_MSG_ERROR([
*** is always available from ftp://ftp.gtk.org/.]))
AM_PATH_GNOME(1.0.0,,AC_MSG_ERROR([*** GNOME 1.0.0 or better is
required.]), gnomecanvaspixbuf bonobo vfs)
required.]), gnomecanvaspixbuf bonobo vfs idl)
AC_SUBST(GNOMECANVASPIXBUF_LIBS)
AC_SUBST(GNOMECANVASPIXBUF_INCLUDEDIR)
AC_SUBST(GNORBA_CFLAGS)
......@@ -201,6 +190,7 @@ AC_SUBST(BONOBO_CFLAGS)
AC_SUBST(BONOBO_LIBS)
AC_SUBST(VFS_CFLAGS)
AC_SUBST(VFS_LIBS)
AC_SUBST(IDL_CFLAGS)
AM_PATH_OAF(0.1.0)
......
......@@ -2,7 +2,9 @@ NULL=
lib_LTLIBRARIES=libnautilus-extensions.la
INCLUDES= -I$(top_srcdir) -I$(top_builddir) -I$(top_builddir)/libnautilus -I. \
INCLUDES = \
-I$(top_srcdir) \
-I$(top_builddir) \
$(GNOME_CFLAGS) \
$(BONOBO_CFLAGS) \
$(OAF_CFLAGS) \
......@@ -11,7 +13,10 @@ INCLUDES= -I$(top_srcdir) -I$(top_builddir) -I$(top_builddir)/libnautilus -I. \
$(VFS_CFLAGS) \
$(XML_CFLAGS) \
$(WERROR) \
-D_REENTRANT
-D_REENTRANT \
-DDATADIR=\""$(datadir)"\" \
-DNAUTILUS_DATADIR=\""$(datadir)/nautilus"\" \
$(NULL)
libnautilus_extensions_la_LDFLAGS=\
$(GNOME_LIBS) \
......@@ -167,4 +172,3 @@ noinst_HEADERS = \
nautilus-view-identifier.h \
nautilus-xml-extensions.h \
$(NULL)
......@@ -117,8 +117,8 @@ char *
nautilus_make_path(const char *path, const char* name)
{
gboolean insert_separator;
gint path_length;
char *result;
int path_length;
char *result;
path_length = strlen (path);
insert_separator = path_length > 0 &&
......@@ -126,20 +126,20 @@ nautilus_make_path(const char *path, const char* name)
path[path_length - 1] != G_DIR_SEPARATOR;
if (insert_separator) {
result = g_strconcat(path, G_DIR_SEPARATOR_S, name, NULL);
result = g_strconcat (path, G_DIR_SEPARATOR_S, name, NULL);
} else {
result = g_strconcat(path, name, NULL);
result = g_strconcat (path, name, NULL);
}
return result;
}
/* FIXME bugzilla.eazel.com 1117: Change file-utilities.c to always create user
* directorie if needed. See bug for detail
* directories if needed. See bug for details.
*/
/**
* nautilus_user_directory:
* nautilus_get_user_directory:
*
* Get the path for the directory containing nautilus settings.
*
......@@ -164,7 +164,7 @@ nautilus_get_user_directory (void)
}
/**
* nautilus_desktop_directory:
* nautilus_get_desktop_directory:
*
* Get the path for the directory containing files on the desktop.
*
......@@ -188,7 +188,7 @@ nautilus_get_desktop_directory (void)
}
/**
* nautilus_user_main_directory:
* nautilus_get_user_main_directory:
*
* Get the path for the user's main Nautilus directory.
* Usually ~/Nautilus
......@@ -214,7 +214,7 @@ nautilus_get_user_main_directory (void)
* Is it OK to use cp like this? What about quoting the parameters?
*/
command = g_strdup_printf ("cp -R %s %s",
NAUTILUS_PREFIX "/share/nautilus/top",
NAUTILUS_DATADIR "/top",
user_main_directory);
/* FIXME bugzilla.eazel.com 1286:
......@@ -229,7 +229,7 @@ nautilus_get_user_main_directory (void)
/* assign a custom image for the directory icon */
file_uri = g_strdup_printf("file://%s", user_main_directory);
temp_str = gnome_pixmap_file ("nautilus/nautilus-logo.png");
temp_str = nautilus_pixmap_file ("nautilus-logo.png");
image_uri = g_strdup_printf("file://%s", temp_str);
g_free(temp_str);
......@@ -268,6 +268,19 @@ nautilus_get_user_main_directory (void)
return user_main_directory;
}
/**
* nautilus_get_pixmap_directory
*
* Get the path for the directory containing Nautilus pixmaps.
*
* Return value: the directory path.
**/
const char *
nautilus_get_pixmap_directory (void)
{
return DATADIR "/pixmaps/nautilus";
}
/**
* nautilus_get_local_path_from_uri:
*
......@@ -302,3 +315,41 @@ nautilus_get_local_path_from_uri (const char *uri)
return result;
}
/**
* nautilus_get_uri_from_local_path:
*
* Return a file:// URI for a local path.
*
* Return value: the URI (NULL for some bad errors).
**/
char *
nautilus_get_uri_from_local_path (const char *local_path)
{
char *escaped_path, *result;
g_return_val_if_fail (local_path != NULL, NULL);
g_return_val_if_fail (local_path[0] == '/', NULL);
escaped_path = gnome_vfs_escape_string (local_path, GNOME_VFS_URI_UNSAFE_PATH);
result = g_strconcat ("file://", escaped_path, NULL);
g_free (escaped_path);
return result;
}
/* FIXME: Callers just use this and dereference so we core dump if
* pixmaps are missing. That is lame.
*/
char *
nautilus_pixmap_file (const char *partial_path)
{
char *path;
path = nautilus_make_path (DATADIR "/pixmaps/nautilus", partial_path);
if (g_file_exists (path)) {
return path;
} else {
g_free (path);
return NULL;
}
}
......@@ -29,9 +29,28 @@ char * nautilus_format_uri_for_display (const char *uri);
char * nautilus_make_uri_from_input(const char *location);
char * nautilus_make_path (const char *path,
const char *name);
/* Return paths that don't need to be destroyed. We will probably
* change these to return ones that do need to be destroyed for
* consistency soon.
*/
const char *nautilus_get_user_directory (void);
const char *nautilus_get_user_main_directory (void);
const char *nautilus_get_desktop_directory (void);
const char *nautilus_get_pixmap_directory (void);
/* Turn a "file://" URI into a local path.
* Returns NULL if it's not a URI that can be converted.
*/
char * nautilus_get_local_path_from_uri (const char *uri);
/* Turn a path into a "file://" URI. */
char * nautilus_get_uri_from_local_path (const char *local_full_path);
/* A version of gnome's gnome_pixmap_file that works for the nautilus prefix.
* Otherwise similar to gnome_pixmap_file in that it checks to see if the file
* exists and returns NULL if it doesn't.
*/
char * nautilus_pixmap_file (const char *partial_path);
#endif /* NAUTILUS_FILE_UTILITIES_H */
......@@ -857,3 +857,41 @@ nautilus_gtk_signal_connect_full_while_alive (GtkObject *object,
GTK_SIGNAL_FUNC (alive_disconnecter),
info);
}
/**
* nautilus_gtk_container_get_first_child.
*
* Returns the first child of a container.
* @container: The container.
**/
static void
get_first_callback (GtkWidget *widget, gpointer callback_data)
{
GtkWidget **first_child_slot;
g_assert (GTK_IS_WIDGET (widget));
g_assert (callback_data != NULL);
first_child_slot = callback_data;
if (*first_child_slot == NULL) {
*first_child_slot = widget;
/* We'd stop the iterating now if we could. */
} else {
g_assert (GTK_IS_WIDGET (*first_child_slot));
}
}
GtkWidget *
nautilus_gtk_container_get_first_child (GtkContainer *container)
{
GtkWidget *first_child;
g_return_val_if_fail (GTK_IS_CONTAINER (container), NULL);
first_child = NULL;
gtk_container_foreach (container, get_first_callback, &first_child);