Commit 764d936a authored by Darin Adler's avatar Darin Adler
Browse files

reviewed by: John Sullivan <sullivan@eazel.com>

	Fix bug 6859 (GTK signal macros don't work in non-GCC compilers
	for void return types).

	* libnautilus-extensions/nautilus-gtk-macros.h:
	Replaced old macros that accidentally relied on gccisms with
	new ones that are portable to other compilers.

		NAUTILUS_CALL_PARENT_CLASS is replaced by
			NAUTILUS_CALL_PARENT
		    and NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE.

		NAUTILUS_CALL_VIRTUAL is replaced by
			NAUTILUS_CALL_METHOD
		    and NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE

	* components/adapter/nautilus-adapter-control-embed-strategy.c:
	(nautilus_adapter_control_embed_strategy_destroy):
	* components/adapter/nautilus-adapter-embed-strategy.c:
	(nautilus_adapter_embed_strategy_destroy),
	(nautilus_adapter_embed_strategy_get_widget),
	(nautilus_adapter_embed_strategy_get_zoomable):
	* components/adapter/nautilus-adapter-embeddable-embed-strategy.c:
	(nautilus_adapter_embeddable_embed_strategy_destroy):
	* components/adapter/nautilus-adapter-factory-server.c:
	(nautilus_adapter_factory_server_destroy):
	* components/adapter/nautilus-adapter-file-load-strategy.c:
	(nautilus_adapter_file_load_strategy_destroy):
	* components/adapter/nautilus-adapter-load-strategy.c:
	(nautilus_adapter_load_strategy_destroy),
	(nautilus_adapter_load_strategy_load_location),
	(nautilus_adapter_load_strategy_stop_loading):
	* components/adapter/nautilus-adapter-progressive-load-strategy.c:
	(nautilus_adapter_progressive_load_strategy_destroy):
	* components/adapter/nautilus-adapter-stream-load-strategy.c:
	(nautilus_adapter_stream_load_strategy_destroy):
	* components/adapter/nautilus-adapter.c:
	(nautilus_adapter_destroy):
	* components/hardware/nautilus-hardware-view.c:
	(nautilus_hardware_view_destroy):
	* components/history/nautilus-history-view.c:
	(nautilus_history_view_destroy):
	* components/loser/content/nautilus-content-loser.c:
	(nautilus_content_loser_destroy):
	* components/loser/sidebar/nautilus-sidebar-loser.c:
	(nautilus_sidebar_loser_destroy):
	* components/music/nautilus-music-view.c:
	(nautilus_music_view_destroy):
	* components/rpmview/nautilus-rpm-verify-window.c:
	(nautilus_rpm_verify_window_destroy):
	* components/rpmview/nautilus-rpm-view.c:
	(nautilus_rpm_view_destroy):
	* components/sample/nautilus-sample-content-view.c:
	(nautilus_sample_content_view_destroy):
	* components/services/install/nautilus-view/nautilus-service-instal
	l-view.c: (nautilus_service_install_view_destroy),
	(nautilus_service_install_view_finalize):
	* components/services/inventory-view/nautilus-inventory-config-page
	.c: (nautilus_inventory_config_page_destroy):
	* components/services/inventory-view/nautilus-inventory-view.c:
	(nautilus_inventory_view_destroy):
	* components/services/login/nautilus-view/nautilus-change-password-
	view.c: (nautilus_change_password_view_destroy):
	* components/services/nautilus-dependent-shared/eazel-services-foot
	er.c: (footer_destroy):
	* components/services/nautilus-dependent-shared/eazel-services-head
	er.c: (header_destroy):
	* components/services/summary/nautilus-summary-view.c:
	(nautilus_summary_view_destroy):
	* components/services/time/nautilus-view/trilobite-eazel-time-view.
	c: (trilobite_eazel_time_view_destroy):
	* components/text/nautilus-text-view.c:
	(nautilus_text_view_destroy):
	* components/throbber/nautilus-throbber.c:
	(nautilus_throbber_destroy), (nautilus_throbber_map),
	(nautilus_throbber_size_allocate):
	* components/tree/nautilus-tree-change-queue.c:
	(nautilus_tree_change_queue_destroy):
	* components/tree/nautilus-tree-expansion-state.c:
	(nautilus_tree_expansion_state_destroy):
	* components/tree/nautilus-tree-model.c:
	(nautilus_tree_model_destroy):
	* components/tree/nautilus-tree-node.c:
	(nautilus_tree_node_destroy):
	* components/tree/nautilus-tree-view.c:
	(nautilus_tree_view_destroy):
	* help/nautilus-quick-reference/.cvsignore:
	* help/nautilus-quick-reference/C/.cvsignore:
	* libnautilus-extensions/nautilus-background-canvas-group.c:
	(nautilus_background_canvas_group_update),
	(nautilus_background_canvas_group_draw),
	(nautilus_background_canvas_group_render):
	* libnautilus-extensions/nautilus-background.c:
	(nautilus_background_destroy):
	* libnautilus-extensions/nautilus-bookmark.c:
	(nautilus_bookmark_destroy):
	* libnautilus-extensions/nautilus-caption.c:
	(nautilus_caption_destroy), (nautilus_font_picker_show_all):
	* libnautilus-extensions/nautilus-clickable-image.c:
	(nautilus_clickable_image_destroy),
	(nautilus_clickable_image_realize),
	(nautilus_clickable_image_expose_event):
	* libnautilus-extensions/nautilus-debug-drawing.c:
	(debug_pixbuf_viewer_destroy):
	* libnautilus-extensions/nautilus-directory-metafile-monitor.c:
	(destroy):
	* libnautilus-extensions/nautilus-directory.c:
	(nautilus_directory_destroy),
	(nautilus_directory_get_name_for_self_as_new_file),
	(nautilus_directory_are_all_files_seen),
	(nautilus_directory_contains_file),
	(nautilus_directory_call_when_ready),
	(nautilus_directory_cancel_callback),
	(nautilus_directory_file_monitor_add),
	(nautilus_directory_file_monitor_remove),
	(nautilus_directory_force_reload),
	(nautilus_directory_is_not_empty):
	* libnautilus-extensions/nautilus-druid-page-eazel.c:
	(nautilus_druid_page_eazel_destroy),
	(nautilus_druid_page_eazel_finalize),
	(nautilus_druid_page_eazel_size_allocate),
	(nautilus_druid_page_eazel_size_request):
	* libnautilus-extensions/nautilus-ellipsizing-label.c:
	(real_size_request), (real_size_allocate), (real_style_set):
	* libnautilus-extensions/nautilus-entry.c:
	(nautilus_entry_destroy), (nautilus_entry_key_press),
	(nautilus_entry_motion_notify), (nautilus_entry_set_selection),
	(nautilus_entry_insert_text), (nautilus_entry_delete_text),
	(nautilus_entry_selection_clear):
	* libnautilus-extensions/nautilus-file.c: (destroy),
	(nautilus_file_monitor_add), (nautilus_file_monitor_remove),
	(nautilus_file_get_date), (nautilus_file_get_where_string),
	(nautilus_file_get_directory_item_count),
	(nautilus_file_get_deep_counts), (nautilus_file_get_file_type),
	(nautilus_file_check_if_ready), (nautilus_file_call_when_ready),
	(nautilus_file_cancel_call_when_ready):
	* libnautilus-extensions/nautilus-font-factory.c: (destroy):
	* libnautilus-extensions/nautilus-font-picker.c:
	(nautilus_font_picker_destroy):
	* libnautilus-extensions/nautilus-horizontal-splitter.c:
	(nautilus_horizontal_splitter_destroy),
	(nautilus_horizontal_splitter_button_press):
	* libnautilus-extensions/nautilus-icon-canvas-item.c:
	(nautilus_icon_canvas_item_destroy),
	(nautilus_icon_canvas_item_update):
	* libnautilus-extensions/nautilus-icon-container.c: (destroy),
	(size_allocate), (realize), (unrealize), (button_press_event),
	(button_release_event), (motion_notify_event), (key_press_event):
	* libnautilus-extensions/nautilus-icon-factory.c:
	(nautilus_icon_factory_destroy):
	* libnautilus-extensions/nautilus-image-table.c:
	(nautilus_image_table_destroy),
	(nautilus_image_table_expose_event),
	(nautilus_image_table_realize), (nautilus_image_table_unrealize),
	(nautilus_image_table_remove):
	* libnautilus-extensions/nautilus-image.c:
	(nautilus_image_destroy):
	* libnautilus-extensions/nautilus-keep-last-vertical-box.c:
	(nautilus_keep_last_vertical_box_size_allocate):
	* libnautilus-extensions/nautilus-label.c:
	(nautilus_label_destroy), (nautilus_label_size_request),
	(nautilus_label_size_allocate), (label_paint_pixbuf_callback):
	* libnautilus-extensions/nautilus-labeled-image.c:
	(nautilus_labeled_image_destroy):
	* libnautilus-extensions/nautilus-list-column-title.c:
	(nautilus_list_column_title_finalize):
	* libnautilus-extensions/nautilus-list.c: (nautilus_list_destroy),
	(nautilus_list_button_press), (nautilus_list_button_release),
	(nautilus_list_key_press), (nautilus_list_style_set),
	(nautilus_list_realize), (nautilus_list_unrealize), (draw_rows),
	(draw_all), (nautilus_list_draw), (nautilus_list_expose),
	(nautilus_list_resize_column), (nautilus_list_set_cell_contents),
	(set_list_cell), (nautilus_list_track_new_column_width),
	(nautilus_list_motion), (nautilus_list_clear), (insert_row):
	* libnautilus-extensions/nautilus-merged-directory.c:
	(merged_destroy):
	* libnautilus-extensions/nautilus-metafile-factory.c: (destroy):
	* libnautilus-extensions/nautilus-metafile.c: (destroy):
	* libnautilus-extensions/nautilus-preferences-box.c:
	(nautilus_preferences_box_destroy):
	* libnautilus-extensions/nautilus-preferences-pane.c:
	(nautilus_preferences_pane_destroy):
	* libnautilus-extensions/nautilus-scalable-font.c:
	(nautilus_scalable_font_destroy):
	* libnautilus-extensions/nautilus-string-picker.c:
	(nautilus_string_picker_destroy):
	* libnautilus-extensions/nautilus-tabs.c: (nautilus_tabs_destroy):
	* libnautilus-extensions/nautilus-text-caption.c:
	(nautilus_text_caption_destroy):
	* libnautilus-extensions/nautilus-trash-directory.c:
	(trash_destroy):
	* libnautilus-extensions/nautilus-trash-file.c: (trash_destroy):
	* libnautilus-extensions/nautilus-undo-context.c: (destroy):
	* libnautilus-extensions/nautilus-undo-manager.c: (destroy):
	* libnautilus-extensions/nautilus-vfs-directory.c: (vfs_destroy):
	* libnautilus-extensions/nautilus-vfs-file.c: (vfs_destroy):
	* libnautilus-extensions/nautilus-viewport.c:
	(nautilus_viewport_destroy), (nautilus_viewport_realize):
	* libnautilus-extensions/nautilus-volume-monitor.c:
	(nautilus_volume_monitor_destroy):
	* libnautilus-extensions/nautilus-wrap-table.c:
	(nautilus_wrap_table_destroy):
	* libnautilus/nautilus-undo-transaction.c:
	(nautilus_undo_transaction_destroy):
	* libnautilus/nautilus-view.c: (nautilus_view_destroy):
	* src/file-manager/fm-desktop-icon-view.c:
	(fm_desktop_icon_view_destroy), (real_update_menus),
	(real_merge_menus):
	* src/file-manager/fm-directory-view.c:
	(text_attribute_names_changed_callback),
	(image_display_policy_changed_callback),
	(directory_view_font_family_changed_callback),
	(click_policy_changed_callback),
	(smooth_graphics_mode_changed_callback),
	(fm_directory_view_destroy),
	(fm_directory_view_file_limit_reached),
	(fm_directory_view_bump_zoom_level),
	(fm_directory_view_zoom_to_level),
	(fm_directory_view_restore_default_zoom_level),
	(fm_directory_view_can_zoom_in), (fm_directory_view_can_zoom_out),
	(fm_directory_view_get_background_widget),
	(fm_directory_view_get_selection), (reveal_newly_added_folder),
	(fm_directory_view_get_emblem_names_to_exclude),
	(fm_directory_view_merge_menus), (fm_directory_view_select_all),
	(fm_directory_view_set_selection),
	(fm_directory_get_selected_icon_locations),
	(fm_directory_view_reveal_selection),
	(fm_directory_view_is_read_only), (fm_directory_view_is_empty),
	(fm_directory_view_supports_creating_files),
	(fm_directory_view_accepts_dragged_files),
	(fm_directory_view_supports_properties),
	(fm_directory_view_supports_zooming),
	(fm_directory_view_update_menus):
	* src/file-manager/fm-icon-view.c: (fm_icon_view_destroy),
	(fm_icon_view_clean_up), (fm_icon_view_get_directory_sort_by),
	(fm_icon_view_set_directory_sort_by),
	(fm_icon_view_get_directory_sort_reversed),
	(fm_icon_view_set_directory_sort_reversed),
	(fm_icon_view_get_directory_auto_layout),
	(fm_icon_view_set_directory_auto_layout),
	(fm_icon_view_get_directory_tighter_layout),
	(fm_icon_view_set_directory_tighter_layout),
	(fm_icon_view_supports_auto_layout),
	(fm_icon_view_start_renaming_item), (fm_icon_view_merge_menus),
	(fm_icon_view_update_menus):
	* src/file-manager/fm-list-view.c: (fm_list_view_adding_file),
	(fm_list_view_removing_file), (fm_list_view_file_still_belongs),
	(get_number_of_columns), (get_link_column),
	(get_default_sort_attribute), (get_column_specification):
	* src/file-manager/fm-properties-window.c: (real_shutdown),
	(real_destroy), (real_finalize):
	* src/file-manager/fm-search-list-view.c: (real_destroy),
	(real_add_file), (real_adding_file), (real_removing_file),
	(real_merge_menus), (real_update_menus):
	* src/nautilus-about.c: (nautilus_about_destroy):
	* src/nautilus-application.c: (nautilus_application_destroy),
	(nautilus_application_startup):
	* src/nautilus-complex-search-bar.c:
	(nautilus_complex_search_bar_destroy):
	* src/nautilus-desktop-window.c: (destroy), (realize):
	* src/nautilus-location-bar.c: (destroy):
	* src/nautilus-navigation-bar.c:
	(nautilus_navigation_bar_get_location),
	(nautilus_navigation_bar_set_location):
	* src/nautilus-property-browser.c:
	(nautilus_property_browser_destroy):
	* src/nautilus-search-bar-criterion.c:
	(nautilus_search_bar_criterion_destroy):
	* src/nautilus-shell.c: (destroy):
	* src/nautilus-sidebar-tabs.c: (nautilus_sidebar_tabs_destroy),
	(nautilus_sidebar_tabs_size_allocate):
	* src/nautilus-sidebar-title.c: (nautilus_sidebar_title_destroy),
	(nautilus_sidebar_title_size_allocate):
	* src/nautilus-sidebar.c: (nautilus_sidebar_destroy),
	(nautilus_sidebar_size_allocate), (nautilus_sidebar_realize):
	* src/nautilus-simple-search-bar.c:
	(nautilus_simple_search_bar_destroy):
	* src/nautilus-switchable-navigation-bar.c:
	(nautilus_switchable_navigation_bar_destroy):
	* src/nautilus-switchable-search-bar.c:
	(nautilus_switchable_search_bar_destroy):
	* src/nautilus-theme-selector.c: (nautilus_theme_selector_destroy):
	* src/nautilus-view-frame.c: (nautilus_view_frame_destroy),
	(nautilus_view_frame_finalize), (nautilus_view_frame_map):
	* src/nautilus-window.c: (nautilus_window_destroy),
	(nautilus_window_realize), (nautilus_window_size_request),
	(nautilus_window_add_current_location_to_history_list),
	(nautilus_window_show):
	* src/nautilus-zoom-control.c: (nautilus_zoom_control_destroy),
	(nautilus_zoom_control_size_allocate):
	Use the macros by their new names.

	* RENAMING: Updated for some name changes and name change ideas.

	* user-guide/C/.cvsignore:
	* user-guide/C/html/.cvsignore:
	* user-guide/C/img/.cvsignore:
	* user-guide/C/sgml/.cvsignore:
	Added missing cvsignores.
parent b67dd0cb
......@@ -247,7 +247,7 @@ nautilus_volume_monitor_destroy (GtkObject *object)
global_volume_monitor = NULL;
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
......
......@@ -176,7 +176,7 @@ nautilus_wrap_table_destroy (GtkObject *object)
* The details will be used in the nautilus_wrap_box_remove ()
* method as a result of the children being killed.
*/
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
g_list_free (wrap_table->details->children);
......
......@@ -147,7 +147,7 @@ nautilus_background_canvas_group_update (GnomeCanvasItem *item,
GTK_WIDGET (item->canvas)->allocation.width,
GTK_WIDGET (item->canvas)->allocation.height);
NAUTILUS_CALL_PARENT_CLASS (GNOME_CANVAS_ITEM_CLASS, update, (item, affine, clip_path, flags));
NAUTILUS_CALL_PARENT (GNOME_CANVAS_ITEM_CLASS, update, (item, affine, clip_path, flags));
}
static void
......@@ -193,7 +193,7 @@ nautilus_background_canvas_group_draw (GnomeCanvasItem *item,
/* Call through to the GnomeCanvasGroup implementation, which
* will draw all the canvas items.
*/
NAUTILUS_CALL_PARENT_CLASS (GNOME_CANVAS_ITEM_CLASS, draw, (item, drawable, x, y, width, height));
NAUTILUS_CALL_PARENT (GNOME_CANVAS_ITEM_CLASS, draw, (item, drawable, x, y, width, height));
}
......@@ -221,5 +221,5 @@ nautilus_background_canvas_group_render (GnomeCanvasItem *item, GnomeCanvasBuf *
/* Call through to the GnomeCanvasGroup implementation, which will draw all
* the canvas items.
*/
NAUTILUS_CALL_PARENT_CLASS (GNOME_CANVAS_ITEM_CLASS, render, (item, buffer));
NAUTILUS_CALL_PARENT (GNOME_CANVAS_ITEM_CLASS, render, (item, buffer));
}
......@@ -200,7 +200,7 @@ nautilus_background_destroy (GtkObject *object)
nautilus_background_remove_current_image (background);
g_free (background->details);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
/* handle the combine mode getting and setting */
......
......@@ -58,8 +58,6 @@ struct NautilusBookmarkDetails
NautilusFile *file;
};
static void nautilus_bookmark_connect_file (NautilusBookmark *file);
static void nautilus_bookmark_disconnect_file (NautilusBookmark *file);
static void nautilus_bookmark_initialize_class (NautilusBookmarkClass *class);
......@@ -86,10 +84,9 @@ nautilus_bookmark_destroy (GtkObject *object)
g_free (bookmark->details);
/* Chain up */
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
/* Initialization. */
static void
......@@ -119,7 +116,6 @@ nautilus_bookmark_initialize (NautilusBookmark *bookmark)
bookmark->details = g_new0 (NautilusBookmarkDetails, 1);
}
/**
* nautilus_bookmark_compare_with:
*
......
......@@ -111,14 +111,14 @@ nautilus_caption_destroy (GtkObject* object)
g_free (caption->detail);
/* Chain */
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
/* GtkObjectClass methods */
static void
nautilus_font_picker_show_all (GtkWidget *widget)
{
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, show_all, (widget));
NAUTILUS_CALL_PARENT (GTK_WIDGET_CLASS, show_all, (widget));
/* Now update the title visibility */
update_title (NAUTILUS_CAPTION (widget));
......
......@@ -161,7 +161,7 @@ nautilus_clickable_image_destroy (GtkObject *object)
g_free (clickable_image->details);
/* Chain destroy */
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
......@@ -198,7 +198,7 @@ nautilus_clickable_image_realize (GtkWidget *widget)
clickable_image = NAUTILUS_CLICKABLE_IMAGE (widget);
/* Chain realize */
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, realize, (widget));
NAUTILUS_CALL_PARENT (GTK_WIDGET_CLASS, realize, (widget));
windowed_ancestor = nautilus_gtk_widget_find_windowed_ancestor (widget);
g_assert (GTK_IS_WIDGET (windowed_ancestor));
......@@ -478,7 +478,8 @@ nautilus_clickable_image_expose_event (GtkWidget *widget,
clickable_image = NAUTILUS_CLICKABLE_IMAGE (widget);
/* Chain expose */
return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, expose_event, (widget, event));
return NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, expose_event, (widget, event));
}
static void
......
......@@ -112,7 +112,7 @@ debug_pixbuf_viewer_destroy (GtkObject *object)
nautilus_gdk_pixbuf_unref_if_not_null (viewer->pixbuf);
viewer->pixbuf = NULL;
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
......
......@@ -111,7 +111,7 @@ destroy (GtkObject *object)
monitor = NAUTILUS_METAFILE_MONITOR (object);
g_free (monitor->details);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
NautilusMetafileMonitor *
......
......@@ -208,7 +208,7 @@ nautilus_directory_destroy (GtkObject *object)
g_free (directory->details);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
......@@ -460,7 +460,7 @@ nautilus_directory_get_name_for_self_as_new_file (NautilusDirectory *directory)
{
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), NULL);
return NAUTILUS_CALL_VIRTUAL
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_DIRECTORY_CLASS, directory,
get_name_for_self_as_new_file, (directory));
}
......@@ -563,7 +563,7 @@ nautilus_directory_are_all_files_seen (NautilusDirectory *directory)
{
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), FALSE);
return NAUTILUS_CALL_VIRTUAL
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_DIRECTORY_CLASS, directory,
are_all_files_seen, (directory));
}
......@@ -1433,7 +1433,7 @@ nautilus_directory_contains_file (NautilusDirectory *directory,
return FALSE;
}
return NAUTILUS_CALL_VIRTUAL
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_DIRECTORY_CLASS, directory,
contains_file, (directory, file));
}
......@@ -1474,7 +1474,7 @@ nautilus_directory_call_when_ready (NautilusDirectory *directory,
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (callback != NULL);
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_DIRECTORY_CLASS, directory,
call_when_ready, (directory, file_attributes,
callback, callback_data));
......@@ -1489,7 +1489,7 @@ nautilus_directory_cancel_callback (NautilusDirectory *directory,
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (callback != NULL);
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_DIRECTORY_CLASS, directory,
cancel_callback, (directory, callback, callback_data));
}
......@@ -1504,7 +1504,7 @@ nautilus_directory_file_monitor_add (NautilusDirectory *directory,
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (client != NULL);
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_DIRECTORY_CLASS, directory,
file_monitor_add, (directory, client,
monitor_hidden_files,
......@@ -1519,7 +1519,7 @@ nautilus_directory_file_monitor_remove (NautilusDirectory *directory,
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
g_return_if_fail (client != NULL);
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_DIRECTORY_CLASS, directory,
file_monitor_remove, (directory, client));
}
......@@ -1529,7 +1529,7 @@ nautilus_directory_force_reload (NautilusDirectory *directory)
{
g_return_if_fail (NAUTILUS_IS_DIRECTORY (directory));
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_DIRECTORY_CLASS, directory,
force_reload, (directory));
}
......@@ -1539,7 +1539,7 @@ nautilus_directory_is_not_empty (NautilusDirectory *directory)
{
g_return_val_if_fail (NAUTILUS_IS_DIRECTORY (directory), FALSE);
return NAUTILUS_CALL_VIRTUAL
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_DIRECTORY_CLASS, directory,
is_not_empty, (directory));
}
......
......@@ -142,11 +142,11 @@ nautilus_druid_page_eazel_destroy(GtkObject *object)
druid_page_eazel->widget = NULL;
/* Chain destroy */
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
nautilus_druid_page_eazel_finalize(GtkObject *object)
nautilus_druid_page_eazel_finalize (GtkObject *object)
{
NautilusDruidPageEazel *druid_page_eazel =
NAUTILUS_DRUID_PAGE_EAZEL(object);
......@@ -155,7 +155,7 @@ nautilus_druid_page_eazel_finalize(GtkObject *object)
druid_page_eazel->details = NULL;
/* Chain finalize */
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, finalize, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, finalize, (object));
}
static void
......@@ -389,8 +389,8 @@ static void
nautilus_druid_page_eazel_size_allocate(GtkWidget *widget,
GtkAllocation *allocation)
{
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, size_allocate,
(widget, allocation));
NAUTILUS_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate,
(widget, allocation));
gnome_canvas_set_scroll_region (GNOME_CANVAS (NAUTILUS_DRUID_PAGE_EAZEL (widget)->canvas),
0.0, 0.0,
......@@ -409,8 +409,8 @@ nautilus_druid_page_eazel_size_request(GtkWidget *widget,
druid_page_eazel = NAUTILUS_DRUID_PAGE_EAZEL (widget);
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, size_request,
(widget, requisition));
NAUTILUS_CALL_PARENT (GTK_WIDGET_CLASS, size_request,
(widget, requisition));
if (druid_page_eazel->widget) {
GtkRequisition child_requisition;
......
......@@ -128,7 +128,7 @@ nautilus_ellipsizing_label_set_text (NautilusEllipsizingLabel *label,
static void
real_size_request (GtkWidget *widget, GtkRequisition *requisition)
{
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, size_request, (widget, requisition));
NAUTILUS_CALL_PARENT (GTK_WIDGET_CLASS, size_request, (widget, requisition));
/* Don't demand any particular width; will draw ellipsized into whatever size we're given */
requisition->width = 0;
......@@ -139,7 +139,7 @@ real_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
{
recompute_ellipsized_text (NAUTILUS_ELLIPSIZING_LABEL (widget), allocation->width);
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, size_allocate, (widget, allocation));
NAUTILUS_CALL_PARENT (GTK_WIDGET_CLASS, size_allocate, (widget, allocation));
}
static void
......@@ -147,6 +147,6 @@ real_style_set (GtkWidget *widget, GtkStyle *previous_style)
{
recompute_ellipsized_text (NAUTILUS_ELLIPSIZING_LABEL (widget), widget->allocation.width);
NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, style_set, (widget, previous_style));
NAUTILUS_CALL_PARENT (GTK_WIDGET_CLASS, style_set, (widget, previous_style));
}
......@@ -156,7 +156,7 @@ nautilus_entry_destroy (GtkObject *object)
entry = NAUTILUS_ENTRY (object);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
......@@ -223,9 +223,8 @@ nautilus_entry_key_press (GtkWidget *widget, GdkEventKey *event)
obscure_cursor (entry);
return_code = NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS,
key_press_event,
(widget, event));
return_code = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, key_press_event, (widget, event));
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
return return_code;
......@@ -256,7 +255,8 @@ nautilus_entry_motion_notify (GtkWidget *widget, GdkEventMotion *event)
old_start_pos = GTK_EDITABLE (widget)->selection_start_pos;
old_end_pos = GTK_EDITABLE (widget)->selection_end_pos;
return_code = NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS, motion_notify_event, (widget, event));
return_code = NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, motion_notify_event, (widget, event));
if (GTK_EDITABLE (widget)->selection_start_pos != old_start_pos ||
GTK_EDITABLE (widget)->selection_end_pos != old_end_pos) {
gtk_signal_emit (GTK_OBJECT (widget), signals[SELECTION_CHANGED]);
......@@ -340,8 +340,8 @@ nautilus_entry_set_selection (GtkEditable *editable,
gint end_pos)
{
NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, set_selection,
(editable, start_pos, end_pos));
NAUTILUS_CALL_PARENT (GTK_EDITABLE_CLASS, set_selection,
(editable, start_pos, end_pos));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
......@@ -358,8 +358,8 @@ nautilus_entry_insert_text (GtkEditable *editable, const gchar *text,
gtk_signal_emit (GTK_OBJECT (editable), signals[USER_CHANGED]);
}
NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, insert_text,
(editable, text, length, position));
NAUTILUS_CALL_PARENT (GTK_EDITABLE_CLASS, insert_text,
(editable, text, length, position));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
......@@ -378,8 +378,8 @@ nautilus_entry_delete_text (GtkEditable *editable, gint start_pos, gint end_pos)
gtk_signal_emit (GTK_OBJECT (editable), signals[USER_CHANGED]);
}
NAUTILUS_CALL_PARENT_CLASS (GTK_EDITABLE_CLASS, delete_text,
(editable, start_pos, end_pos));
NAUTILUS_CALL_PARENT (GTK_EDITABLE_CLASS, delete_text,
(editable, start_pos, end_pos));
gtk_signal_emit (GTK_OBJECT (editable), signals[SELECTION_CHANGED]);
}
......@@ -393,17 +393,15 @@ nautilus_entry_delete_text (GtkEditable *editable, gint start_pos, gint end_pos)
* gtk+/gtkselection.c, gtk_selection_clear.
*/
static gboolean
nautilus_entry_selection_clear (GtkWidget *widget,
nautilus_entry_selection_clear (GtkWidget *widget,
GdkEventSelection *event)
{
g_return_val_if_fail (NAUTILUS_IS_ENTRY (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
if (gdk_selection_owner_get (event->selection) == widget->window) {
return FALSE;
}
return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS,
selection_clear_event,
(widget, event));
g_return_val_if_fail (NAUTILUS_IS_ENTRY (widget), FALSE);
if (gdk_selection_owner_get (event->selection) == widget->window) {
return FALSE;
}
return NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE
(GTK_WIDGET_CLASS, selection_clear_event, (widget, event));
}
......@@ -438,7 +438,7 @@ destroy (GtkObject *object)
g_free (file->details);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
......@@ -2043,7 +2043,7 @@ nautilus_file_monitor_add (NautilusFile *file,
g_return_if_fail (NAUTILUS_IS_FILE (file));
g_return_if_fail (client != NULL);
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_FILE_CLASS, file,
monitor_add, (file, client, attributes));
}
......@@ -2055,7 +2055,7 @@ nautilus_file_monitor_remove (NautilusFile *file,
g_return_if_fail (NAUTILUS_IS_FILE (file));
g_return_if_fail (client != NULL);
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_FILE_CLASS, file,
monitor_remove, (file, client));
}
......@@ -2138,8 +2138,9 @@ nautilus_file_get_date (NautilusFile *file,
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
return NAUTILUS_CALL_VIRTUAL (NAUTILUS_FILE_CLASS, file,
get_date, (file, date_type, date));
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_FILE_CLASS, file,
get_date, (file, date_type, date));
}
static char *
......@@ -2151,8 +2152,9 @@ nautilus_file_get_where_string (NautilusFile *file)
g_return_val_if_fail (NAUTILUS_IS_FILE (file), NULL);
return NAUTILUS_CALL_VIRTUAL (NAUTILUS_FILE_CLASS, file,
get_where_string, (file));
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_FILE_CLASS, file,
get_where_string, (file));
}
/**
......@@ -2349,7 +2351,7 @@ nautilus_file_get_directory_item_count (NautilusFile *file,
return FALSE;
}
return NAUTILUS_CALL_VIRTUAL
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_FILE_CLASS, file,
get_item_count, (file, count, count_unreadable));
}
......@@ -2398,7 +2400,7 @@ nautilus_file_get_deep_counts (NautilusFile *file,
return file->details->deep_counts_status;
}
return NAUTILUS_CALL_VIRTUAL
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_FILE_CLASS, file,
get_deep_counts, (file,
directory_count,
......@@ -3804,7 +3806,8 @@ nautilus_file_get_file_type (NautilusFile *file)
if (file == NULL) {
return GNOME_VFS_FILE_TYPE_UNKNOWN;
}
return NAUTILUS_CALL_VIRTUAL (NAUTILUS_FILE_CLASS, file, get_file_type, (file));
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_FILE_CLASS, file, get_file_type, (file));
}
/**
......@@ -4297,7 +4300,7 @@ nautilus_file_check_if_ready (NautilusFile *file,
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
return NAUTILUS_CALL_VIRTUAL
return NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE
(NAUTILUS_FILE_CLASS, file,
check_if_ready, (file, file_attributes));
}
......@@ -4318,7 +4321,7 @@ nautilus_file_call_when_ready (NautilusFile *file,
g_return_if_fail (NAUTILUS_IS_FILE (file));
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_FILE_CLASS, file,
call_when_ready, (file, file_attributes,
callback, callback_data));
......@@ -4337,7 +4340,7 @@ nautilus_file_cancel_call_when_ready (NautilusFile *file,
g_return_if_fail (NAUTILUS_IS_FILE (file));
NAUTILUS_CALL_VIRTUAL
NAUTILUS_CALL_METHOD
(NAUTILUS_FILE_CLASS, file,
cancel_call_when_ready, (file, callback, callback_data));
}
......
......@@ -164,7 +164,7 @@ destroy (GtkObject *object)
g_hash_table_foreach (factory->fonts, free_one_hash_node, NULL);
g_hash_table_destroy (factory->fonts);
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static FontHashNode *
......
......@@ -194,7 +194,7 @@ nautilus_font_picker_destroy (GtkObject* object)
g_free (font_picker->detail);
/* Chain */
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
......
......@@ -2,7 +2,7 @@
nautilus-gtk-macros.h: Macros to reduce boilerplate when using GTK.
Copyright (C) 1999, 2000 Eazel, Inc.
Copyright (C) 1999, 2000, 2001 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
......@@ -26,6 +26,8 @@
#ifndef NAUTILUS_GTK_MACROS_H
#define NAUTILUS_GTK_MACROS_H
#include <glib.h>
/* Define a parent_class global and a get_type function for a GTK class.
Since this is boilerplate, it's better not to repeat it over and over again.
Called like this:
......@@ -71,20 +73,38 @@ class_name_in_function_format##_get_type (void)
* typo. Depends on the parent class pointer having the conventional
* name "parent_class" as the boilerplate macro above does it.
*/
#define NAUTILUS_CALL_PARENT_CLASS(parent_class_cast_macro, signal, parameters) \
\
(parent_class_cast_macro (parent_class)->signal == NULL) \
? 0 \
#define NAUTILUS_CALL_PARENT(parent_class_cast_macro, signal, parameters) \
\
G_STMT_START { \
if (parent_class_cast_macro (parent_class)->signal != NULL) { \
(* parent_class_cast_macro (parent_class)->signal) parameters; \
} \
} G_STMT_END
/* Same thing, for functions with a return value. */
#define NAUTILUS_CALL_PARENT_WITH_RETURN_VALUE(parent_class_cast_macro, signal, parameters) \
\
(parent_class_cast_macro (parent_class)->signal == NULL) \
? 0 \
: ((* parent_class_cast_macro (parent_class)->signal) parameters)
/* Call a virtual function. Useful when the virtual function is not a
* signal, otherwise you want to gtk_signal emit. Nice because it
* documents what it's doing and there is less chance for a typo.
*/
#define NAUTILUS_CALL_VIRTUAL(class_cast_macro, object, signal, parameters) \
\
(class_cast_macro (GTK_OBJECT (object)->klass)->signal == NULL) \
? 0 \
#define NAUTILUS_CALL_METHOD(class_cast_macro, object, signal, parameters) \
\
G_STMT_START { \
if (class_cast_macro (GTK_OBJECT (object)->klass)->signal != NULL) { \
(* class_cast_macro (GTK_OBJECT (object)->klass)->signal) parameters; \
} \
} G_STMT_END
/* Same thing, for functions with a return value. */
#define NAUTILUS_CALL_METHOD_WITH_RETURN_VALUE(class_cast_macro, object, signal, parameters) \
\
(class_cast_macro (GTK_OBJECT (object)->klass)->signal == NULL) \
? 0 \
: ((* class_cast_macro (GTK_OBJECT (object)->klass)->signal) parameters)
#ifndef G_DISABLE_ASSERT
......
......@@ -94,7 +94,7 @@ nautilus_horizontal_splitter_initialize (NautilusHorizontalSplitter *horizontal_
/* GtkObjectClass methods */
static void
nautilus_horizontal_splitter_destroy(GtkObject *object)
nautilus_horizontal_splitter_destroy (GtkObject *object)
{
NautilusHorizontalSplitter *horizontal_splitter;
......@@ -103,7 +103,7 @@ nautilus_horizontal_splitter_destroy(GtkObject *object)
g_free (horizontal_splitter->details);
/* Chain */
NAUTILUS_CALL_PARENT_CLASS (GTK_OBJECT_CLASS, destroy, (object));
NAUTILUS_CALL_PARENT (GTK_OBJECT_CLASS, destroy, (object));
}
static void
......@@ -340,7 +340,8 @@ nautilus_horizontal_splitter_button_press (GtkWidget *widget, GdkEventButton *ev
splitter->details->down_time = event->time;
}
return NAUTILUS_CALL_PARENT_CLASS (GTK_WIDGET_CLASS,