Commit 63bc589b authored by Darin Adler's avatar Darin Adler

Ignore some additional generated files.

	* components/services/install/command-line/.cvsignore:
	* components/services/install/lib/.cvsignore:
	Ignore some additional generated files.

	* libnautilus-extensions/nautilus-gnome-extensions.h:
	* libnautilus-extensions/nautilus-gnome-extensions.c:
	Moved stock dialog functions to nautilus-stock-dialogs.[ch].
	(nautilus_gnome_canvas_item_request_update_deep),
	(nautilus_gnome_canvas_request_update_all),
	(nautilus_gnome_canvas_set_scroll_region),
	(nautilus_gnome_canvas_set_scroll_region_left_justify):
	Added a bunch of functions that were previously private inside
	NautilusIconContainer.

	* libnautilus-extensions/nautilus-gtk-extensions.h:
	* libnautilus-extensions/nautilus-gtk-extensions.c:
	(nautilus_gtk_adjustment_set_value),
	(nautilus_gtk_adjustment_clamp_value):
	Added functions that treat the value range in a GtkAdjustment the
	same way scroll bars do, taking the page size into account.

	* libnautilus-extensions/nautilus-horizontal-splitter.h:
	* libnautilus-extensions/nautilus-horizontal-splitter.c:
	(nautilus_horizontal_splitter_initialize),
	(toggle_splitter_position),
	(nautilus_horizontal_splitter_button_press),
	(nautilus_horizontal_splitter_button_release):
	Fixed logic so that splitter will only open or close if you both
	click and release within the splitter itself.

	* libnautilus-extensions/nautilus-icon-private.h:
	* libnautilus-extensions/nautilus-icon-container.c:
	(icon_toggle_selected): Move icons to front when they are selected.
	(set_scroll_region): Moved workaround that sets scroll region to
	be large enough to fill the widget allocation into a function in
	nautilus-gnome-extensions.h. In the process, I fixed the problem
	where it would do the job wrong when the view was zoomed.
	(lay_down_icons), (relayout), (reload_icon_positions):
	Started work on sharing code between automatic layout of the entire
	container and layout of new icons as the arrive.
	(nautilus_icon_container_clear), (nautilus_icon_container_add):
	Got started on the mechanism for laying out new icons as they arrive
	in bunches instead of one at a time.

	* libnautilus-extensions/nautilus-icon-dnd.c:
	* libnautilus-extensions/nautilus-program-chooser.c:
	* libnautilus-extensions/nautilus-program-choosing.c:
	* src/file-manager/dfos-xfer.c:
	* src/file-manager/fm-directory-view.c:
	* src/file-manager/fm-error-reporting.c:
	* src/nautilus-application.c:
	* src/nautilus-location-bar.c:
	* src/nautilus-property-browser.c:
	* src/nautilus-window-manage-views.c:
	* src/nautilus-window-menus.c:
	Added includes to source files that use the stock dialogs.

	* libnautilus-extensions/nautilus-stock-dialogs.h:
	* libnautilus-extensions/nautilus-stock-dialogs.c:
	(nautilus_timed_wait_stop), (convert_varargs_to_name_array),
	(nautilus_simple_dialog), (turn_on_line_wrap_flag),
	(turn_on_line_wrap_flag_callback), (show_ok_box),
	(show_yes_no_box), (nautilus_info_dialog),
	(nautilus_info_dialog_parented), (nautilus_warning_dialog),
	(nautilus_warning_dialog_parented), (nautilus_error_dialog),
	(nautilus_error_dialog_parented), (nautilus_yes_no_dialog),
	(nautilus_yes_no_dialog_parented):
	Moved all the stock dialog code in here.

	* src/nautilus-sidebar-title.c: (update_icon): Only display the
	icon when it's ready, instead of showing generic document icon
	before that time.
	(update_title), (update_more_info), (update_emblems),
	(update_notes): Added FIXMEs about doing the same with other info.
	(nautilus_sidebar_title_button_press_event): Added a FIXME to the
	half-baked code in here.
parent 1575d03c
2000-06-26 Darin Adler <darin@eazel.com>
* components/services/install/command-line/.cvsignore:
* components/services/install/lib/.cvsignore:
Ignore some additional generated files.
* libnautilus-extensions/nautilus-gnome-extensions.h:
* libnautilus-extensions/nautilus-gnome-extensions.c:
Moved stock dialog functions to nautilus-stock-dialogs.[ch].
(nautilus_gnome_canvas_item_request_update_deep),
(nautilus_gnome_canvas_request_update_all),
(nautilus_gnome_canvas_set_scroll_region),
(nautilus_gnome_canvas_set_scroll_region_left_justify):
Added a bunch of functions that were previously private inside
NautilusIconContainer.
* libnautilus-extensions/nautilus-gtk-extensions.h:
* libnautilus-extensions/nautilus-gtk-extensions.c:
(nautilus_gtk_adjustment_set_value),
(nautilus_gtk_adjustment_clamp_value):
Added functions that treat the value range in a GtkAdjustment the
same way scroll bars do, taking the page size into account.
* libnautilus-extensions/nautilus-horizontal-splitter.h:
* libnautilus-extensions/nautilus-horizontal-splitter.c:
(nautilus_horizontal_splitter_initialize),
(toggle_splitter_position),
(nautilus_horizontal_splitter_button_press),
(nautilus_horizontal_splitter_button_release):
Fixed logic so that splitter will only open or close if you both
click and release within the splitter itself.
* libnautilus-extensions/nautilus-icon-private.h:
* libnautilus-extensions/nautilus-icon-container.c:
(icon_toggle_selected): Move icons to front when they are selected.
(set_scroll_region): Moved workaround that sets scroll region to
be large enough to fill the widget allocation into a function in
nautilus-gnome-extensions.h. In the process, I fixed the problem
where it would do the job wrong when the view was zoomed.
(lay_down_icons), (relayout), (reload_icon_positions):
Started work on sharing code between automatic layout of the entire
container and layout of new icons as the arrive.
(nautilus_icon_container_clear), (nautilus_icon_container_add):
Got started on the mechanism for laying out new icons as they arrive
in bunches instead of one at a time.
* libnautilus-extensions/nautilus-icon-dnd.c:
* libnautilus-extensions/nautilus-program-chooser.c:
* libnautilus-extensions/nautilus-program-choosing.c:
* src/file-manager/dfos-xfer.c:
* src/file-manager/fm-directory-view.c:
* src/file-manager/fm-error-reporting.c:
* src/nautilus-application.c:
* src/nautilus-location-bar.c:
* src/nautilus-property-browser.c:
* src/nautilus-window-manage-views.c:
* src/nautilus-window-menus.c:
Added includes to source files that use the stock dialogs.
* libnautilus-extensions/nautilus-stock-dialogs.h:
* libnautilus-extensions/nautilus-stock-dialogs.c:
(nautilus_timed_wait_stop), (convert_varargs_to_name_array),
(nautilus_simple_dialog), (turn_on_line_wrap_flag),
(turn_on_line_wrap_flag_callback), (show_ok_box),
(show_yes_no_box), (nautilus_info_dialog),
(nautilus_info_dialog_parented), (nautilus_warning_dialog),
(nautilus_warning_dialog_parented), (nautilus_error_dialog),
(nautilus_error_dialog_parented), (nautilus_yes_no_dialog),
(nautilus_yes_no_dialog_parented):
Moved all the stock dialog code in here.
* src/nautilus-sidebar-title.c: (update_icon): Only display the
icon when it's ready, instead of showing generic document icon
before that time.
(update_title), (update_more_info), (update_emblems),
(update_notes): Added FIXMEs about doing the same with other info.
(nautilus_sidebar_title_button_press_event): Added a FIXME to the
half-baked code in here.
2000-06-26 Fatih Demir <kabalak@gmx.net>
* Makefile.am: Added the previous ChangeLogs to
the EXTRA_DIST target.
the EXTRA_DIST target.
* configure.in: Cosmetics and a configuration summary at the
end of the ./configure process.
* configure.in: Cosmetics and a configuration summary at the end
of the ./configure process.
* helper-utilities/authenticate/nautilus-authenticate.h:
Include <stdlib.h> for compiling with -Werror without
error.
Include <stdlib.h> for compiling with -Werror without error.
2000-06-26 Pavel Cisler <pavel@eazel.com>
......@@ -16,14 +94,15 @@
* configure.in:
Fix build breakage caused recent changes to make GnomeVFS compile
without OAF support. Some GnomeVFS headers now require USING_OAF
to be defined and when included from Nautilus, this define was missing.
Not sure this is the 100% correct way to do this but this should at
least prevent people from being stuck with a broken build.
to be defined and when included from Nautilus, this define was
missing. Not sure this is the 100% correct way to do this but
this should at least prevent people from being stuck with a broken
build.
2000-06-26 Andy Hertzfeld <andy@eazel.com>
added xml based theme mechanism and used it for the sidebar background,
which isn't entirely working yet.
Added XML-based theme mechanism and used it for the sidebar
background, which isn't entirely working yet.
* icons/Makefile.am:
* icons/default.xml:
......@@ -31,44 +110,44 @@
* icons/eazel/eazel.xml:
* icons/vector/Makefile.am:
* icons/vector/vector.xml:
new xml-based theme files
New XML-based theme files.
* libnautilus-extensions/nautilus-global-preferences.c,h:
(global_preferences_create_dialog),
(global_preferences_register_for_ui):
changed "icon_theme" preference to general "theme"
Changed "icon_theme" preference to general "theme".
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_get_current_icon_factory),
(nautilus_icon_factory_destroy), (icon_theme_changed_callback):
changed from "icon_theme" to "theme"
Changed from "icon_theme" to "theme".
* libnautilus-extensions/nautilus-preferences-item.c,h:
(preferences_item_construct), (preferences_item_create_theme):
changed from "icon_theme" to "theme"
Changed from "icon_theme" to "theme".
* libnautilus-extensions/nautilus-xml-extensions.c,h:
(nautilus_xml_get_child_by_name):
added a routine to access child nodes
Added a routine to access child nodes.
* src/nautilus-sidebar.c: (nautilus_sidebar_initialize),
(nautilus_sidebar_destroy), (nautilus_sidebar_read_theme),
(nautilus_sidebar_theme_changed),
(nautilus_sidebar_background_changed),
(nautilus_sidebar_update_info):
made the sidebar get its default values from an xml-based theme file, and reload
them when the theme changes
Made the sidebar get its default values from an XML-based theme
file, and reload them when the theme changes.
2000-06-25 Andy Hertzfeld <andy@eazel.com>
* libnautilus-extensions/nautilus-link.c:
(free_icon_notification_info), (icon_read_done_callback),
(is_remote_uri), (nautilus_link_get_image_uri):
Linksets now use gnome-vfs to load load icons over http instead of ghttp,
using Darin's new utility routines. Also, made it load them asynchronously.
Linksets now use gnome-vfs to load load icons over http instead of
ghttp, using Darin's new utility routines. Also, made it load
them asynchronously.
* libnautilus-extensions/nautilus-icon-factory.c:
(nautilus_icon_factory_get_pixbuf_for_icon):
made get_pixbuf_for_icon set the custom boolean when it calls get_icon_from_cache
if necessary
Made get_pixbuf_for_icon set the custom boolean when it calls
get_icon_from_cache if necessary.
2000-06-25 Fatih Demir <kabalak@gmx.net>
* ChangeLog: This is the fresh one.
* ChangeLog-20000625: Splitted up the ChangeLog.
* ChangeLog-20000625: Split up the ChangeLog.
2000-06-25 Fatih Demir <kabalak@gmx.net>
* configure.in: Applied some updates to the configure.in, e.g.
a check for GtkHTML >= 0.4.
a check for GtkHTML >= 0.4.
2000-06-24 John Sullivan <sullivan@eazel.com>
......
......@@ -2,5 +2,6 @@
.libs
Makefile
Makefile.in
eazel-alt-install-corba
eazel-alt-install
eazel-alt-install-corba
eazel-install
Makefile
Makefile.in
.deps
.libs
trilobite-eazel-install-stubs.c
trilobite-eazel-install-skels.c
Makefile
Makefile.in
eazel-install-query-lex.c
trilobite-eazel-install-common.c
trilobite-eazel-install-skels.c
trilobite-eazel-install-stubs.c
trilobite-eazel-install.h
......@@ -449,7 +449,7 @@ set_metadata_eat_value (NautilusDirectory *directory,
GHashTable *directory_table, *file_table;
gboolean found, changed;
char *combined_key;
gpointer old_key, old_value;
MetadataValue *old_value;
if (directory->details->metafile_read) {
changed = set_metadata_in_metafile
......@@ -478,21 +478,17 @@ set_metadata_eat_value (NautilusDirectory *directory,
} else {
combined_key = g_strconcat (key, "/", subkey, NULL);
}
found = g_hash_table_lookup_extended
(file_table, combined_key, &old_key, &old_value);
old_value = g_hash_table_lookup (file_table, combined_key);
/* Put the change into the hash. Delete the old change. */
if (!found) {
old_key = NULL;
old_value = NULL;
changed = TRUE;
} else {
changed = !metadata_value_equal (old_value, value);
}
changed = old_value == NULL || !metadata_value_equal (old_value, value);
if (changed) {
g_hash_table_insert (file_table, combined_key, value);
g_free (old_key);
metadata_value_destroy (old_value);
if (old_value != NULL) {
/* The hash table keeps the old key. */
g_free (combined_key);
metadata_value_destroy (old_value);
}
} else {
g_free (combined_key);
metadata_value_destroy (value);
......
......@@ -31,7 +31,7 @@
#include "dfos-xfer.h"
#include <libnautilus-extensions/nautilus-file-changes-queue.h>
#include <libnautilus-extensions/nautilus-glib-extensions.h>
#include <libnautilus-extensions/nautilus-gnome-extensions.h>
#include <libnautilus-extensions/nautilus-stock-dialogs.h>
#include "fm-directory-view.h"
typedef enum {
......
......@@ -27,18 +27,9 @@
#include <config.h>
#include "nautilus-gnome-extensions.h"
#include <gtk/gtkbox.h>
#include <gtk/gtklabel.h>
#include <libgnomeui/gnome-dialog.h>
#include <libgnomeui/gnome-messagebox.h>
#include <libgnomeui/gnome-stock.h>
#include <libgnomeui/gnome-uidefs.h>
#include <libart_lgpl/art_rgb.h>
#include <libart_lgpl/art_rect.h>
#include "nautilus-gdk-extensions.h"
#include "nautilus-string.h"
static void turn_on_line_wrap_flag_callback (GtkWidget *widget, gpointer callback_data);
void
nautilus_gnome_canvas_world_to_window_rectangle (GnomeCanvas *canvas,
......@@ -290,246 +281,82 @@ nautilus_gnome_canvas_fill_with_gradient (GnomeCanvasBuf *buffer,
}
}
static const char **
convert_varargs_to_name_array (va_list args)
{
GPtrArray *resizeable_array;
const char *name;
const char **plain_ole_array;
resizeable_array = g_ptr_array_new ();
do {
name = va_arg (args, const char *);
g_ptr_array_add (resizeable_array, (gpointer) name);
} while (name != NULL);
plain_ole_array = (const char **) resizeable_array->pdata;
g_ptr_array_free (resizeable_array, FALSE);
return plain_ole_array;
}
int
nautilus_simple_dialog (GtkWidget *parent, const char *text, const char *title, ...)
GtkButton *
nautilus_gnome_dialog_get_button_by_index (GnomeDialog *dialog, int index)
{
va_list button_title_args;
const char **button_titles;
GtkWidget *dialog;
GtkWidget *top_widget;
GtkWidget *prompt_widget;
/* Create the dialog. */
va_start (button_title_args, title);
button_titles = convert_varargs_to_name_array (button_title_args);
va_end (button_title_args);
dialog = gnome_dialog_newv (title, button_titles);
g_free (button_titles);
/* Allow close. */
gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
/* Parent it if asked to. */
if (parent != NULL) {
top_widget = gtk_widget_get_toplevel (parent);
if (GTK_IS_WINDOW (top_widget)) {
gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (top_widget));
}
}
/* Title it if asked to. */
if (text != NULL) {
prompt_widget = gtk_label_new (text);
gtk_label_set_line_wrap (GTK_LABEL (prompt_widget), TRUE);
gtk_label_set_justify (GTK_LABEL (prompt_widget),
GTK_JUSTIFY_LEFT);
gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox),
prompt_widget,
TRUE, TRUE, GNOME_PAD);
}
/* Run it. */
gtk_widget_show_all (dialog);
return gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
}
gpointer data;
static void
turn_on_line_wrap_flag (GtkWidget *widget, const char *message)
{
char *text;
g_return_val_if_fail (GNOME_IS_DIALOG (dialog), NULL);
g_return_val_if_fail (index >= 0, NULL);
/* Turn on the flag if we find a label with the message
* in it.
*/
if (GTK_IS_LABEL (widget)) {
gtk_label_get (GTK_LABEL (widget), &text);
if (nautilus_strcmp (text, message) == 0) {
gtk_label_set_line_wrap (GTK_LABEL (widget), TRUE);
}
data = g_list_nth_data (GNOME_DIALOG (dialog)->buttons, index);
if (data == NULL) {
return NULL;
}
/* Recurse for children. */
if (GTK_IS_CONTAINER (widget)) {
gtk_container_foreach (GTK_CONTAINER (widget),
turn_on_line_wrap_flag_callback,
(char *) message);
}
return GTK_BUTTON (data);
}
static void
turn_on_line_wrap_flag_callback (GtkWidget *widget, gpointer callback_data)
void
nautilus_gnome_canvas_item_request_update_deep (GnomeCanvasItem *item)
{
turn_on_line_wrap_flag (widget, callback_data);
}
/* Shamelessly stolen from gnome-dialog-util.c: */
static GtkWidget *
show_ok_box (const char *message,
const char *type,
GtkWindow *parent)
{
GtkWidget *box;
box = gnome_message_box_new
(message, type, GNOME_STOCK_BUTTON_OK, NULL);
/* A bit of a hack. We want to use gnome_message_box_new,
* but we want the message to be wrapped. So, we search
* for the label with this message so we can mark it.
*/
turn_on_line_wrap_flag (box, message);
if (parent != NULL) {
gnome_dialog_set_parent (GNOME_DIALOG(box), parent);
}
gtk_widget_show (box);
return box;
}
static GtkWidget *
show_yes_no_box (const char *message,
const char *type,
const char *yes_label,
const char *no_label,
GtkWindow *parent)
{
GtkWidget *box;
box = gnome_message_box_new
(message, type, yes_label, no_label, NULL);
/* A bit of a hack. We want to use gnome_message_box_new,
* but we want the message to be wrapped. So, we search
* for the label with this message so we can mark it.
*/
turn_on_line_wrap_flag (box, message);
GList *p;
if (parent != NULL) {
gnome_dialog_set_parent (GNOME_DIALOG(box), parent);
gnome_canvas_item_request_update (item);
if (GNOME_IS_CANVAS_GROUP (item)) {
for (p = GNOME_CANVAS_GROUP (item)->item_list; p != NULL; p = p->next) {
nautilus_gnome_canvas_item_request_update_deep (p->data);
}
}
gtk_widget_show (box);
return box;
}
GtkWidget *
nautilus_info_dialog (const char *info)
{
return show_ok_box (info, GNOME_MESSAGE_BOX_INFO, NULL);
}
GtkWidget *
nautilus_info_dialog_parented (const char *info,
GtkWindow *parent)
{
return show_ok_box (info, GNOME_MESSAGE_BOX_INFO, parent);
}
GtkWidget *
nautilus_warning_dialog (const char *warning)
{
return show_ok_box (warning, GNOME_MESSAGE_BOX_WARNING, NULL);
}
GtkWidget *
nautilus_warning_dialog_parented (const char *warning,
GtkWindow *parent)
{
return show_ok_box (warning, GNOME_MESSAGE_BOX_WARNING, parent);
}
GtkWidget *
nautilus_error_dialog (const char *error)
{
return show_ok_box (error, GNOME_MESSAGE_BOX_ERROR, NULL);
}
GtkWidget *
nautilus_error_dialog_parented (const char *error,
GtkWindow *parent)
void
nautilus_gnome_canvas_request_update_all (GnomeCanvas *canvas)
{
return show_ok_box (error, GNOME_MESSAGE_BOX_ERROR, parent);
nautilus_gnome_canvas_item_request_update_deep (canvas->root);
}
/**
* nautilus_yes_no_dialog:
*
* Create a dialog asking a question with two choices.
* The caller needs to set up any necessary callbacks
* for the buttons.
* @question: The text of the question.
* @yes_label: The label of the "yes" button.
* @no_label: The label of the "no" button.
/* The gnome_canvas_set_scroll_region function doesn't do an update,
* even though it should. The update is in there with an #if 0 around
* it, with no explanation of why it's commented out. For now, work
* around this by requesting an update explicitly.
*/
GtkWidget *
nautilus_yes_no_dialog (const char *question,
const char *yes_label,
const char *no_label)
void
nautilus_gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
double x1, double y1,
double x2, double y2)
{
return show_yes_no_box (question,
GNOME_MESSAGE_BOX_QUESTION,
yes_label,
no_label,
NULL);
double old_x1, old_y1, old_x2, old_y2;
/* Change the scroll region and do an update if it changes. */
gnome_canvas_get_scroll_region (canvas, &old_x1, &old_y1, &old_x2, &old_y2);
if (old_x1 != x1 || old_y1 != y1 || old_x2 != x2 || old_y2 != y2) {
gnome_canvas_set_scroll_region (canvas, x1, y1, x2, y2);
nautilus_gnome_canvas_request_update_all (canvas);
gnome_canvas_item_request_update (canvas->root);
}
}
/**
* nautilus_yes_no_dialog_parented:
*
* Create a parented dialog asking a question with two choices.
* The caller needs to set up any necessary callbacks
* for the buttons.
* @question: The text of the question.
* @yes_label: The label of the "yes" button.
* @no_label: The label of the "no" button.
* @parent: The parent window for this dialog.
/* The code in GnomeCanvas (the scroll_to function to be exact) always
* centers the contents of the canvas if the contents are smaller than
* the canvas, and it does some questionable math when computing
* that. This code is working to undo that mistake.
*/
GtkWidget *
nautilus_yes_no_dialog_parented (const char *question,
const char *yes_label,
const char *no_label,
GtkWindow *parent)
{
return show_yes_no_box (question,
GNOME_MESSAGE_BOX_QUESTION,
yes_label,
no_label,
parent);
}
GtkButton *
nautilus_gnome_dialog_get_button_by_index (GnomeDialog *dialog, int index)
void
nautilus_gnome_canvas_set_scroll_region_left_justify (GnomeCanvas *canvas,
double x1, double y1,
double x2, double y2)
{
gpointer data;
g_return_val_if_fail (GNOME_IS_DIALOG (dialog), NULL);
g_return_val_if_fail (index >= 0, NULL);
data = g_list_nth_data (GNOME_DIALOG (dialog)->buttons, index);
if (data == NULL) {
return NULL;
}
double height, width;
return GTK_BUTTON (data);
}
\ No newline at end of file
/* To work around the logic in scroll_to that centers the
* canvas contents if they are smaller than the canvas widget,
* we must do the exact opposite of what it does. The -1 here
* is due to the ill-conceived ++ in scroll_to.
*/
width = (GTK_WIDGET (canvas)->allocation.width - 1) / canvas->pixels_per_unit;
height = (GTK_WIDGET (canvas)->allocation.height - 1) / canvas->pixels_per_unit;
nautilus_gnome_canvas_set_scroll_region
(canvas, x1, y1,
MAX (x2, x1 + width), MAX (y2, y1 + height));
}
......@@ -37,6 +37,24 @@ typedef struct {
int y;
} NautilusArtIPoint;
/* Causes an update as needed. The GnomeCanvas code says it should, but it doesn't. */
void nautilus_gnome_canvas_set_scroll_region (GnomeCanvas *canvas,
double x1,
double y1,
double x2,
double y2);
/* Make the scroll region bigger so the code in GnomeCanvas won't center it. */
void nautilus_gnome_canvas_set_scroll_region_left_justify (GnomeCanvas *canvas,
double x1,
double y1,
double x2,
double y2);
/* For cases where you need to get more than one item updated. */
void nautilus_gnome_canvas_request_update_all (GnomeCanvas *canvas);
void nautilus_gnome_canvas_item_request_update_deep (GnomeCanvasItem *item);
/* This is more handy than gnome_canvas_item_get_bounds because it
* always returns the bounds * in world coordinates and it returns
* them in a single rectangle.
......@@ -67,12 +85,14 @@ void nautilus_gnome_canvas_request_redraw_rectangle (GnomeCanvas
*/
void nautilus_gnome_canvas_item_request_redraw (GnomeCanvasItem *item);
/* fill a canvas buffer with a gradient background */
void nautilus_gnome_canvas_fill_with_gradient (GnomeCanvasBuf *buffer,
int entire_width, int entire_height,
guint32 start_rgb,
guint32 end_rgb,
gboolean horizontal);
/* Fill a canvas buffer with a gradient background. */
void nautilus_gnome_canvas_fill_with_gradient (GnomeCanvasBuf *buffer,
int entire_width,
int entire_height,
guint32 start_rgb,
guint32 end_rgb,
gboolean horizontal);
/* More functions for ArtIRect and ArtDRect. */
gboolean nautilus_art_irect_equal (const ArtIRect *rect_a,
const ArtIRect *rect_b);
......@@ -82,32 +102,9 @@ gboolean nautilus_art_irect_hits_irect (const ArtIRect
const ArtIRect *rect_b);
gboolean nautilus_art_irect_contains_irect (const ArtIRect *outer_rect,
const ArtIRect *inner_rect);
int nautilus_simple_dialog (GtkWidget *parent,
const char *text,
const char *title,
...);
/* Variations on gnome dialogs that use text with line-wrapping turned on. */
GtkWidget *nautilus_info_dialog (const char *info);
GtkWidget *nautilus_info_dialog_parented (const char *info,
GtkWindow *parent);
GtkWidget *nautilus_warning_dialog (const char *warning);
GtkWidget *nautilus_warning_dialog_parented (const char *warning,
GtkWindow *parent);
GtkWidget *nautilus_error_dialog (const char *error);
GtkWidget *nautilus_error_dialog_parented (const char *error,
GtkWindow *parent);
GtkWidget *nautilus_yes_no_dialog (const char *question,
const char *yes_label,
const char *no_label);
GtkWidget *nautilus_yes_no_dialog_parented (const char *question,
const char *yes_label,
const char *no_label,
GtkWindow *parent);
/* More functions for GnomeDialog */
GtkButton *nautilus_gnome_dialog_get_button_by_index (GnomeDialog *dialog,
int index);
GtkButton *nautilus_gnome_dialog_get_button_by_index (GnomeDialog *dialog,
int index);
#endif /* NAUTILUS_GNOME_EXTENSIONS_H */
......@@ -913,3 +913,31 @@ nautilus_gtk_pixmap_new_empty (void)
return pixmap;
}
/* The standard gtk_adjustment_set_value ignores page size, which
* disagrees with the logic used by scroll bars, for example.
*/
void
nautilus_gtk_adjustment_set_value (GtkAdjustment *adjustment,
float value)
{
float upper_page_start, clamped_value;
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
upper_page_start = MAX (adjustment->upper - adjustment->page_size, adjustment->lower);
clamped_value = CLAMP (value, adjustment->lower, upper_page_start);
if (clamped_value != adjustment->value) {
adjustment->value = clamped_value;
gtk_adjustment_value_changed (adjustment);
}
}
/* Clamp a value if the minimum or maximum has changed. */
void
nautilus_gtk_adjustment_clamp_value (GtkAdjustment *adjustment)
{
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
nautilus_gtk_adjustment_set_value (adjustment, adjustment->value);
}
......@@ -35,15 +35,15 @@
#define NAUTILUS_DEFAULT_POPUP_MENU_DISPLACEMENT 2
/* GtkButton */
void nautilus_gtk_button_auto_click (GtkButton *button);
void nautilus_gtk_button_set_padding (GtkButton *button,
int pad_amount);
void nautilus_gtk_button_auto_click (GtkButton *button);
void nautilus_gtk_button_set_padding (GtkButton *button,
int pad_amount);
/* GtkCList */
int nautilus_gtk_clist_get_first_selected_row (GtkCList *list);
int nautilus_gtk_clist_get_last_selected_row (GtkCList *list);
void nautilus_gtk_clist_set_double_click_button (GtkCList *clist,
GtkButton *button);
void nautilus_gtk_clist_set_double_click_button (GtkCList *clist,
GtkButton *button);