From a2eed4c206d801569f51cb120aeeebc7e2d8379b Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Sun, 25 Oct 1998 11:33:11 +0000 Subject: [PATCH] This is really a HEAD merge, I want GLE to work ;) -Yosh Thu Oct 22 02:29:53 1998 Tim Janik * gtk/gtkfilesel.h: GtkType and macro fixups * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern for the file selection widget to try a completion on (set the initial filter). Wed Oct 14 14:34:04 1998 Tim Janik * gtk/gtkmain.c: implement idle functions via GHook. this gives a slight speed improvement and lessens code duplication. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-0 | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-2 | 12 ++++++++++++ ChangeLog.pre-2-4 | 12 ++++++++++++ ChangeLog.pre-2-6 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtkfilesel.c | 35 ++++++++++++++++++++++++----------- gtk/gtkfilesel.h | 20 ++++++++++++-------- 9 files changed, 120 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90d3ec7c53..a8dcdc6527 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +Thu Oct 22 02:29:53 1998 Tim Janik + + * gtk/gtkfilesel.h: GtkType and macro fixups + * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern + for the file selection widget to try a completion on (set the + initial filter). + +Wed Oct 14 14:34:04 1998 Tim Janik + + * gtk/gtkmain.c: implement idle functions via GHook. this gives a + slight speed improvement and lessens code duplication. + Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 90d3ec7c53..a8dcdc6527 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,15 @@ +Thu Oct 22 02:29:53 1998 Tim Janik + + * gtk/gtkfilesel.h: GtkType and macro fixups + * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern + for the file selection widget to try a completion on (set the + initial filter). + +Wed Oct 14 14:34:04 1998 Tim Janik + + * gtk/gtkmain.c: implement idle functions via GHook. this gives a + slight speed improvement and lessens code duplication. + Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 90d3ec7c53..a8dcdc6527 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +Thu Oct 22 02:29:53 1998 Tim Janik + + * gtk/gtkfilesel.h: GtkType and macro fixups + * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern + for the file selection widget to try a completion on (set the + initial filter). + +Wed Oct 14 14:34:04 1998 Tim Janik + + * gtk/gtkmain.c: implement idle functions via GHook. this gives a + slight speed improvement and lessens code duplication. + Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 90d3ec7c53..a8dcdc6527 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,15 @@ +Thu Oct 22 02:29:53 1998 Tim Janik + + * gtk/gtkfilesel.h: GtkType and macro fixups + * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern + for the file selection widget to try a completion on (set the + initial filter). + +Wed Oct 14 14:34:04 1998 Tim Janik + + * gtk/gtkmain.c: implement idle functions via GHook. this gives a + slight speed improvement and lessens code duplication. + Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 90d3ec7c53..a8dcdc6527 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +Thu Oct 22 02:29:53 1998 Tim Janik + + * gtk/gtkfilesel.h: GtkType and macro fixups + * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern + for the file selection widget to try a completion on (set the + initial filter). + +Wed Oct 14 14:34:04 1998 Tim Janik + + * gtk/gtkmain.c: implement idle functions via GHook. this gives a + slight speed improvement and lessens code duplication. + Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 90d3ec7c53..a8dcdc6527 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +Thu Oct 22 02:29:53 1998 Tim Janik + + * gtk/gtkfilesel.h: GtkType and macro fixups + * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern + for the file selection widget to try a completion on (set the + initial filter). + +Wed Oct 14 14:34:04 1998 Tim Janik + + * gtk/gtkmain.c: implement idle functions via GHook. this gives a + slight speed improvement and lessens code duplication. + Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 90d3ec7c53..a8dcdc6527 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +Thu Oct 22 02:29:53 1998 Tim Janik + + * gtk/gtkfilesel.h: GtkType and macro fixups + * gtk/gtkfilesel.c (gtk_file_selection_complete): set a pattern + for the file selection widget to try a completion on (set the + initial filter). + +Wed Oct 14 14:34:04 1998 Tim Janik + + * gtk/gtkmain.c: implement idle functions via GHook. this gives a + slight speed improvement and lessens code duplication. + Thu Oct 22 02:27:30 PDT 1998 Manish Singh * gdk/gdkrgb.c: use glib endian stuff diff --git a/gtk/gtkfilesel.c b/gtk/gtkfilesel.c index e6d7ff34b4..c9efc1b317 100644 --- a/gtk/gtkfilesel.c +++ b/gtk/gtkfilesel.c @@ -322,10 +322,10 @@ static GtkWindowClass *parent_class = NULL; /* Saves errno when something cmpl does fails. */ static gint cmpl_errno; -guint +GtkType gtk_file_selection_get_type (void) { - static guint file_selection_type = 0; + static GtkType file_selection_type = 0; if (!file_selection_type) { @@ -341,7 +341,7 @@ gtk_file_selection_get_type (void) (GtkClassInitFunc) NULL, }; - file_selection_type = gtk_type_unique (gtk_window_get_type (), &filesel_info); + file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info); } return file_selection_type; @@ -354,7 +354,7 @@ gtk_file_selection_class_init (GtkFileSelectionClass *class) object_class = (GtkObjectClass*) class; - parent_class = gtk_type_class (gtk_window_get_type ()); + parent_class = gtk_type_class (GTK_TYPE_WINDOW); object_class->destroy = gtk_file_selection_destroy; } @@ -497,7 +497,7 @@ gtk_file_selection_new (const gchar *title) { GtkFileSelection *filesel; - filesel = gtk_type_new (gtk_file_selection_get_type ()); + filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION); gtk_window_set_title (GTK_WINDOW (filesel), title); return GTK_WIDGET (filesel); @@ -627,6 +627,19 @@ gtk_file_selection_get_filename (GtkFileSelection *filesel) return nothing; } +void +gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern) +{ + g_return_if_fail (filesel != NULL); + g_return_if_fail (GTK_IS_FILE_SELECTION (filesel)); + g_return_if_fail (pattern != NULL); + + if (filesel->selection_entry) + gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), pattern); + gtk_file_selection_populate (filesel, (gchar*) pattern, TRUE); +} + static void gtk_file_selection_destroy (GtkObject *object) { @@ -1696,7 +1709,7 @@ cmpl_completion_matches (gchar* text_to_complete, prune_memory_usage(cmpl_state); - g_assert(text_to_complete); + g_assert (text_to_complete != NULL); cmpl_state->user_completion_index = -1; cmpl_state->last_completion_text = text_to_complete; @@ -1706,14 +1719,14 @@ cmpl_completion_matches (gchar* text_to_complete, cmpl_state->updated_text[0] = 0; cmpl_state->re_complete = FALSE; - first_slash = strchr(text_to_complete, '/'); + first_slash = strchr (text_to_complete, '/'); - if(text_to_complete[0] == '~' && !first_slash) + if (text_to_complete[0] == '~' && !first_slash) { /* Text starts with ~ and there is no slash, show all the * home directory completions. */ - poss = attempt_homedir_completion(text_to_complete, cmpl_state); + poss = attempt_homedir_completion (text_to_complete, cmpl_state); update_cmpl(poss, cmpl_state); @@ -1721,13 +1734,13 @@ cmpl_completion_matches (gchar* text_to_complete, } cmpl_state->reference_dir = - open_ref_dir(text_to_complete, remaining_text, cmpl_state); + open_ref_dir (text_to_complete, remaining_text, cmpl_state); if(!cmpl_state->reference_dir) return NULL; cmpl_state->completion_dir = - find_completion_dir(*remaining_text, remaining_text, cmpl_state); + find_completion_dir (*remaining_text, remaining_text, cmpl_state); cmpl_state->last_valid_char = *remaining_text - text_to_complete; diff --git a/gtk/gtkfilesel.h b/gtk/gtkfilesel.h index 57fd174869..05be30e07c 100644 --- a/gtk/gtkfilesel.h +++ b/gtk/gtkfilesel.h @@ -29,9 +29,11 @@ extern "C" { #endif /* __cplusplus */ -#define GTK_FILE_SELECTION(obj) GTK_CHECK_CAST (obj, gtk_file_selection_get_type (), GtkFileSelection) -#define GTK_FILE_SELECTION_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, gtk_file_selection_get_type (), GtkFileSelectionClass) -#define GTK_IS_FILE_SELECTION(obj) GTK_CHECK_TYPE (obj, gtk_file_selection_get_type ()) +#define GTK_TYPE_FILE_SELECTION (gtk_file_selection_get_type ()) +#define GTK_FILE_SELECTION(obj) (GTK_CHECK_CAST ((obj), GTK_TYPE_FILE_SELECTION, GtkFileSelection)) +#define GTK_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_FILE_SELECTION, GtkFileSelectionClass)) +#define GTK_IS_FILE_SELECTION(obj) (GTK_CHECK_TYPE ((obj), GTK_TYPE_FILE_SELECTION)) +#define GTK_IS_FILE_SELECTION_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_FILE_SELECTION)) typedef struct _GtkFileSelection GtkFileSelection; @@ -72,11 +74,13 @@ struct _GtkFileSelectionClass }; -guint gtk_file_selection_get_type (void); -GtkWidget* gtk_file_selection_new (const gchar *title); -void gtk_file_selection_set_filename (GtkFileSelection *filesel, - const gchar *filename); -gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); +GtkType gtk_file_selection_get_type (void); +GtkWidget* gtk_file_selection_new (const gchar *title); +void gtk_file_selection_set_filename (GtkFileSelection *filesel, + const gchar *filename); +gchar* gtk_file_selection_get_filename (GtkFileSelection *filesel); +void gtk_file_selection_complete (GtkFileSelection *filesel, + const gchar *pattern); void gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel); void gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel);