1997-11-24 22:37:52 +00:00
|
|
|
/* GTK - The GIMP Toolkit
|
|
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
|
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Library General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Library General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Library General Public
|
1998-04-13 02:02:47 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
1997-11-24 22:37:52 +00:00
|
|
|
*/
|
1999-02-24 07:37:18 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Modified by the GTK+ Team and others 1997-1999. See the AUTHORS
|
|
|
|
* file for a list of people on the GTK+ Team. See the ChangeLog
|
|
|
|
* files for a list of changes. These files are distributed with
|
|
|
|
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
|
|
|
*/
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#include "config.h"
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_SYS_PARAM_H
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <sys/param.h>
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
#ifdef HAVE_DIRENT_H
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <dirent.h>
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <stdlib.h>
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_UNISTD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <unistd.h>
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include <errno.h>
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
#include <pwd.h>
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "fnmatch.h"
|
|
|
|
|
|
|
|
#include "gdk/gdkkeysyms.h"
|
|
|
|
#include "gtkbutton.h"
|
|
|
|
#include "gtkentry.h"
|
|
|
|
#include "gtkfilesel.h"
|
|
|
|
#include "gtkhbox.h"
|
1998-03-22 16:59:59 +00:00
|
|
|
#include "gtkhbbox.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
#include "gtklabel.h"
|
|
|
|
#include "gtklist.h"
|
|
|
|
#include "gtklistitem.h"
|
|
|
|
#include "gtkmain.h"
|
|
|
|
#include "gtkscrolledwindow.h"
|
|
|
|
#include "gtksignal.h"
|
|
|
|
#include "gtkvbox.h"
|
1998-01-21 07:53:07 +00:00
|
|
|
#include "gtkmenu.h"
|
|
|
|
#include "gtkmenuitem.h"
|
|
|
|
#include "gtkoptionmenu.h"
|
|
|
|
#include "gtkclist.h"
|
|
|
|
#include "gtkdialog.h"
|
1998-12-14 17:39:58 +00:00
|
|
|
#include "gtkintl.h"
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
This might seem like a large patch, but it isn't that bad, and nothing
should break on Unix/X11.
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-15 00:03:37 +00:00
|
|
|
#define STRICT
|
|
|
|
#include <windows.h>
|
|
|
|
|
1999-10-04 19:03:05 +00:00
|
|
|
#ifdef G_OS_WIN32
|
This might seem like a large patch, but it isn't that bad, and nothing
should break on Unix/X11.
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-15 00:03:37 +00:00
|
|
|
#include <direct.h>
|
1999-04-25 21:55:05 +00:00
|
|
|
#include <io.h>
|
|
|
|
#define mkdir(p,m) _mkdir(p)
|
This might seem like a large patch, but it isn't that bad, and nothing
should break on Unix/X11.
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-15 00:03:37 +00:00
|
|
|
#ifndef S_ISDIR
|
|
|
|
#define S_ISDIR(mode) ((mode)&_S_IFDIR)
|
|
|
|
#endif
|
1999-04-25 21:55:05 +00:00
|
|
|
|
1999-10-04 19:03:05 +00:00
|
|
|
#endif /* G_OS_WIN32 */
|
1999-04-25 21:55:05 +00:00
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#endif /* G_OS_WIN32 || G_WITH_CYGWIN */
|
This might seem like a large patch, but it isn't that bad, and nothing
should break on Unix/X11.
Win32 merge and general portability stuff:
* acconfig.h,configure.in: Check for <sys/time.h>.
* gdk/win32: New directory (actually, been there for a while).
* gtk/fnmatch.c: Include <glib.h> for G_DIR_SEPARATOR, WIN32 and
NATIVE_WIN32, and use these. Always case fold on Win32. No
backslashed escapes on native Win32.
* gtk/{gtk.def,makefile.msc}: New files.
* gtk/Makefile.am: Add above new files.
* gtk/{gtkaccelgroup,gtkbindings}.c: Include <string.h>
instead of <strings.h>.
* gtk/{gtkcalendar,gtkitemfactory,gtkpreview,gtkrc}.c: Include
config.h. Protect inclusion of <sys/param.h>, <sys/time.h>, and
<unistd.h> appropriately.
* gtk/gtkdnd.c: Merge in Win32 version (which doesn't do much).
Use ABS() (from <glib.h>) instead of abs().
* gtk/gtkfilesel.c: Moved Win32-specific includes after inclusion
of gtk (and thus glib) headers, so that WIN32 will be
defined. With MS C, include <direct.h> for mkdir prototype.
* gtk/gtkitemfactory.c (gtk_item_factory_callback_marshal): Add
some casts, needed by MS C.
* gtk/{gtklayout,gtkplug}.c: Merge in Win32 version (which isn't
implemented).
* gtk/gtkmain.c: Include gdk/gdkx.h for GDK_WINDOWING. Include
<X11/Xlocale.h> only on X11 platform, otherwise <locale.h>. Use
G_SEARCHPATH_SEPARATOR_S and g_module_build_path.
* gtk/gtkmain.h: Mark variables for export/import on Win32.
* gtk/gtkrange.c (gtk_range_motion_notify): Set mods also in case
the event is not a hint, or its window is not the slider. Needed
on Win32, at least.
* gtk/gtkrc.c: Include config.h and gdk/gdkx.h. Use <locale.h>
unless on X11. Skip \r chars, too. Use G_DIR_SEPARATOR and
G_SEARCHPATH_SEPARATOR(_S). Use g_path_is_absolute. On Win32, use
a subdirectory of the Windows directory as gtk system
configuration directory.
* gtk/gtkselection.c: No chunks on Win32.
* gtk/gtksocket.c: Not implemented on Win32.
* gtk/gtkthemes.c (gtk_theme_engine_get): Use g_module_build_path.
* gtk/makeenums.h: Include gdkprivate.h after gdk.h.
* gtk/testrgb.c: Use dynamically allocated buffer. Use GTimers.
1999-03-15 00:03:37 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
#define DIR_LIST_WIDTH 180
|
|
|
|
#define DIR_LIST_HEIGHT 180
|
|
|
|
#define FILE_LIST_WIDTH 180
|
|
|
|
#define FILE_LIST_HEIGHT 180
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 09:06:05 +00:00
|
|
|
/* I've put this here so it doesn't get confused with the
|
|
|
|
* file completion interface */
|
|
|
|
typedef struct _HistoryCallbackArg HistoryCallbackArg;
|
|
|
|
|
|
|
|
struct _HistoryCallbackArg
|
|
|
|
{
|
|
|
|
gchar *directory;
|
|
|
|
GtkWidget *menu_item;
|
|
|
|
};
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
typedef struct _CompletionState CompletionState;
|
|
|
|
typedef struct _CompletionDir CompletionDir;
|
|
|
|
typedef struct _CompletionDirSent CompletionDirSent;
|
|
|
|
typedef struct _CompletionDirEntry CompletionDirEntry;
|
|
|
|
typedef struct _CompletionUserDir CompletionUserDir;
|
|
|
|
typedef struct _PossibleCompletion PossibleCompletion;
|
|
|
|
|
|
|
|
/* Non-external file completion decls and structures */
|
|
|
|
|
|
|
|
/* A contant telling PRCS how many directories to cache. Its actually
|
|
|
|
* kept in a list, so the geometry isn't important. */
|
|
|
|
#define CMPL_DIRECTORY_CACHE_SIZE 10
|
|
|
|
|
|
|
|
/* A constant used to determine whether a substring was an exact
|
|
|
|
* match by first_diff_index()
|
|
|
|
*/
|
|
|
|
#define PATTERN_MATCH -1
|
|
|
|
/* The arguments used by all fnmatch() calls below
|
|
|
|
*/
|
|
|
|
#define FNMATCH_FLAGS (FNM_PATHNAME | FNM_PERIOD)
|
|
|
|
|
|
|
|
#define CMPL_ERRNO_TOO_LONG ((1<<16)-1)
|
|
|
|
|
|
|
|
/* This structure contains all the useful information about a directory
|
|
|
|
* for the purposes of filename completion. These structures are cached
|
|
|
|
* in the CompletionState struct. CompletionDir's are reference counted.
|
|
|
|
*/
|
|
|
|
struct _CompletionDirSent
|
|
|
|
{
|
|
|
|
ino_t inode;
|
|
|
|
time_t mtime;
|
1998-04-07 23:59:25 +00:00
|
|
|
dev_t device;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
gint entry_count;
|
|
|
|
struct _CompletionDirEntry *entries;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _CompletionDir
|
|
|
|
{
|
|
|
|
CompletionDirSent *sent;
|
|
|
|
|
|
|
|
gchar *fullname;
|
|
|
|
gint fullname_len;
|
|
|
|
|
|
|
|
struct _CompletionDir *cmpl_parent;
|
|
|
|
gint cmpl_index;
|
|
|
|
gchar *cmpl_text;
|
|
|
|
};
|
|
|
|
|
|
|
|
/* This structure contains pairs of directory entry names with a flag saying
|
|
|
|
* whether or not they are a valid directory. NOTE: This information is used
|
|
|
|
* to provide the caller with information about whether to update its completions
|
|
|
|
* or try to open a file. Since directories are cached by the directory mtime,
|
|
|
|
* a symlink which points to an invalid file (which will not be a directory),
|
|
|
|
* will not be reevaluated if that file is created, unless the containing
|
|
|
|
* directory is touched. I consider this case to be worth ignoring (josh).
|
|
|
|
*/
|
|
|
|
struct _CompletionDirEntry
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
gboolean is_dir;
|
1997-11-24 22:37:52 +00:00
|
|
|
gchar *entry_name;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _CompletionUserDir
|
|
|
|
{
|
|
|
|
gchar *login;
|
|
|
|
gchar *homedir;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _PossibleCompletion
|
|
|
|
{
|
|
|
|
/* accessible fields, all are accessed externally by functions
|
|
|
|
* declared above
|
|
|
|
*/
|
|
|
|
gchar *text;
|
|
|
|
gint is_a_completion;
|
2000-02-03 01:19:03 +00:00
|
|
|
gboolean is_directory;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
/* Private fields
|
|
|
|
*/
|
|
|
|
gint text_alloc;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _CompletionState
|
|
|
|
{
|
|
|
|
gint last_valid_char;
|
|
|
|
gchar *updated_text;
|
|
|
|
gint updated_text_len;
|
|
|
|
gint updated_text_alloc;
|
2000-02-03 01:19:03 +00:00
|
|
|
gboolean re_complete;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
gchar *user_dir_name_buffer;
|
|
|
|
gint user_directories_len;
|
|
|
|
|
|
|
|
gchar *last_completion_text;
|
|
|
|
|
|
|
|
gint user_completion_index; /* if >= 0, currently completing ~user */
|
|
|
|
|
|
|
|
struct _CompletionDir *completion_dir; /* directory completing from */
|
|
|
|
struct _CompletionDir *active_completion_dir;
|
|
|
|
|
|
|
|
struct _PossibleCompletion the_completion;
|
|
|
|
|
|
|
|
struct _CompletionDir *reference_dir; /* initial directory */
|
|
|
|
|
|
|
|
GList* directory_storage;
|
|
|
|
GList* directory_sent_storage;
|
|
|
|
|
|
|
|
struct _CompletionUserDir *user_directories;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* File completion functions which would be external, were they used
|
|
|
|
* outside of this file.
|
|
|
|
*/
|
|
|
|
|
|
|
|
static CompletionState* cmpl_init_state (void);
|
|
|
|
static void cmpl_free_state (CompletionState *cmpl_state);
|
|
|
|
static gint cmpl_state_okay (CompletionState* cmpl_state);
|
|
|
|
static gchar* cmpl_strerror (gint);
|
|
|
|
|
|
|
|
static PossibleCompletion* cmpl_completion_matches(gchar *text_to_complete,
|
|
|
|
gchar **remaining_text,
|
|
|
|
CompletionState *cmpl_state);
|
|
|
|
|
|
|
|
/* Returns a name for consideration, possibly a completion, this name
|
|
|
|
* will be invalid after the next call to cmpl_next_completion.
|
|
|
|
*/
|
|
|
|
static char* cmpl_this_completion (PossibleCompletion*);
|
|
|
|
|
|
|
|
/* True if this completion matches the given text. Otherwise, this
|
|
|
|
* output can be used to have a list of non-completions.
|
|
|
|
*/
|
|
|
|
static gint cmpl_is_a_completion (PossibleCompletion*);
|
|
|
|
|
|
|
|
/* True if the completion is a directory
|
|
|
|
*/
|
2000-02-03 01:19:03 +00:00
|
|
|
static gboolean cmpl_is_directory (PossibleCompletion*);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
/* Obtains the next completion, or NULL
|
|
|
|
*/
|
|
|
|
static PossibleCompletion* cmpl_next_completion (CompletionState*);
|
|
|
|
|
|
|
|
/* Updating completions: the return value of cmpl_updated_text() will
|
|
|
|
* be text_to_complete completed as much as possible after the most
|
|
|
|
* recent call to cmpl_completion_matches. For the present
|
|
|
|
* application, this is the suggested replacement for the user's input
|
|
|
|
* string. You must CALL THIS AFTER ALL cmpl_text_completions have
|
|
|
|
* been received.
|
|
|
|
*/
|
|
|
|
static gchar* cmpl_updated_text (CompletionState* cmpl_state);
|
|
|
|
|
|
|
|
/* After updating, to see if the completion was a directory, call
|
|
|
|
* this. If it was, you should consider re-calling completion_matches.
|
|
|
|
*/
|
2000-02-03 01:19:03 +00:00
|
|
|
static gboolean cmpl_updated_dir (CompletionState* cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
/* Current location: if using file completion, return the current
|
|
|
|
* directory, from which file completion begins. More specifically,
|
|
|
|
* the cwd concatenated with all exact completions up to the last
|
|
|
|
* directory delimiter('/').
|
|
|
|
*/
|
|
|
|
static gchar* cmpl_reference_position (CompletionState* cmpl_state);
|
|
|
|
|
|
|
|
/* backing up: if cmpl_completion_matches returns NULL, you may query
|
|
|
|
* the index of the last completable character into cmpl_updated_text.
|
|
|
|
*/
|
|
|
|
static gint cmpl_last_valid_char (CompletionState* cmpl_state);
|
|
|
|
|
|
|
|
/* When the user selects a non-directory, call cmpl_completion_fullname
|
|
|
|
* to get the full name of the selected file.
|
|
|
|
*/
|
|
|
|
static gchar* cmpl_completion_fullname (gchar*, CompletionState* cmpl_state);
|
|
|
|
|
|
|
|
|
|
|
|
/* Directory operations. */
|
|
|
|
static CompletionDir* open_ref_dir (gchar* text_to_complete,
|
|
|
|
gchar** remaining_text,
|
|
|
|
CompletionState* cmpl_state);
|
1999-10-06 19:47:24 +00:00
|
|
|
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
|
1998-09-12 14:41:04 +00:00
|
|
|
static gboolean check_dir (gchar *dir_name,
|
|
|
|
struct stat *result,
|
|
|
|
gboolean *stat_subdirs);
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
static CompletionDir* open_dir (gchar* dir_name,
|
|
|
|
CompletionState* cmpl_state);
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
static CompletionDir* open_user_dir (gchar* text_to_complete,
|
|
|
|
CompletionState *cmpl_state);
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
static CompletionDir* open_relative_dir (gchar* dir_name, CompletionDir* dir,
|
|
|
|
CompletionState *cmpl_state);
|
1998-09-12 14:41:04 +00:00
|
|
|
static CompletionDirSent* open_new_dir (gchar* dir_name,
|
|
|
|
struct stat* sbuf,
|
|
|
|
gboolean stat_subdirs);
|
1997-11-24 22:37:52 +00:00
|
|
|
static gint correct_dir_fullname (CompletionDir* cmpl_dir);
|
|
|
|
static gint correct_parent (CompletionDir* cmpl_dir,
|
|
|
|
struct stat *sbuf);
|
|
|
|
static gchar* find_parent_dir_fullname (gchar* dirname);
|
|
|
|
static CompletionDir* attach_dir (CompletionDirSent* sent,
|
|
|
|
gchar* dir_name,
|
|
|
|
CompletionState *cmpl_state);
|
|
|
|
static void free_dir_sent (CompletionDirSent* sent);
|
|
|
|
static void free_dir (CompletionDir *dir);
|
|
|
|
static void prune_memory_usage(CompletionState *cmpl_state);
|
|
|
|
|
|
|
|
/* Completion operations */
|
|
|
|
static PossibleCompletion* attempt_homedir_completion(gchar* text_to_complete,
|
|
|
|
CompletionState *cmpl_state);
|
|
|
|
static PossibleCompletion* attempt_file_completion(CompletionState *cmpl_state);
|
|
|
|
static CompletionDir* find_completion_dir(gchar* text_to_complete,
|
|
|
|
gchar** remaining_text,
|
|
|
|
CompletionState* cmpl_state);
|
|
|
|
static PossibleCompletion* append_completion_text(gchar* text,
|
|
|
|
CompletionState* cmpl_state);
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
static gint get_pwdb(CompletionState* cmpl_state);
|
|
|
|
static gint compare_user_dir(const void* a, const void* b);
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
static gint first_diff_index(gchar* pat, gchar* text);
|
1997-11-24 22:37:52 +00:00
|
|
|
static gint compare_cmpl_dir(const void* a, const void* b);
|
|
|
|
static void update_cmpl(PossibleCompletion* poss,
|
|
|
|
CompletionState* cmpl_state);
|
|
|
|
|
|
|
|
static void gtk_file_selection_class_init (GtkFileSelectionClass *klass);
|
|
|
|
static void gtk_file_selection_init (GtkFileSelection *filesel);
|
|
|
|
static void gtk_file_selection_destroy (GtkObject *object);
|
|
|
|
static gint gtk_file_selection_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event,
|
|
|
|
gpointer user_data);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
|
|
|
static void gtk_file_selection_file_button (GtkWidget *widget,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
1998-02-19 02:59:55 +00:00
|
|
|
GdkEventButton *bevent,
|
1998-01-21 07:53:07 +00:00
|
|
|
gpointer user_data);
|
|
|
|
|
|
|
|
static void gtk_file_selection_dir_button (GtkWidget *widget,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
1998-02-19 02:59:55 +00:00
|
|
|
GdkEventButton *bevent,
|
1998-01-21 07:53:07 +00:00
|
|
|
gpointer data);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void gtk_file_selection_populate (GtkFileSelection *fs,
|
|
|
|
gchar *rel_path,
|
|
|
|
gint try_complete);
|
|
|
|
static void gtk_file_selection_abort (GtkFileSelection *fs);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
|
|
|
static void gtk_file_selection_update_history_menu (GtkFileSelection *fs,
|
|
|
|
gchar *current_dir);
|
|
|
|
|
|
|
|
static void gtk_file_selection_create_dir (GtkWidget *widget, gpointer data);
|
|
|
|
static void gtk_file_selection_delete_file (GtkWidget *widget, gpointer data);
|
|
|
|
static void gtk_file_selection_rename_file (GtkWidget *widget, gpointer data);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
static GtkWindowClass *parent_class = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
/* Saves errno when something cmpl does fails. */
|
|
|
|
static gint cmpl_errno;
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-13 01:14:19 +00:00
|
|
|
/*
|
|
|
|
* Take the path currently in the file selection
|
|
|
|
* entry field and translate as necessary from
|
|
|
|
* a WIN32 style to CYGWIN32 style path. For
|
|
|
|
* instance translate:
|
|
|
|
* x:\somepath\file.jpg
|
|
|
|
* to:
|
|
|
|
* //x/somepath/file.jpg
|
|
|
|
*
|
|
|
|
* Replace the path in the selection text field.
|
|
|
|
* Return a boolean value concerning whether a
|
|
|
|
* translation had to be made.
|
|
|
|
*/
|
|
|
|
int
|
|
|
|
translate_win32_path(GtkFileSelection *filesel)
|
|
|
|
{
|
|
|
|
int updated = 0;
|
|
|
|
gchar *path;
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Retrieve the current path
|
|
|
|
*/
|
|
|
|
path = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry));
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Translate only if this looks like a DOS-ish
|
|
|
|
* path... First handle any drive letters.
|
|
|
|
*/
|
|
|
|
if (isalpha(path[0]) && (path[1] == ':')) {
|
|
|
|
/*
|
|
|
|
* This part kind of stinks... It isn't possible
|
|
|
|
* to know if there is enough space in the current
|
|
|
|
* string for the extra character required in this
|
|
|
|
* conversion. Assume that there isn't enough space
|
|
|
|
* and use the set function on the text field to
|
|
|
|
* set the newly created string.
|
|
|
|
*/
|
|
|
|
gchar *newPath;
|
|
|
|
|
|
|
|
newPath = g_malloc(strlen(path) + 2);
|
|
|
|
sprintf(newPath, "//%c/%s", path[0], (path + 3));
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), newPath);
|
|
|
|
|
|
|
|
path = newPath;
|
|
|
|
updated = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Now, replace backslashes with forward slashes
|
|
|
|
* if necessary.
|
|
|
|
*/
|
|
|
|
if (strchr(path, '\\')) {
|
|
|
|
int index;
|
|
|
|
for (index = 0; path[index] != '\0'; index++)
|
|
|
|
if (path[index] == '\\')
|
|
|
|
path[index] = '/';
|
|
|
|
|
|
|
|
updated = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return updated;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
GtkType
|
1998-05-03 22:41:32 +00:00
|
|
|
gtk_file_selection_get_type (void)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-10-22 00:54:57 +00:00
|
|
|
static GtkType file_selection_type = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (!file_selection_type)
|
|
|
|
{
|
1998-11-30 19:07:15 +00:00
|
|
|
static const GtkTypeInfo filesel_info =
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
"GtkFileSelection",
|
|
|
|
sizeof (GtkFileSelection),
|
|
|
|
sizeof (GtkFileSelectionClass),
|
|
|
|
(GtkClassInitFunc) gtk_file_selection_class_init,
|
|
|
|
(GtkObjectInitFunc) gtk_file_selection_init,
|
1998-07-04 15:31:30 +00:00
|
|
|
/* reserved_1 */ NULL,
|
|
|
|
/* reserved_2 */ NULL,
|
1998-06-28 07:46:10 +00:00
|
|
|
(GtkClassInitFunc) NULL,
|
1997-11-24 22:37:52 +00:00
|
|
|
};
|
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
file_selection_type = gtk_type_unique (GTK_TYPE_WINDOW, &filesel_info);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return file_selection_type;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_class_init (GtkFileSelectionClass *class)
|
|
|
|
{
|
|
|
|
GtkObjectClass *object_class;
|
|
|
|
|
|
|
|
object_class = (GtkObjectClass*) class;
|
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
parent_class = gtk_type_class (GTK_TYPE_WINDOW);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
object_class->destroy = gtk_file_selection_destroy;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_init (GtkFileSelection *filesel)
|
|
|
|
{
|
|
|
|
GtkWidget *entry_vbox;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *list_hbox;
|
1998-03-06 05:03:15 +00:00
|
|
|
GtkWidget *confirm_area;
|
1998-01-21 07:53:07 +00:00
|
|
|
GtkWidget *pulldown_hbox;
|
1998-11-05 15:44:22 +00:00
|
|
|
GtkWidget *scrolled_win;
|
|
|
|
|
1998-12-14 17:39:58 +00:00
|
|
|
char *dir_title [2];
|
|
|
|
char *file_title [2];
|
1998-01-21 07:53:07 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
filesel->cmpl_state = cmpl_init_state ();
|
1998-03-06 05:03:15 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
/* The dialog-sized vertical box */
|
1997-11-24 22:37:52 +00:00
|
|
|
filesel->main_vbox = gtk_vbox_new (FALSE, 10);
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (filesel), 10);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_container_add (GTK_CONTAINER (filesel), filesel->main_vbox);
|
|
|
|
gtk_widget_show (filesel->main_vbox);
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
/* The horizontal box containing create, rename etc. buttons */
|
1998-03-22 16:59:59 +00:00
|
|
|
filesel->button_area = gtk_hbutton_box_new ();
|
|
|
|
gtk_button_box_set_layout(GTK_BUTTON_BOX(filesel->button_area), GTK_BUTTONBOX_START);
|
|
|
|
gtk_button_box_set_spacing(GTK_BUTTON_BOX(filesel->button_area), 0);
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->button_area,
|
1998-01-21 07:53:07 +00:00
|
|
|
FALSE, FALSE, 0);
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_widget_show (filesel->button_area);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_file_selection_show_fileop_buttons(filesel);
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
/* hbox for pulldown menu */
|
|
|
|
pulldown_hbox = gtk_hbox_new (TRUE, 5);
|
|
|
|
gtk_box_pack_start (GTK_BOX (filesel->main_vbox), pulldown_hbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (pulldown_hbox);
|
|
|
|
|
|
|
|
/* Pulldown menu */
|
|
|
|
filesel->history_pulldown = gtk_option_menu_new ();
|
|
|
|
gtk_widget_show (filesel->history_pulldown);
|
|
|
|
gtk_box_pack_start (GTK_BOX (pulldown_hbox), filesel->history_pulldown,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* The horizontal box containing the directory and file listboxes */
|
1998-01-21 07:53:07 +00:00
|
|
|
list_hbox = gtk_hbox_new (FALSE, 5);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (filesel->main_vbox), list_hbox, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (list_hbox);
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
/* The directories clist */
|
1998-12-17 23:35:22 +00:00
|
|
|
dir_title[0] = _("Directories");
|
|
|
|
dir_title[1] = NULL;
|
reverted marius change to expose the type systems internal type info data
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: reverted marius change to expose the type systems
internal type info data to the user. if such functionality is required
we should provide wrapped accessors, ala gtk_signal_query().
* gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change,
since it destroys the possibility to implement automatic marshaller
lookups some day, and it also disables third party code's ability to
connect to any signal. also the GtkTypeInfo structures are dynamically
allocated memory portions, so only the type system is really allowed
to access that stuff.
Mon Dec 7 01:32:18 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the
Tab key on the entry. the focus shouldn't get lost even if completion
is attempted from an empty entry, since an empty entry string does
indeed have a valid completion meaning (complete all).
(gtk_file_selection_init): cast the gchar array parameter in calls to
gtk_clist_new_with_titles() to quit compiler warnings.
(check_dir): the no_stat_dirs struct must not be const, since we do
indeed modify its contents.
* gtk/testgtk.c (event_watcher): adapted prototype to fit new emission
hook semantics.
* gtk/gtksignal.h:
* gtk/gtksignal.c:
changed emission allocation, so we don't use a doubly linked list
but link ourselfs (singly linked).
changed emission hooks, they get the emision parameters passed as
well now and are emitted during the actuall signal emission (after
the RUN_FIRST class method, but prior to RUN_FIRST handlers).
the existing restrictions do still apply to signal emission hooks,
i.e. an emission may not be stopped or restarted from an emission hook.
due to possibly huge perfomance impacts, frequent use of emision hooks
is also not recommended.
(gtk_signal_next_and_invalidate): added an
assertments which explicits what the code assumes anyways: a
maximum amount of 65535 signals.
* gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(),
gtk_container_foreach_full() should be used instead.
* gtk/gtkmain.h:
deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since
we provide _full variants.
* gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide
gtk_signal_connect_full() for long enough now.
1998-12-07 02:31:19 +00:00
|
|
|
filesel->dir_list = gtk_clist_new_with_titles (1, (gchar**) dir_title);
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_widget_set_usize (filesel->dir_list, DIR_LIST_WIDTH, DIR_LIST_HEIGHT);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (filesel->dir_list), "select_row",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_dir_button,
|
|
|
|
(gpointer) filesel);
|
1998-01-21 09:31:57 +00:00
|
|
|
gtk_clist_column_titles_passive (GTK_CLIST (filesel->dir_list));
|
1998-11-05 15:44:22 +00:00
|
|
|
|
|
|
|
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->dir_list);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
|
|
|
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 5);
|
1998-11-05 15:44:22 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (list_hbox), scrolled_win, TRUE, TRUE, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_show (filesel->dir_list);
|
1998-11-05 15:44:22 +00:00
|
|
|
gtk_widget_show (scrolled_win);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
/* The files clist */
|
1998-12-14 17:39:58 +00:00
|
|
|
file_title[0] = _("Files");
|
|
|
|
file_title[1] = NULL;
|
reverted marius change to expose the type systems internal type info data
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: reverted marius change to expose the type systems
internal type info data to the user. if such functionality is required
we should provide wrapped accessors, ala gtk_signal_query().
* gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change,
since it destroys the possibility to implement automatic marshaller
lookups some day, and it also disables third party code's ability to
connect to any signal. also the GtkTypeInfo structures are dynamically
allocated memory portions, so only the type system is really allowed
to access that stuff.
Mon Dec 7 01:32:18 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the
Tab key on the entry. the focus shouldn't get lost even if completion
is attempted from an empty entry, since an empty entry string does
indeed have a valid completion meaning (complete all).
(gtk_file_selection_init): cast the gchar array parameter in calls to
gtk_clist_new_with_titles() to quit compiler warnings.
(check_dir): the no_stat_dirs struct must not be const, since we do
indeed modify its contents.
* gtk/testgtk.c (event_watcher): adapted prototype to fit new emission
hook semantics.
* gtk/gtksignal.h:
* gtk/gtksignal.c:
changed emission allocation, so we don't use a doubly linked list
but link ourselfs (singly linked).
changed emission hooks, they get the emision parameters passed as
well now and are emitted during the actuall signal emission (after
the RUN_FIRST class method, but prior to RUN_FIRST handlers).
the existing restrictions do still apply to signal emission hooks,
i.e. an emission may not be stopped or restarted from an emission hook.
due to possibly huge perfomance impacts, frequent use of emision hooks
is also not recommended.
(gtk_signal_next_and_invalidate): added an
assertments which explicits what the code assumes anyways: a
maximum amount of 65535 signals.
* gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(),
gtk_container_foreach_full() should be used instead.
* gtk/gtkmain.h:
deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since
we provide _full variants.
* gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide
gtk_signal_connect_full() for long enough now.
1998-12-07 02:31:19 +00:00
|
|
|
filesel->file_list = gtk_clist_new_with_titles (1, (gchar**) file_title);
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_widget_set_usize (filesel->file_list, FILE_LIST_WIDTH, FILE_LIST_HEIGHT);
|
|
|
|
gtk_signal_connect (GTK_OBJECT (filesel->file_list), "select_row",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_file_button,
|
|
|
|
(gpointer) filesel);
|
1998-01-21 09:31:57 +00:00
|
|
|
gtk_clist_column_titles_passive (GTK_CLIST (filesel->file_list));
|
1998-11-05 15:44:22 +00:00
|
|
|
|
|
|
|
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
|
|
|
|
gtk_container_add (GTK_CONTAINER (scrolled_win), filesel->file_list);
|
|
|
|
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_win),
|
|
|
|
GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER (scrolled_win), 5);
|
1998-11-05 15:44:22 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (list_hbox), scrolled_win, TRUE, TRUE, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_show (filesel->file_list);
|
1998-11-05 15:44:22 +00:00
|
|
|
gtk_widget_show (scrolled_win);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-03-06 05:03:15 +00:00
|
|
|
/* action area for packing buttons into. */
|
|
|
|
filesel->action_area = gtk_hbox_new (TRUE, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (filesel->main_vbox), filesel->action_area,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (filesel->action_area);
|
|
|
|
|
|
|
|
/* The OK/Cancel button area */
|
1998-03-22 16:59:59 +00:00
|
|
|
confirm_area = gtk_hbutton_box_new ();
|
|
|
|
gtk_button_box_set_layout(GTK_BUTTON_BOX(confirm_area), GTK_BUTTONBOX_END);
|
|
|
|
gtk_button_box_set_spacing(GTK_BUTTON_BOX(confirm_area), 5);
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_box_pack_end (GTK_BOX (filesel->main_vbox), confirm_area, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (confirm_area);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
/* The OK button */
|
1998-12-14 17:39:58 +00:00
|
|
|
filesel->ok_button = gtk_button_new_with_label (_("OK"));
|
1997-11-24 22:37:52 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS (filesel->ok_button, GTK_CAN_DEFAULT);
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (confirm_area), filesel->ok_button, TRUE, TRUE, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_grab_default (filesel->ok_button);
|
|
|
|
gtk_widget_show (filesel->ok_button);
|
|
|
|
|
|
|
|
/* The Cancel button */
|
1998-12-14 17:39:58 +00:00
|
|
|
filesel->cancel_button = gtk_button_new_with_label (_("Cancel"));
|
1997-11-24 22:37:52 +00:00
|
|
|
GTK_WIDGET_SET_FLAGS (filesel->cancel_button, GTK_CAN_DEFAULT);
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (confirm_area), filesel->cancel_button, TRUE, TRUE, 0);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_widget_show (filesel->cancel_button);
|
|
|
|
|
|
|
|
/* The selection entry widget */
|
|
|
|
entry_vbox = gtk_vbox_new (FALSE, 2);
|
|
|
|
gtk_box_pack_end (GTK_BOX (filesel->main_vbox), entry_vbox, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (entry_vbox);
|
|
|
|
|
|
|
|
filesel->selection_text = label = gtk_label_new ("");
|
|
|
|
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
|
|
|
|
gtk_box_pack_start (GTK_BOX (entry_vbox), label, FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show (label);
|
|
|
|
|
|
|
|
filesel->selection_entry = gtk_entry_new ();
|
|
|
|
gtk_signal_connect (GTK_OBJECT (filesel->selection_entry), "key_press_event",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_key_press, filesel);
|
|
|
|
gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "focus_in_event",
|
|
|
|
(GtkSignalFunc) gtk_widget_grab_default,
|
|
|
|
GTK_OBJECT (filesel->ok_button));
|
|
|
|
gtk_signal_connect_object (GTK_OBJECT (filesel->selection_entry), "activate",
|
|
|
|
(GtkSignalFunc) gtk_button_clicked,
|
|
|
|
GTK_OBJECT (filesel->ok_button));
|
|
|
|
gtk_box_pack_start (GTK_BOX (entry_vbox), filesel->selection_entry, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (filesel->selection_entry);
|
|
|
|
|
|
|
|
if (!cmpl_state_okay (filesel->cmpl_state))
|
|
|
|
{
|
|
|
|
gchar err_buf[256];
|
|
|
|
|
1998-12-14 17:39:58 +00:00
|
|
|
sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-12-15 20:31:26 +00:00
|
|
|
gtk_label_set_text (GTK_LABEL (filesel->selection_text), err_buf);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gtk_file_selection_populate (filesel, "", FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_widget_grab_focus (filesel->selection_entry);
|
|
|
|
}
|
|
|
|
|
|
|
|
GtkWidget*
|
|
|
|
gtk_file_selection_new (const gchar *title)
|
|
|
|
{
|
|
|
|
GtkFileSelection *filesel;
|
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
filesel = gtk_type_new (GTK_TYPE_FILE_SELECTION);
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_window_set_title (GTK_WINDOW (filesel), title);
|
|
|
|
|
|
|
|
return GTK_WIDGET (filesel);
|
|
|
|
}
|
|
|
|
|
1998-03-06 05:03:15 +00:00
|
|
|
void
|
|
|
|
gtk_file_selection_show_fileop_buttons (GtkFileSelection *filesel)
|
|
|
|
{
|
|
|
|
g_return_if_fail (filesel != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (filesel));
|
|
|
|
|
|
|
|
/* delete, create directory, and rename */
|
|
|
|
if (!filesel->fileop_c_dir)
|
|
|
|
{
|
1998-12-14 17:39:58 +00:00
|
|
|
filesel->fileop_c_dir = gtk_button_new_with_label (_("Create Dir"));
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (filesel->fileop_c_dir), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_create_dir,
|
|
|
|
(gpointer) filesel);
|
|
|
|
gtk_box_pack_start (GTK_BOX (filesel->button_area),
|
|
|
|
filesel->fileop_c_dir, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (filesel->fileop_c_dir);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!filesel->fileop_del_file)
|
|
|
|
{
|
1998-12-14 17:39:58 +00:00
|
|
|
filesel->fileop_del_file = gtk_button_new_with_label (_("Delete File"));
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (filesel->fileop_del_file), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_delete_file,
|
|
|
|
(gpointer) filesel);
|
|
|
|
gtk_box_pack_start (GTK_BOX (filesel->button_area),
|
|
|
|
filesel->fileop_del_file, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (filesel->fileop_del_file);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!filesel->fileop_ren_file)
|
|
|
|
{
|
1998-12-14 17:39:58 +00:00
|
|
|
filesel->fileop_ren_file = gtk_button_new_with_label (_("Rename File"));
|
1998-03-06 05:03:15 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (filesel->fileop_ren_file), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_rename_file,
|
|
|
|
(gpointer) filesel);
|
|
|
|
gtk_box_pack_start (GTK_BOX (filesel->button_area),
|
|
|
|
filesel->fileop_ren_file, TRUE, TRUE, 0);
|
|
|
|
gtk_widget_show (filesel->fileop_ren_file);
|
|
|
|
}
|
1998-03-22 16:59:59 +00:00
|
|
|
|
1998-03-23 06:36:09 +00:00
|
|
|
gtk_widget_queue_resize(GTK_WIDGET(filesel));
|
1998-03-06 05:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
gtk_file_selection_hide_fileop_buttons (GtkFileSelection *filesel)
|
|
|
|
{
|
|
|
|
g_return_if_fail (filesel != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (filesel));
|
|
|
|
|
|
|
|
if (filesel->fileop_ren_file)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (filesel->fileop_ren_file);
|
|
|
|
filesel->fileop_ren_file = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (filesel->fileop_del_file)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (filesel->fileop_del_file);
|
|
|
|
filesel->fileop_del_file = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (filesel->fileop_c_dir)
|
|
|
|
{
|
|
|
|
gtk_widget_destroy (filesel->fileop_c_dir);
|
|
|
|
filesel->fileop_c_dir = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
void
|
|
|
|
gtk_file_selection_set_filename (GtkFileSelection *filesel,
|
|
|
|
const gchar *filename)
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
gchar *buf;
|
1997-11-24 22:37:52 +00:00
|
|
|
const char *name, *last_slash;
|
|
|
|
|
|
|
|
g_return_if_fail (filesel != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (filesel));
|
|
|
|
g_return_if_fail (filename != NULL);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
last_slash = strrchr (filename, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (!last_slash)
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
buf = g_strdup ("");
|
1997-11-24 22:37:52 +00:00
|
|
|
name = filename;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
buf = g_strdup (filename);
|
|
|
|
buf[last_slash - filename + 1] = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
name = last_slash + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
gtk_file_selection_populate (filesel, buf, FALSE);
|
|
|
|
|
|
|
|
if (filesel->selection_entry)
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (filesel->selection_entry), name);
|
2000-02-03 01:19:03 +00:00
|
|
|
g_free (buf);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
gchar*
|
|
|
|
gtk_file_selection_get_filename (GtkFileSelection *filesel)
|
|
|
|
{
|
2000-02-03 01:42:51 +00:00
|
|
|
static gchar nothing[2] = "";
|
|
|
|
static gchar something[MAXPATHLEN*2];
|
1997-11-24 22:37:52 +00:00
|
|
|
char *filename;
|
2000-02-03 01:42:51 +00:00
|
|
|
char *text;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (filesel != NULL, nothing);
|
|
|
|
g_return_val_if_fail (GTK_IS_FILE_SELECTION (filesel), nothing);
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-13 01:14:19 +00:00
|
|
|
translate_win32_path(filesel);
|
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry));
|
|
|
|
if (text)
|
|
|
|
{
|
2000-02-03 01:42:51 +00:00
|
|
|
filename = g_filename_from_utf8 (cmpl_completion_fullname (text, filesel->cmpl_state));
|
|
|
|
strncpy (something, filename, sizeof (something));
|
|
|
|
g_free (filename);
|
|
|
|
return something;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return nothing;
|
|
|
|
}
|
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_file_selection_destroy (GtkObject *object)
|
|
|
|
{
|
|
|
|
GtkFileSelection *filesel;
|
1998-01-21 09:06:05 +00:00
|
|
|
GList *list;
|
|
|
|
HistoryCallbackArg *callback_arg;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_if_fail (object != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (object));
|
|
|
|
|
|
|
|
filesel = GTK_FILE_SELECTION (object);
|
1998-01-21 09:06:05 +00:00
|
|
|
|
|
|
|
if (filesel->fileop_dialog)
|
|
|
|
gtk_widget_destroy (filesel->fileop_dialog);
|
|
|
|
|
1998-02-02 18:44:28 +00:00
|
|
|
if (filesel->history_list)
|
|
|
|
{
|
|
|
|
list = filesel->history_list;
|
|
|
|
while (list)
|
|
|
|
{
|
|
|
|
callback_arg = list->data;
|
|
|
|
g_free (callback_arg->directory);
|
1998-03-24 05:27:00 +00:00
|
|
|
g_free (callback_arg);
|
1998-02-02 18:44:28 +00:00
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
g_list_free (filesel->history_list);
|
|
|
|
filesel->history_list = NULL;
|
1998-01-21 09:06:05 +00:00
|
|
|
}
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
cmpl_free_state (filesel->cmpl_state);
|
1998-02-02 18:44:28 +00:00
|
|
|
filesel->cmpl_state = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (GTK_OBJECT_CLASS (parent_class)->destroy)
|
|
|
|
(* GTK_OBJECT_CLASS (parent_class)->destroy) (object);
|
|
|
|
}
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
/* Begin file operations callbacks */
|
|
|
|
|
|
|
|
static void
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
gtk_file_selection_fileop_error (GtkFileSelection *fs, gchar *error_message)
|
1998-01-21 07:53:07 +00:00
|
|
|
{
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *dialog;
|
|
|
|
|
|
|
|
g_return_if_fail (error_message != NULL);
|
|
|
|
|
|
|
|
/* main dialog */
|
|
|
|
dialog = gtk_dialog_new ();
|
|
|
|
/*
|
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_fileop_destroy,
|
|
|
|
(gpointer) fs);
|
|
|
|
*/
|
1998-12-14 17:39:58 +00:00
|
|
|
gtk_window_set_title (GTK_WINDOW (dialog), _("Error"));
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
/* If file dialog is grabbed, make this dialog modal too */
|
|
|
|
/* When error dialog is closed, file dialog will be grabbed again */
|
|
|
|
if (GTK_WINDOW(fs)->modal)
|
|
|
|
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
vbox = gtk_vbox_new(FALSE, 0);
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(vbox);
|
|
|
|
|
|
|
|
label = gtk_label_new(error_message);
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
|
|
|
|
gtk_widget_show(label);
|
|
|
|
|
|
|
|
/* yes, we free it */
|
|
|
|
g_free (error_message);
|
|
|
|
|
|
|
|
/* close button */
|
1998-12-14 17:39:58 +00:00
|
|
|
button = gtk_button_new_with_label (_("Close"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_widget_destroy,
|
|
|
|
(gpointer) dialog);
|
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
|
|
|
|
button, TRUE, TRUE, 0);
|
|
|
|
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_grab_default(button);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_fileop_destroy (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
fs->fileop_dialog = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_create_dir_confirmed (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
gchar *dirname;
|
|
|
|
gchar *path;
|
|
|
|
gchar *full_path;
|
|
|
|
gchar *buf;
|
|
|
|
CompletionState *cmpl_state;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
dirname = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry));
|
|
|
|
cmpl_state = (CompletionState*) fs->cmpl_state;
|
|
|
|
path = cmpl_reference_position (cmpl_state);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, dirname, NULL);
|
1998-01-21 07:53:07 +00:00
|
|
|
if ( (mkdir (full_path, 0755) < 0) )
|
|
|
|
{
|
|
|
|
buf = g_strconcat ("Error creating directory \"", dirname, "\": ",
|
|
|
|
g_strerror(errno), NULL);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
gtk_file_selection_fileop_error (fs, buf);
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
g_free (full_path);
|
|
|
|
|
|
|
|
gtk_widget_destroy (fs->fileop_dialog);
|
|
|
|
gtk_file_selection_populate (fs, "", FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_create_dir (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
if (fs->fileop_dialog)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* main dialog */
|
|
|
|
fs->fileop_dialog = dialog = gtk_dialog_new ();
|
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_fileop_destroy,
|
|
|
|
(gpointer) fs);
|
1998-12-14 17:39:58 +00:00
|
|
|
gtk_window_set_title (GTK_WINDOW (dialog), _("Create Directory"));
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
|
|
/* If file dialog is grabbed, grab option dialog */
|
|
|
|
/* When option dialog is closed, file dialog will be grabbed again */
|
|
|
|
if (GTK_WINDOW(fs)->modal)
|
|
|
|
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
vbox = gtk_vbox_new(FALSE, 0);
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(vbox);
|
|
|
|
|
1998-12-14 17:39:58 +00:00
|
|
|
label = gtk_label_new(_("Directory name:"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
|
|
|
|
gtk_widget_show(label);
|
|
|
|
|
|
|
|
/* The directory entry widget */
|
|
|
|
fs->fileop_entry = gtk_entry_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
|
|
|
|
TRUE, TRUE, 5);
|
|
|
|
GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_show (fs->fileop_entry);
|
|
|
|
|
|
|
|
/* buttons */
|
1998-12-14 17:39:58 +00:00
|
|
|
button = gtk_button_new_with_label (_("Create"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_create_dir_confirmed,
|
|
|
|
(gpointer) fs);
|
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
|
|
|
|
button, TRUE, TRUE, 0);
|
|
|
|
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_show(button);
|
|
|
|
|
1998-12-14 17:39:58 +00:00
|
|
|
button = gtk_button_new_with_label (_("Cancel"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_widget_destroy,
|
|
|
|
(gpointer) dialog);
|
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
|
|
|
|
button, TRUE, TRUE, 0);
|
|
|
|
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_grab_default(button);
|
|
|
|
gtk_widget_show (button);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_delete_file_confirmed (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
CompletionState *cmpl_state;
|
|
|
|
gchar *path;
|
|
|
|
gchar *full_path;
|
|
|
|
gchar *buf;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
cmpl_state = (CompletionState*) fs->cmpl_state;
|
|
|
|
path = cmpl_reference_position (cmpl_state);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
|
1998-01-21 07:53:07 +00:00
|
|
|
if ( (unlink (full_path) < 0) )
|
|
|
|
{
|
|
|
|
buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ",
|
|
|
|
g_strerror(errno), NULL);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
gtk_file_selection_fileop_error (fs, buf);
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
g_free (full_path);
|
|
|
|
|
|
|
|
gtk_widget_destroy (fs->fileop_dialog);
|
|
|
|
gtk_file_selection_populate (fs, "", FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_delete_file (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *dialog;
|
|
|
|
gchar *filename;
|
|
|
|
gchar *buf;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
if (fs->fileop_dialog)
|
|
|
|
return;
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-13 01:14:19 +00:00
|
|
|
translate_win32_path(fs);
|
|
|
|
#endif
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
filename = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
|
|
|
|
if (strlen(filename) < 1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
fs->fileop_file = filename;
|
|
|
|
|
|
|
|
/* main dialog */
|
|
|
|
fs->fileop_dialog = dialog = gtk_dialog_new ();
|
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_fileop_destroy,
|
|
|
|
(gpointer) fs);
|
1998-12-14 17:39:58 +00:00
|
|
|
gtk_window_set_title (GTK_WINDOW (dialog), _("Delete File"));
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
|
|
/* If file dialog is grabbed, grab option dialog */
|
|
|
|
/* When option dialog is closed, file dialog will be grabbed again */
|
|
|
|
if (GTK_WINDOW(fs)->modal)
|
|
|
|
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
|
|
|
vbox = gtk_vbox_new(FALSE, 0);
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_container_set_border_width(GTK_CONTAINER(vbox), 8);
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(vbox);
|
|
|
|
|
|
|
|
buf = g_strconcat ("Really delete file \"", filename, "\" ?", NULL);
|
|
|
|
label = gtk_label_new(buf);
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
|
|
|
|
gtk_widget_show(label);
|
|
|
|
g_free(buf);
|
|
|
|
|
|
|
|
/* buttons */
|
1998-12-14 17:39:58 +00:00
|
|
|
button = gtk_button_new_with_label (_("Delete"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_delete_file_confirmed,
|
|
|
|
(gpointer) fs);
|
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
|
|
|
|
button, TRUE, TRUE, 0);
|
|
|
|
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_show(button);
|
|
|
|
|
1998-12-14 17:39:58 +00:00
|
|
|
button = gtk_button_new_with_label (_("Cancel"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_widget_destroy,
|
|
|
|
(gpointer) dialog);
|
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
|
|
|
|
button, TRUE, TRUE, 0);
|
|
|
|
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_grab_default(button);
|
|
|
|
gtk_widget_show (button);
|
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_rename_file_confirmed (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
gchar *buf;
|
|
|
|
gchar *file;
|
|
|
|
gchar *path;
|
|
|
|
gchar *new_filename;
|
|
|
|
gchar *old_filename;
|
|
|
|
CompletionState *cmpl_state;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
file = gtk_entry_get_text (GTK_ENTRY (fs->fileop_entry));
|
|
|
|
cmpl_state = (CompletionState*) fs->cmpl_state;
|
|
|
|
path = cmpl_reference_position (cmpl_state);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
new_filename = g_strconcat (path, G_DIR_SEPARATOR_S, file, NULL);
|
|
|
|
old_filename = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
|
|
|
if ( (rename (old_filename, new_filename)) < 0)
|
|
|
|
{
|
|
|
|
buf = g_strconcat ("Error renaming file \"", file, "\": ",
|
|
|
|
g_strerror(errno), NULL);
|
Adapt cast macros to standard.
Fri Nov 19 10:34:41 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkgamma.h: Adapt cast macros to standard.
[ Merges from 1.2 ]
Tue Nov 16 10:15:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_path):
If translation does not include a '/', use entire
translation instead of crashing.
Sun Oct 31 22:21:11 1999 Tim Janik <timj@gtk.org>
* docs/gtk_tut.sgml:
s/gtk_accel_group_attach/gtk_window_add_accel_group/.
Sat Oct 30 09:09:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c (gtk_target_list_remove): Use
g_list_remove_link, not g_list_remove.
[ From Geert Bevin <gbevin@thunderstorms.org> ]
Sun Oct 24 07:41:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkclist.c (real_undo_selection): commented out g_print()
statement upon unselection (how the heck did that slip in?).
Sat Oct 23 03:03:08 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_freeze):
(gtk_text_thaw): undraw/draw cursor here to avoid unnecessary scrolling
in frozen state (and aparently crashes). patch provided by Anders
Melchiorsen <and@kampsax.dtu.dk>.
Sat Oct 23 02:53:20 1999 Tim Janik <timj@gtk.org>
* fix insensitive default/focus widget activation,
reported by Matt Goodall <mgg@isotek.co.uk>.
* gtk/gtkwindow.c (gtk_window_key_press_event):
(gtk_window_activate_default):
(gtk_window_activate_focus):
return handled=FALSE for actiavtion of insensitive default
widgets. return handled=TRUE for activation of insensitive
focus widgets. don't activate in either case.
Tue Oct 19 09:55:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk-config.in (lib_gtk): Switch order of @x_cflags@
and $glib_cflags to match library order and in the
theory that an old version of GLib is more likely to
be in the include directory for X then vice-versa.
(Bug #2776)
Tue Oct 19 09:46:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always use LC_CTYPE
to determine the locale for fontsets, not LC_MESSAGES;
the user may want English messages with a handling
for non-English languages. (LC_CTYPE=ru_RU LC_MESSAGES=fr_FR
will still be broken) (Bug #2891)
Tue Oct 19 20:36:42 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Fixed the wrong number of "*"'s.
Tue Oct 19 12:15:13 1999 Changwoo Ryu <cwryu@adam.kaist.ac.kr>
* gtk/gtkrc.ko: Changed the Korean default fontset.
Fri Oct 8 02:32:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtklayout.c (gtk_layout_adjustment_changed): Fix bug
where when scrolling to the left or top double exposes
were done, causing major slowdowns.
Thu Oct 7 18:31:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Always normalize codeset
names to lowercase and alphanumeric, before looking
them up.
* gtk/Makefile.am: Install codeset variant gtkrc files
with normalized names.
Thu Oct 7 22:52:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_popup_with_data): even
popup menus when the menu is already visible, but its parent
is still hidden, (happens after tornoff window got hidden).
Thu Oct 7 11:09:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (install-data-local): Fix
a typo where gtkrc.vi_VN.tcvn5712 wasn't getting
deleted, causing error messages on install.
Thu Oct 7 11:03:06 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtk[hv]paned.c (gtk_{h,v}paned_draw): Redraw
the handle as well, since we now sometimes ignore
exposes on the handle while resizing.
Wed Oct 6 18:02:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_append_default_pixmap_path): Fix stupid
extra g_free introduced in one of the last one or two
commits.
Wed Oct 6 16:38:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc*: Make naming of gtkrc files
consistent, put each style that a gtkrc.* file creates
in a unique namespace, remove old files before installing.
Wed Oct 6 14:31:16 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_init): Avoid leaking memory when
gtk_rc_init is called multiple times. (Yes, people who
do that have bugs in their code.)
Tue Oct 5 11:36:57 PDT 1999 Manish Singh <yosh@gimp.org>
* gtk/Makefile.am: listing gtkrc in gtkconf_DATA seems to barf.
Remove it since it's generated by the Makefile anyway
Tue Oct 5 02:43:41 1999 Owen Taylor <otaylor@redhat.com>
* gdk/gdkinputcommon.h (gdk_input_device_new): Free
device->info.axes for core pointer.
Thu Sep 30 13:55:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (destroy_idle_test): Rename idle to
idle_id, to deal with obsolete, broken C libraries.
Mon Sep 27 02:50:15 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkvscale.c (gtk_vscale_draw): Don't add in
allocation->x/y twice!
* gtk/gtkhscale.c: Make usage of gtk_hscale_pos_trough()
consistent with gtk_vscale_pos_trough().
Sun Sep 26 19:44:34 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcontainer.c (gtk_container_queue_resize): We may
be queueing a resize on a toplevel container between
the time we show it and when we map it. So, we need
to test GTK_WIDGET_VISIBLE() for toplevels, and only
use GTK_WIDGET_DRAWABLE() for child windows.
Thu Sep 23 16:41:03 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am (LDADDS): Add GDK_WLIBS to LDADDS
(fixes bug #2144)
Fri Sep 24 00:51:45 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c (gtk_container_queue_resize): check for
container DRAWABLE (instead of VISIBLE), so we don't queue
resizes on non-toplevel containers.
Sun Sep 19 18:13:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.[ch]: Make the data argument
const guchar *.
Sat Sep 18 21:27:40 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c: Try to behave sensibly if
the focus widget is the window itself. (Should
we allow this at all?)
Fri Sep 17 09:57:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_set_sensitive):
* gtk/gtknotebook.c (gtk_notebook_set_scrollable):
* gtk/gtknotebook.c (gtk_notebook_set_show_border):
* gtk/gtkclist.c (gtk_notebook_set_show_border): make gboolean args
in prototypes and implementations consistent (Tomas Ogren).
* gtk/gtklayout.c (gtk_layout_remove): unset GTK_IS_OFFSCREEN flag
before the widget is unparented (reported by damon).
* gtk/gtkdnd.c: make the cursor and icon data _unsigned_ char,
since we provide unsigned data anyways.
Thu Sep 16 21:32:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktooltips.c (gtk_tooltips_set_tip): Delay
the call to gtk_tooltips_layout_text() until later.
* gtk/gtktooltips.c (gtk_tooltips_draw_tips):
Call gtk_widget_ensure_style() before using the style.
Wed Sep 15 02:52:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_event): Added workaround
for old widgets that don't propagate draws to all
children. (Namely gnome-dock for gnome-libs <= 1.0.16)
Tue Sep 14 19:22:19 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_queue_resize): don't queue the parent
for a redraw but just the widget that requested the resize.
Tue Sep 14 18:29:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkcontainer.c: added new widget level method
gtk_container_set_reallocate_redraws() and a GtkContainer flag
reallocate_redraws : 1 to reflect the setting, exported this through
the argument system as a boolean ::reallocate_redraws.
* gtk/gtkwidget.c (gtk_widget_size_allocate): when queueing redraws
on the widget because the allocation changes, do so as well for
widget->parent if the parent has reallocate_redraws set to TRUE.
with that containers requesting reallocation redraws get automatically
redrawn if their children changed allocation (this unfortunately
affects also other children that didn't change allocation, but we
cannot work around that before 1.3).
Tue Sep 14 18:23:01 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_idle_draw): only emit ::draw if width
_and_ height are >0 (not _or_).
* gtk/gtktable.c (gtk_table_remove): use gtk_widget_queue_resize()
instead of gtk_container_queue_resize(), which is a core gtk internal
function (must have been on crack when i queued that).
* gtk/gtkprivate.h: added new private flag GTK_FULLDRAW_PENDING, so
we can check more reliably if we want to discard expose events.
* gtk/gtkwidget.c: added setting/unsetting of the GTK_FULLDRAW_PENDING
flag.
* gtk/gtkwidget.c (gtk_widget_event): don't discard synthesized exposes,
we simply trust these events. for deciding whether to discard exposes,
check GTK_FULLDRAW_PENDING instead of RESIZE_PENDING.
Mon Sep 13 15:01:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_queue_clear_area): Ignore
queues of areas that are completely off screen.
* gtk/gtkwidget.c (gtk_widget_idle_draw): Fix broken
logic for handleboxes.
* gtk/gtkwidget.c (gtk_widget_queue_draw_data): Add santity
check on width/height.
Mon Sep 13 02:22:47 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: backed out Raja's recent VPATH build "improvements",
we are fine with using $@ the way we do (if we actually encounter
brokeness with $@ in VPATH builds because of additional path prefixes,
we need to use $(@F) actually).
Mon Sep 13 01:34:53 1999 Tim Janik <timj@gtk.org>
* gtk/gtksignal.c: renamed two variables, hopefully didn't introduce
short lived bugs, that would allow language bindings to do surgeries
to our guts.
Fri Sep 10 15:22:50 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_size_allocate): Fix typo
where comparison was being done against an uninitialized
value causing intermittant results depending on
compiler flags. Also make it clearer that we aren't
ever initializing the child as 0x0 (though this will
be caught in gtk_widget_size_allocate())
Fri Sep 10 10:06:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_transient_for): Move
gtk_window_unset_transient_for() call after we do checks
involving the old transient parent.
[ From Lance Capser <lmc@cyberhighway.net> ]
1999-09-07 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gtk.defs): Go back to using `touch' to create
an empty file.
Mon Sep 6 00:11:56 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (gtk_ctree_is_ancestor): return FALSE if node has
no children. (Reported by: Chris Rogers <gandalf@pobox.com>)
1999-09-03 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (gen_sources): Improve VPATH builds.
`$@' is valid only in the build dir, not after we've done
`cd $srcdir'. Also use `test -f' instead of less portable
`test -e'.
Fri Sep 3 15:59:56 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (correct_cache_insert): Rewrite
for simplicity, and hopefully correctness.
(Fixes bug #1322, which was a segfault when
on some insertions with the properties around
the insertion set up just wrong.)
* gtk/gtktext.c (gtk_text_adjustment): When we receive
a "changed" signal, clamp the new value to the adjustment
bounds to avoid segfaulting if someone tries to change
the adjustment to a bogus value. (Bug #1795)
Thu Sep 2 16:33:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c: Ignore unexpected destroy notifies
for children, for toplevel windows handle them
like delete_event.
* gtk/gtkplug.c: Add an unrealize handler so that
we unref plug->socket_window when we are done
with it.
Fri Sep 3 14:52:54 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c (clear_area): Fix stupid signedness
problem that was causing background to sometimes
be misaligned.
Fri Sep 3 12:26:33 1999 Owen Taylor <otaylor@redhat.com>
[ Fixes pointed out by Ettore Perazzoli <ettore@comm2000.it> ]
* gtk/gtkmenu.c (gtk_menu_position): Make
sure we never position menus with negative x, y,
since gtk_widget_set_uposition() can't handle that.
* gtk/gtkmenuitem.c (gtk_menu_item_position_menu):
Modify the positioning code a bit so that we always
put the top-left corner onscreen. (This is for
UI reasons, gtk_menu_position() now takes care of
gtk_widet_set_uposition() brokeness.)
Fri Sep 3 03:06:30 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am: fixed up things for -jx, x > 1.
Sun Sep 5 08:48:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_modify_style): Ref the
RC style that is passed in. The lack of the ref
before was a bug. If people worked around this
bug, this will introduce a slight memory leak
in their code. The code should typically look like:
rc_style = gtk_rc_style_new ();
[...]
gtk_widget_modify_style (widget, rc_style);
gtk_rc_style_unref (rc_style);
* gtk/gtkwidget.c (gtk_widget_modify_style): Reset
the style if it was already set.
* gtk/gtkwidget.c (gtk_widget_set_name): Only set the
style if it was set before.
Thu Sep 2 19:02:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (main): Add a check to see if we
are being run from the correct directory and
to quit nicely if we are not.
* gtk/gtkrc.c (gtk_rc_slist_remove_all): Make function
static.
Thu Sep 2 23:00:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkenums.h (GtkWindowPosition): added GTK_WIN_POS_CENTER_ALWAYS.
* gtk/gtkwindow.c:
queue resizes unconditionally (gtk_widget_queue_resize will figure
what to do if the window is not realized).
(gtk_window_move_resize): only recenter the window
for GTK_WIN_POS_CENTER_ALWAYS.
(gtk_window_compute_reposition): handle GTK_WIN_POS_CENTER_ALWAYS in
the same way as GTK_WIN_POS_CENTER.
Thu Sep 2 22:39:27 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_reposition): check for the last position
with (!(info->last_flags & GDK_HINT_POS)) instead of
(!info->last_flags & GDK_HINT_POS).
* gtk/gtkwindow.c (gtk_window_move_resize): constrain new_width and
new_height unconditionally, because we use these values even if
!default_size_changed && !hints_changed.
comented the (default_size_changed || hints_changed) case with
respect to resize rejects from the window manager.
* gtk/gtkwindow.c (gtk_window_move_resize): save info->last values
in the zvt condition hack, since this includes the window hints, set
the hints after the handling_resize case.
* gtk/gtkwindow.c (gtk_window_show): constrain the default size that a
window is initially shown with to the geometry.
Thu Sep 2 07:38:56 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize):
s/size_changed/default_size_changed/g so i know what's
really going on (frying brain on smaller flame now).
Thu Sep 2 05:47:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): queue a new resize if
we have size_changed upon handling_resize. this is a gross
workaround for the broken zvt widget and should be removed in
1.3 again (search for FIXME).
Owen provided an accurate comment for this:
/* We could be here for two reasons
* 1) We coincidentally got a resize while handling
* another resize.
* 2) Our computation of size_changed was completely
* screwed up, probably because one of our children
* is broken. It's probably a zvt widget.
*
* For 1), we could just go ahead and ask for the
* new size right now, but doing that for 2)
* might well be fighting the user (and can even
* trigger a loop). Since we really don't want to
* do that, we requeue a resize in hopes that
* by the time it gets handled, the child has seen
* the light and is willing to go along with the
* new size. (this happens for the zvt widget, since
* the size_allocate() above will have stored the
* requisition corresponding to the new size in the
* zvt widget)
*
* This doesn't buy us anything for 1), but it shouldn't
* hurt us too badly, since it is what would have
* happened if we had gotten the configure event before
* the new size had been set.
*/
Wed Sep 1 20:46:11 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c: deal properly with the fact that RC
style lists may include rc styles more than once.
* gtk/gtkrc.c (gtk_rc_append_pixmap_path): Removed
unused static function.
* gtk/gtkrc.c (gtk_rc_find_pixmap_in_path): Keep a
stack of directories of RC files currently being
parsed and implicitely add them to pixmap path.
This fixes a bug where the directory would get
appended then overwritten by pixmap_path declarations.
(bug #1462, from Peter Wainright <prw@wainpr.demon.co.uk>)
* gtk/gtkthemes.c (gtk_theme_engine_unref): Call
theme's exit function. (Patch from Peter Wainwright,
bug #1454)
* gtk/gtkradiomenuitem.c (gtk_radio_menu_item_destroy):
Add a destroy() handler to take care of removing
group for menu item. (Fixes bug #1197)
* gtk/gtkwidget.c (gtk_widget_size_request): Fixed thinko
in warning message.
Wed Sep 1 21:27:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_move_resize): don't require a server
roundtrip to figure window's width and height, since we know that
anyways from widget->allocation.
Wed Sep 1 12:37:44 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_move_resize): Compute
the hints after we request the new size.
Wed Sep 1 10:38:37 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_compute_hints): Removed
GTK_WIDGET_REALIZED() assertion - we can compute the
hints before we are realized.
* gtk/gtkwindow.c (gtk_window_move_resize): Reorder
hint changing so that we have a value of hints_changed
when we decide whether to constrain the window size.
* gtk/gtkwindow.c (gtk_window_move_resize): Spelling fix.
* gtk/gtkwindow.c (gtk_window_constrain_size): cleanups,
change back to G_MAXINT.
Wed Sep 1 06:54:59 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c (gtk_window_get_geometry_info): zero initialize
new GtkWindowGeometryInfo, so fields like GdkGeometry geometry
contain uncluttered values.
(gtk_window_compute_hints): simply assert that window is realized
and that geometry_info is valid, since we rely on this anyways.
(gtk_window_constrain_size): major cleanups to the code.
if (flags & GDK_HINT_BASE_SIZE) use geometry's base width and height
for the base size, instead of the minimums. use 32767 as max width
and height (like in gtkwindow.c) instead of G_MAXINT.
Wed Sep 1 04:41:25 1999 Tim Janik <timj@gtk.org>
* cleaned up the GtkContainer.need_resize flag handling mess, we
only need to force resize requests when we were prematurely
realized, or our widget tree was modified when we were temporarily
hidden. handling these cases directly upon showing the window (i.e.
while the GdkWindow is still unmapped) avoids the need to wait for
a configure event response and therefore makes the GUI more snappier
and avoids blank windows during the roundtrip.
* gtk/gtkwidget.c:
(gtk_widget_hide):
(gtk_widget_show): don't queue resizes on toplevels, they know how
to deal with matters.
* gtk/gtkcontainer.c (gtk_container_queue_resize): set the ->need_resize
flag directly for not visible resize containers and spare us unecessary
signal emissions.
* gtk/gtkwindow.c:
(gtk_window_realize): if we need to enforce premature size allocation,
queue a container resize so we are correctly resized later on.
(gtk_window_init):
(gtk_window_size_request):
don't freak around with the ->need_resize flag,
gtk_container_queue_resize() will care about that.
(gtk_window_show):
handle initial resizing issues here, we can handle matters better in
this place, especially since we know that our GdkWindow is still
unmapped.
(gtk_window_move_resize):
don't care about ->need_resize at all.
handle size changes properly that occoured while we waited for a
configure event.
Tue Aug 31 15:58:46 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwidget.c (gtk_widget_set_uposition):
* gtk/gtkwindow.[hc] (gtk_window_reposition):
Move the hint setting code from gtk_widget_set_uposition
to here; set the hints so that we respect any previously
set geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Don't
change the window hints here or move the window here,
let that happen in gtk_window_move_resize().
Tue Aug 31 06:58:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): when discarding exposes due
to already queued resizes (and therefore redraws) on a widget, check
its anchestry as well.
* gtk/gtkcontainer.c:
(gtk_container_queue_resize): clear resize widgets for resize
containers before aborting prematurely. this is especially important
for toplevels which may need imemdiate processing or their resize
handler to be queued.
(gtk_container_dequeue_resize_handler): added new internal function for
gtkwindow.c.
* gtk/gtkwindow.c (gtk_window_move_resize): if we are resizing due to a
configure event, take possible changes in window position into account
as well.
if we request a new window size, queue up a resize handler that will
last until the configure event response arrives.
combined the ->need_resize case (initial show) with the general size
(hints) changed case and added even more comments.
if !auto_shrink, only revert to the old allocation if the new size
is smaller than the current allocation.
Tue Aug 31 11:55:20 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c (gtk_window_set_arg, gtk_window_set_policy,
gtk_window_set_geometry_hints
gtk_window_set_default_size):
When hints are set, queue a resize so that the hints will
be eventually reset on the toplevel.
* gtk/gtkwindow.c (gtk_window_show): Use
gtk_window_compute_default_size(). Clear the need_resize flag
on the initail map so that we don't unnecessarily trigger the
resize code.
* gtk/gtkwindow.c (gtk_window_move_resize): Split apart
into separate functions. Compare the hints we are setting
with what we set last time so that we can accurately
tell when we need to reset the hints.
* gtk/gtkwindow.c (gtk_window_compute_default_size): New
function to figure out the size from requisition
and default_size.
* gtk/gtkwindow.c (gtk_window_constrain_size): Function
from fvwm to constrain a size to the geometry hints.
* gtk/gtkwindow.c (gtk_window_compare_hints): New function
to compare two sets of geometry hints.
* gtk/gtkwindow.c (gtk_window_compute_hints): Renamed
from gtk_window_set_hints(), just compute the hints,
don't set them.
* gtk/gtkwindow.c (gtk_window_compute_reposition): Move
code from gtk_window_move_resize() to separate function,
rationalize a bit.
Tue Aug 31 13:05:03 1999 Owen Taylor <otaylor@redhat.com>
* gtkrc.h: Move the ref_count member out of the GtkRcStyle
structure into a new private structure.
* gtkrc.c: Split GtkRcStyle into public/private.
In the private part, add a list of pointers to the
RcStyle lists this RcStyle participates in.
* gtkrc.c: When a RcStyle is free, remove all
lists referencing it from the
realized_style_ht hash, and free those lists.
* gtk/gtkrc.c (gtk_rc_clear_styles): Don't call
gtk_rc_init(), since that adds the default styles
to the list of parsed RC files again.
* gtk/gtkrc.c: Use gtk_rc_style_find() consistently.
Thu Aug 26 14:14:42 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): reactivated the sanity
checks that ensure that a widget's allocation is at least 1 in width
and height. (GNOME note: this doesn't affect old panel code anymore,
because GtkSocket will request width and height of at least 1 since
Fri Jul 23).
* gtk/gtkwindow.c (gtk_window_realize): if the widget hasn't been
allocated yet (happens if the user realizes the window prematurely),
size request and allocate it.
(gtk_window_size_allocate): guard against guint underflows.
Wed Aug 25 19:01:36 1999 Lars Hamann <lars@gtk.org>
* gtk/Makefile.am (gtk_built_sources): reordered stamp-gtk.defs
in gtk_built_sources, so gtk.defs gets built prior to all other
sources.
Mon Aug 23 19:11:17 1999 Tim Janik <timj@gtk.org>
* gtk/Makefile.am:
invoke indent on gtkmarshal.*.
rewrote source generation rules, use COPYING as oldest source tag for
a piggyback rule to generate all sources from (don't touch it ;).
major cleanups, strip spaces on build rules for GNU Make.
* gtk/genmarshal.pl: don't operate on hardcoded filenames but take
source and target files from commandline arguments. don't invoke indent.
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Sat Aug 21 14:07:36 1999 Lars Hamann <lars@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_real_switch_page): queue_resize
notebook after switch to avoid drawing problems.
(Bug#856 Reported by: Theodore Roth <troth@netmagic.net>)
(gtk_notebook_pages_allocate): don't map not visible tab_labels,
show them instead.
(Bug#1805 Reported by: Dave Cole <dave@dccs.com.au>)
Wed Aug 18 09:20:10 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c:
we use window->need_resize from configure_event now, to indicate that
the gtkwindow should keep its allocation (e.g. because the user resized
the window through window manager handles). resize_count is now reliably
used to figure whether we got the allocation we requested from the
window manager.
configure events get queued as resizes now, the real stuff (size
computation and allocation) now only goes on in gtk_window_move_resize().
GtkWindow's requisition now contains its *real* requisition (like all
other widgets), *not* taking usize into account.
geometry_info->last_{width|height} is now updated from set_hints() only
so it always contains the last hints we set for the window manager.
made some event handlers return TRUE instead of FALSE.
the overall code should be much more straight forward now, and the
significant code portions are accompanied by comments now.
(gtk_window_set_hints):
removed requisition argument and made it
fetch the requisition through gtk_widget_get_child_requisition.
we also don't move the gdkwindow here anymore, gtk_window_move_resize()
does that now.
(gtk_window_show):
ensure that the widget is realized before calling
gtk_container_check_resize() (and thus gtk_window_move_resize()), also
ensure that we got properly size requested and allocated before
realization.
(gtk_window_configure_event):
ignore plain window moves, or reallocate the widget tree through the
resize queue otherwise.
(gtk_window_move_resize):
mostly rewrote this function to figure window manager hints more
reliably, coalesce window moves and resizes to reduce configure events
and do actuall size allocations.
Tue Aug 17 07:43:04 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_event): discard expose events for widgets
that have a resize pending, because a redraw is already queued for them.
* gtk/gtkcontainer.c: removed ugly connect_to ::size_allocate signal
hack to clear resize_widgets.
* gtk/gtkwidget.c (gtk_widget_size_allocate): call clear_resize_widgets
for resize containers prior to size allocation. (this is also a bit
ugly, but avoids side effects for stopped emissions and is thus more
reliable).
(gtk_widget_unparent): removed disconnect call for clear_resize_widgets.
* gtk/gtktooltips.c (gtk_tooltips_paint_window): renamed this
function from gtk_tooltips_expose, as we connect to ::expose_event
*and* ::draw now.
1999-08-18 Federico Mena Quintero <federico@redhat.com>
* gtk/gtkselection.c (gtk_target_list_ref): Added missing sanity
checks.
(gtk_target_list_unref): Likewise.
* gtk/gtkthemes.c (gtk_theme_engine_unref): Likewise.
Tue Aug 17 15:47:07 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c (gtk_color_selection_draw_value_bar):
guard against division by zero. (Fixes bug #1339)
Tue Aug 17 10:56:49 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_move_{forward,backward}_word):
Prevent the trivial leak of information of allowing
word motion when the entry is not visible.
Tue Aug 17 10:28:52 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (gtk_file_selection_fileop_error): Propagate
modality to error dialog as well as confirmation dialogs.
(Bug #1803, reported by Rosanna Wing Sze Yuen)
Wed Aug 11 01:04:57 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktreeitem.c (gtk_tree_item_draw_lines): Honor
tree->view_lines.
(gtk-guy-990611-3.patch: Guy Harris <guy@netapp.com>)
* gtk/Makefile.am (install-data-local): Solaris apparently
has various troubles with ln -f; use rm first instead.
(gtk-guy-990611-2.patch: Guy Harris <guy@netapp.com>)
1999-07-30 Raja R Harinath <harinath@cs.umn.edu>
* gtk/Makefile.am (stamp-m): Don't `mv' from builddir to srcdir,
use `cp' followed by `rm' (the `rm' was already there).
July 30, 1999 Elliot Lee <sopwith@redhat.com>
* configure.in: Fix autoconf warnings about cross compilation by
trying to provide sane defaults for AC_TRY_RUN.
* gtk/Makefile.am: If we refer to gtkmarshal.[ch] in $(srcdir),
put them into $(srcdir) when generated. Also add a dependency of
gtksignal.h on gtkmarshal.h for -j builds.
* gtk/gtk(dnd,style,gamma).c: Minor warning fixes.
Wed Jul 28 09:29:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration_do): Added missing
GDK_THREADS_{LEAVE,ENTER} pair.
(From Paul Fisher <pnfisher@redhat.com>)
Fri Jul 23 01:00:15 1999 Tim Janik <timj@gtk.org>
* gtk/gtksocket.c (gtk_socket_size_request): asure that the requested
width and height are always >0 (owen).
Fri Jul 23 00:00:47 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): backed out my recent
change that assured that a widget's allocated with and height are
always >1, since this breaks *buggy* panel code. unfortunately this
back-breaks the gimp's color selector.
* gtk/gtkdrawingarea.c (gtk_drawing_area_size_allocate): asure that our
allocation is always >0 in width and height, before sending the
configure event; this is a *gross* hack to get the gimp back to work.
* marked both cases with TODO-1.3
Wed Jul 21 15:47:39 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtktext.c: Don't display wrap indicators when
text is not editable and word wrap is on.
Wed Jul 21 08:21:40 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_create_item): special case
option menus here as they are not derived from menu shell, assure that
the option menu has a menu we can add items to.
Tue Jul 20 23:29:48 1999 Tim Janik <timj@gtk.org>
* gtk/gtknotebook.c (gtk_notebook_page_allocate): convert allocation->
width/height to (gint) before calculations and check against < 0 to
avoid guint wraparounds.
Sun Jul 18 00:35:49 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_size_allocate): ensure that the allocated
width and height is never zero. sanity check both dimensions against
32767 and issue a warning if the allocation is greater than that.
Wed Jul 7 15:03:30 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_events_pending): Unlock around call
to g_main_pending() as well.
Wed Jul 7 14:59:01 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main_iteration): Unlock around
call to g_main_iteration() - since that will regrab
GTK+ lock to process events.
Thu Jul 1 15:01:55 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkwindow.c
- Regularize with the rest of GTK+ by making widget->requisition
not reflect the set_usize()
- Always recompute geometry hints, then check if they
changed before sending them to the X server. The
previous checks for changes would fail in a number
of circumstances.
Thu Jul 1 11:55:59 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Include <stdlib.h> for strcmp().
Wed Jun 30 19:26:36 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c:
- Code cleanups
- Instantaneously update on modifier key presses
- Allow cancellation of the drag with Escape.
Tue Jun 29 17:04:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/testgtk.c (create_handle_box): Set the policy
to auto_shrink - otherwise the appearance is rather
strange when flipping between horizontal and vertical.
Mon Jun 28 09:29:52 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwindow.c: add ::default_width and ::default_height arguments.
(gtk_window_set_default_size): don't change a value if it's < 0.
queue a resize.
Sun Jun 27 11:00:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtktext.c (gtk_text_insert): don't segfault on NULL inserts.
Mon Jun 28 12:08:25 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkfilesel.c (cmpl_completion_fullname): Don't
add an extra "/" when concating "/" + filename.
(From Matt Grossman <mattg@oz.net>)
Mon Jun 28 10:57:12 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkctree.c (draw_cell_pixmap): Reset clip mask
for fg_gc if we set it for drawing pixmap.
Tue Jun 15 12:45:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes from Peter Wainwright <prw@wainpr.demon.co.uk>
* gtk/gtkrc.c (gtk_rc_parse_engine): If rc_style->engine is
already set, call old engine's destroy function and
unref the old engine.
Thu Jun 10 17:59:38 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.c (gtk_drawing_area_size): queue a resize.
Wed Jun 9 15:13:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkaccelgroup.h: mark certain functions as internal.
Wed Jun 9 13:48:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpreview.c (gtk_preview_set_expand): queue a resize if the
expand behaviour changed.
* gtk/gtklabel.c (gtk_label_set_pattern):
(gtk_label_set_justify):
(gtk_label_set_line_wrap):
don't bother invoking queue_clear, the reallocation does
that for us, always free_words so the upcoming resize will
relayout the label's contents.
Wed Jun 9 12:50:48 1999 Tim Janik <timj@gtk.org>
* applied argument implementation patches from Elena Devdariani
<elena@cogent.ca>.
* gtk/gtktoolbar.c: ::orientation, ::toolbar_style, ::space_size,
::space_style, ::relief
* gtk/gtkruler.c: ::lower, ::upper, ::position, ::max_size
* gtk/gtkpreview.c: ::expand
* gtk/gtkpaned.c: ::handle_size, ::gutter_size
* gtk/gtknotebook.c: ::homogeneous
* gtk/gtklabel.c: ::wrap
* gtk/gtklist.c: ::selection_mode
* gtk/gtkhandlebox.c: ::handle_position, ::snap_edge
* gtk/gtkcurve.c: ::curve_type, ::min_x, ::max_x, ::min_y, ::max_y
* gtk/gtkcolorsel.c: ::update_policy, ::use_opacity
* gtk/gtkclist.c: ::sort_type
* gtk/gtkcheckmenuitem.c: ::active, ::show_toggle
* gtk/gtkaspectframe.c: ::xalign, ::yalign, ::ratio, ::obey_child
Tue Jun 1 23:38:38 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c: Removed ill-thought-out part of last
comment.
Tue Jun 1 23:30:09 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkstyle.c (gtk_style_attach): Get the reference
counting right when we have to attach a new style
for a different visual. (Chi-Deok Hwang <cdhwang@sr.hei.co.kr>)
* gtk/gtkstyle.c: Documented the refcounting
peculularities of gtk_style_attach.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkwindow.c (gtk_window_new): added return if fail for invalid
window types.
* examples/packer/pack.c (main): use GTK_WINDOW_TOPLEVEL instead
of GTK_TOPLEVEL for creating the window.
1999-06-01 Tim Janik <timj@dhcpd7.redhat.com>
* gtk/gtkmain.c (gtk_init_check): don't segfault when --gtk-module is
the last argument (reported by Per Winkvist).
Tue May 25 13:13:12 1999 Owen Taylor <otaylor@redhat.com>
Fixes for invisible XOR lines (Frank Loemker
<floemker@TechFak.Uni-Bielefeld.DE>)
* gtk/gtkclist.c (gtk_clist_realize): Always use
a non-zero pixel for GDK_XOR.
* gtk/gtkvpaned.c gtk/gtkhpaned.c:
Use GDK_INVERT instead of GDK_XOR.
Wed May 12 21:56:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (adjust_adjustments): signal emit value_changed
signals if h/voffsets differ from adjustment values.
Reportet by Jerome Bolliet <bolliet@in2p3.fr>
Mon May 10 04:20:41 1999 Tim Janik <timj@gtk.org>
* gtk/gtkmenushell.c (gtk_menu_shell_activate_item): propagate
::selection-done emissions up to the topmost menu shell.
Fri May 7 10:15:14 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtknotebook.c (gtk_notebook_set_scrollable): Unset
the user data on the window before destroying it.
* gtk/gtknotebook.c (gtk_notebook_unrealize): Add an
unrealize handler to take care of destroying
notebook->panel properly.
(Bug #1198 - Morten Welinder <terra@diku.dk>)
* gtk/gtktext.c (expand_scratch_buffer): Fix reversal
of g_new and g_realloc to stop memory leak. (Actually,
we could just use g_realloc(), but I'm not 100% sure
that is portable).
(Bug #1196 - Morten Welinder <terra@diku.dk>)
Wed Apr 21 00:42:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkplug.h: Removed stray GtkPlugButton declaration.
* gdk/gdkfont.c (gdk_text_measure): Fix the return value
for fontsets.
* gtk/gtkbutton.c (gtkbutton_expose): Fix warning
with bin/button confusion.
Thu May 6 04:53:26 1999 Tim Janik <timj@gtk.org>
* gtk/testgtk.c: in the ItemFactory test, link radio items together,
and show how preselection of radio items is done.
Sun May 2 13:31:14 1999 Tim Janik <timj@gtk.org>
* gtk/gtktreeitem.c (gtk_tree_item_set_subtree):
* gtk/gtktree.c (gtk_tree_add) (gtk_tree_insert):
* gtk/gtktoolbar.c (gtk_toolbar_insert_element):
* gtk/gtkpaned.c (gtk_paned_pack2) (gtk_paned_pack1):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_add):
* gtk/gtktable.c (gtk_table_attach):
* gtk/gtklist.c (gtk_list_insert_items):
* gtk/gtkmenushell.c (gtk_menu_shell_insert):
* gtk/gtknotebook.c (gtk_notebook_insert_page_menu):
* gtk/gtkpacker.c (gtk_packer_add_defaults) (gtk_packer_add):
* gtk/gtkbin.c (gtk_bin_add):
* gtk/gtkbox.c (gtk_box_pack_start) (gtk_box_pack_end):
* gtk/gtkfixed.c (gtk_fixed_put):
* gtk/gtklayout.c (gtk_layout_put):
general fixups to container_add logic. always realize child if
child->parent is realized, only map the child and queue a resize
if child and child->parent are both visible.
Fri Apr 30 09:02:28 1999 Tim Janik <timj@gtk.org>
* gtk/gtkwidget.c (gtk_widget_real_unrealize): use gtk_container_forall
instead of gtk_container_foreach to walk and unrealize children, so
composite children get also unrealized.
(gtk_widget_real_show): don't call gtk_widget_map() if we don't need to.
(gtk_widget_map): assert that the widget is visible (basic constrain).
(gtk_widget_real_map): assert that the widget is realized (basic
constrain).
Fri Apr 29 00:53:20 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbindings.c (gtk_pattern_spec_init): plugged a memory leak.
Tue May 4 09:32:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am gtk/gtkrc.iso-8859-2: Add a gtkrc
file for iso-8859-2 locales.
* configure.in (ALL_LINGUAS): ALL_LINGUAS update.
Tue Apr 27 16:38:32 1999 Owen Taylor <otaylor@redhat.com>
* gtk/Makefile.am: Fix typo of static_sources for static_SOURCES.
(Pointed out by andy@rz.uni-karlsruhe.de and others).
Remove some suspicious and useless lines.
Tue May 4 08:44:08 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkclist.c (gtk_clist_draw, draw_rows): Use
width,height = 0, 0 to mean - here to edge of window,
instead of -1, -1, since the former is all we support.
Tue May 4 08:34:43 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkmain.c (gtk_main): Correctly free list nodes
when removing from quit_functions list.
Tue Apr 27 14:17:16 1999 Tim Janik <timj@gtk.org>
* gtk/gtkpacker.c (gtk_packer_size_request): remove unused variable.
Tue Apr 27 18:23:35 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkentry.c (gtk_entry_draw_cursor_on_drawable):
When redrawing characters on non-visible entry, use appropriate
'*' character. (Bug #1130 - Jean-Marc Jacquet <jm@littleigloo.org>)
Tue Apr 27 01:31:40 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (drag_dest_cell): compute destination cell
from drag coordinates.
(gtk_clist_drag_data_received) (gtk_clist_drag_motion):
use drag_dest_cell.
* gtk/gtktree (drag_dest_cell)
(gtk_ctree_drag_data_received) (gtk_ctree_drag_motion): likewise.
(Bug #1129)
Wed Apr 21 21:26:11 1999 Tim Janik <timj@gtk.org>
* gtk/gtkitemfactory.c (gtk_item_factory_init): properly initialize
translate_* fields.
(gtk_item_factory_finalize): invoke translate_notify independant from
translate_data.
(gtk_item_factory_set_translate_func): likewise.
(gtk_item_factory_destroy): only remove ifactory pointer from those
widgets that belong to us (stupid me).
Mon Apr 19 12:05:31 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkrc.c (gtk_rc_style_init): Fixed leak of
rc_style list when lookup succeeeds.
Thu Apr 15 01:11:24 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkctree.c (resync_selection):
* gtk/gtkclist.c (resync_selection): fixed undo_selection bug.
* gtk/gtkclist.c (gtk_clist_button_release): fixed resync_selection
bug.
Fri Apr 9 19:22:19 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkcolorsel.c gtk/gtkdnd.c gtk/gtkmenuitem.c:
Add some missing GDK_THREADS_ENTER()/LEAVE around
timeouts. (Patches from Sebastian Wilhelmi <wilhelmi@ira.uka.de>)
Thu Apr 8 20:10:33 1999 Tim Janik <timj@gtk.org>
* gtk/gtkentry.c (gtk_entry_key_press): use gtk_widget_activate()
rather than emit_by_name.
* gtk/gtkeditable.c (gtk_editable_insert_text): keep a reference
on the widget across multiple signal emissions.
(gtk_editable_delete_text): same here.
(gtk_editable_class_init): set widget_class->activate_signal after
editable_signals[ACTIVATE] has been created.
Wed Apr 7 22:59:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkpaned.c (gtk_paned_set_position): Don't clamp
position here prematurely -- we might not have the
right ->min_position and ->max_position yet.
Tue Apr 6 16:38:51 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkselection.c gdk/gdkselection.c: (gtk_selection_request):
Add error traps so if the other end of the connection
dies, we survive.
* gtk/gtkselection.c (gtk_selection_notify): Clean
up properly when selection property retrieval fails.
* gtk/gtkselection.c (gtk_selection_request): Correctly
reject SelectionRequest notifies where the handler
returns no data.
Tue Apr 6 12:24:21 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkdnd.c (gtk_drag_dest_leave): Only unhighlight
when we've previously highlighted.
* gtk/gtkdnd.c (gtk_drag_dest_handle_event): Don't
emit two "drag_leave" signals for Motif drops.
* gtk/gtkdnd.c (gtk_drag_source_handle_event): Send
back the correct status messages when dropping from
Motif onto a proxy window that is rejecting the
drop.
Sat Mar 27 23:32:13 1999 Tim Janik <timj@gtk.org>
* gtk/gtkarg.[hc]: added functions from GLE, gtk_arg_reset() to free
the value and reset type to GTK_TYPE_INVALID, and gtk_arg_values_equal()
to compare two argument values. added gtk_arg_to_valueloc() to set a
variable from an arg through its location (pointer).
* gtk/gtkobject.[hc]: implemented gtk_object_get() in terms of
gtk_object_arg_get() and gtk_arg_to_valueloc(), floats are collected
as gfloat*, uchars are collected as guchar*, ints are collected as
gint*, etc...
Mon Mar 29 17:45:47 1999 Owen Taylor <otaylor@redhat.com>
* gtk/gtkaccelgroup.c gtk/gtkgtkbindings.c:
Include <string.h> instead of <strings.h>.
* gtk/gtkstyle.c: Fix double include of gtkthemes.h
(actually, a lot more duplicate includes occur if
you trace through the sequence of #include's)
gtk-jbb-990320-0: John Bley, jbb6@acpub.duke.edu
Mon Mar 29 17:02:58 1999 Owen Taylor <otaylor@redhat.com>
Patches from Akira Higuchi <a-higuti@math.sci.hokudai.ac.jp>
gtk-a-higuti-990322-[0-3]
* configure.in: Fix confusion between GTK_LOCALE_[C]FLAGS
that was causing -DX_LOCALE not to work.
* gtk/gtkrc.c (gtk_rc_init):
X_LOCALE will never have LC_MESSAGES defined
Thu Mar 25 12:38:31 1999 Tim Janik <timj@gtk.org>
* gtk/gtkrc.c (gtk_rc_append_default_module_path): get $HOME from
g_get_home_dir() (gtk-pmc-990123-0.patch.gz).
* gtk/gtkwindow.c (gtk_window_key_press_event): feature keypad up/down/
left/right as well (gtk-michael-980726-0.patch.gz).
* gtk/gtklabel.[hc]: bunch of miscellaneous cleanups, such as s/0/NULL/
for pointer values, use gchar instead of char. fixed uline allocation
leaks, changed the allocation pattern so we use G_ALLOC_AND_FREE mem
chunks instead of G_ALLOC_ONLY.
(gtk_label_size_request): always alter requisition as passed and leave
widget->requisition alone.
(gtk_label_set_text): allow NULL strings.
(gtk_label_new): likewise.
Wed Mar 24 09:24:03 1999 Tim Janik <timj@gtk.org>
* gtk/gtkdrawingarea.[hc]: type/macro fixups.
Mon Mar 22 05:51:34 1999 Tim Janik <timj@gtk.org>
* gtk/gtkbin.c (gtk_bin_draw): only redraw children that are visible
*and* mapped (i.e. drawable).
(gtk_bin_expose): only send exposes to drawable children.
* gtk/gtkbox.c (gtk_box_draw): only redraw children that are drawable.
(gtk_box_expose): only send exposes to drawable children.
* gtk/gtkhscale.c (gtk_hscale_draw):
* gtk/gtkvscale.c (gtk_vscale_draw):
hm, this is an ugly one. we first compute the size of our trough area
here (window relative) and then check intersection with the draw_area
which is parent relative because we're a NO_WINDOW widget, so we need
to offset the trough area by allocation.x and allocation.y before the
check. (this must not be done for the background area though, since
that's already computed parent relative).
Mon Mar 22 00:41:39 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_unrealize): unmap clist if neccessary,
unrealize title buttons.
Fri Mar 19 00:00:22 1999 Lars Hamann <lars@gtk.org>
* gtk/gtkclist.c (gtk_clist_column_title_passive)
(gtk_clist_column_title_active):
only connect/disconnect to GtkWidgetClass::event to block mouse events.
* gtk/gtkclist.c (vertical_timeout) (horizontal_timeout):
zero initialize event, removed superfluous gdk_window_get_pointer call
* gtk/gtklist.c (gtk_list_vertical_timeout)
(gtk_list_horizontal_timeout): removed superfluous
gdk_window_get_pointer call
Wed Mar 17 09:00:00 1999 Tim Janik <timj@gtk.org>
* plugging problems reported by "Bruce Mitchener, Jr."
<bruce@puremagic.com> due to a purify session.
* gtk/gtkstyle.c:
(gtk_style_ref):
(gtk_style_unref): assert ref_count to be > 0.
* gtk/gtkclist.c (gtk_clist_set_cell_style): { 0 } initilaize
the requisition.
(gtk_clist_set_shift): likewise.
* gtk/gtklayout.c: introduce gtk_layout_finalize() to unref the
adjustments.
* gtk/gtklist.c (gtk_list_horizontal_timeout): zero initialize the
event before sending it and set send_event to TRUE (which needs to
be done for *all* synthesized events).
(gtk_list_vertical_timeout): likewise.
* gtk/gtktipsquery.c (gtk_tips_query_destroy): plug small memory
leaks.
* gtk/gtkdrawingarea.c (gtk_drawing_area_send_configure): set send_event
to TRUE when synthesizing events.
[ *** end of merges from 1.2 *** ]
1999-11-22 21:52:50 +00:00
|
|
|
gtk_file_selection_fileop_error (fs, buf);
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
g_free (new_filename);
|
|
|
|
g_free (old_filename);
|
|
|
|
|
|
|
|
gtk_widget_destroy (fs->fileop_dialog);
|
|
|
|
gtk_file_selection_populate (fs, "", FALSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_rename_file (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
GtkWidget *label;
|
|
|
|
GtkWidget *dialog;
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *button;
|
|
|
|
gchar *buf;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
if (fs->fileop_dialog)
|
|
|
|
return;
|
|
|
|
|
|
|
|
fs->fileop_file = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
|
|
|
|
if (strlen(fs->fileop_file) < 1)
|
|
|
|
return;
|
|
|
|
|
|
|
|
/* main dialog */
|
|
|
|
fs->fileop_dialog = dialog = gtk_dialog_new ();
|
|
|
|
gtk_signal_connect (GTK_OBJECT (dialog), "destroy",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_fileop_destroy,
|
|
|
|
(gpointer) fs);
|
1998-12-14 17:39:58 +00:00
|
|
|
gtk_window_set_title (GTK_WINDOW (dialog), _("Rename File"));
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
|
|
/* If file dialog is grabbed, grab option dialog */
|
|
|
|
/* When option dialog closed, file dialog will be grabbed again */
|
|
|
|
if (GTK_WINDOW(fs)->modal)
|
|
|
|
gtk_window_set_modal (GTK_WINDOW(dialog), TRUE);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
|
|
|
vbox = gtk_vbox_new(FALSE, 0);
|
1998-11-28 07:42:37 +00:00
|
|
|
gtk_container_set_border_width (GTK_CONTAINER(vbox), 8);
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), vbox,
|
|
|
|
FALSE, FALSE, 0);
|
|
|
|
gtk_widget_show(vbox);
|
|
|
|
|
|
|
|
buf = g_strconcat ("Rename file \"", fs->fileop_file, "\" to:", NULL);
|
|
|
|
label = gtk_label_new(buf);
|
|
|
|
gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.0);
|
|
|
|
gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 5);
|
|
|
|
gtk_widget_show(label);
|
|
|
|
g_free(buf);
|
|
|
|
|
|
|
|
/* New filename entry */
|
|
|
|
fs->fileop_entry = gtk_entry_new ();
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), fs->fileop_entry,
|
|
|
|
TRUE, TRUE, 5);
|
|
|
|
GTK_WIDGET_SET_FLAGS(fs->fileop_entry, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_show (fs->fileop_entry);
|
|
|
|
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->fileop_entry), fs->fileop_file);
|
1998-03-01 05:11:05 +00:00
|
|
|
gtk_editable_select_region (GTK_EDITABLE (fs->fileop_entry),
|
|
|
|
0, strlen (fs->fileop_file));
|
1998-01-21 07:53:07 +00:00
|
|
|
|
|
|
|
/* buttons */
|
1998-12-14 17:39:58 +00:00
|
|
|
button = gtk_button_new_with_label (_("Rename"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_signal_connect (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_rename_file_confirmed,
|
|
|
|
(gpointer) fs);
|
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
|
|
|
|
button, TRUE, TRUE, 0);
|
|
|
|
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_show(button);
|
|
|
|
|
1998-12-14 17:39:58 +00:00
|
|
|
button = gtk_button_new_with_label (_("Cancel"));
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_signal_connect_object (GTK_OBJECT (button), "clicked",
|
|
|
|
(GtkSignalFunc) gtk_widget_destroy,
|
|
|
|
(gpointer) dialog);
|
|
|
|
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area),
|
|
|
|
button, TRUE, TRUE, 0);
|
|
|
|
GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT);
|
|
|
|
gtk_widget_grab_default(button);
|
|
|
|
gtk_widget_show (button);
|
1998-08-11 19:06:18 +00:00
|
|
|
|
|
|
|
gtk_widget_show (dialog);
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static gint
|
|
|
|
gtk_file_selection_key_press (GtkWidget *widget,
|
|
|
|
GdkEventKey *event,
|
|
|
|
gpointer user_data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs;
|
|
|
|
char *text;
|
|
|
|
|
|
|
|
g_return_val_if_fail (widget != NULL, FALSE);
|
|
|
|
g_return_val_if_fail (event != NULL, FALSE);
|
|
|
|
|
|
|
|
if (event->keyval == GDK_Tab)
|
|
|
|
{
|
|
|
|
fs = GTK_FILE_SELECTION (user_data);
|
1999-10-06 19:47:24 +00:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-13 01:14:19 +00:00
|
|
|
translate_win32_path(fs);
|
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
text = gtk_entry_get_text (GTK_ENTRY (fs->selection_entry));
|
1998-05-16 07:22:00 +00:00
|
|
|
|
|
|
|
text = g_strdup (text);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
gtk_file_selection_populate (fs, text, TRUE);
|
|
|
|
|
1998-05-16 07:22:00 +00:00
|
|
|
g_free (text);
|
|
|
|
|
reverted marius change to expose the type systems internal type info data
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: reverted marius change to expose the type systems
internal type info data to the user. if such functionality is required
we should provide wrapped accessors, ala gtk_signal_query().
* gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change,
since it destroys the possibility to implement automatic marshaller
lookups some day, and it also disables third party code's ability to
connect to any signal. also the GtkTypeInfo structures are dynamically
allocated memory portions, so only the type system is really allowed
to access that stuff.
Mon Dec 7 01:32:18 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the
Tab key on the entry. the focus shouldn't get lost even if completion
is attempted from an empty entry, since an empty entry string does
indeed have a valid completion meaning (complete all).
(gtk_file_selection_init): cast the gchar array parameter in calls to
gtk_clist_new_with_titles() to quit compiler warnings.
(check_dir): the no_stat_dirs struct must not be const, since we do
indeed modify its contents.
* gtk/testgtk.c (event_watcher): adapted prototype to fit new emission
hook semantics.
* gtk/gtksignal.h:
* gtk/gtksignal.c:
changed emission allocation, so we don't use a doubly linked list
but link ourselfs (singly linked).
changed emission hooks, they get the emision parameters passed as
well now and are emitted during the actuall signal emission (after
the RUN_FIRST class method, but prior to RUN_FIRST handlers).
the existing restrictions do still apply to signal emission hooks,
i.e. an emission may not be stopped or restarted from an emission hook.
due to possibly huge perfomance impacts, frequent use of emision hooks
is also not recommended.
(gtk_signal_next_and_invalidate): added an
assertments which explicits what the code assumes anyways: a
maximum amount of 65535 signals.
* gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(),
gtk_container_foreach_full() should be used instead.
* gtk/gtkmain.h:
deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since
we provide _full variants.
* gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide
gtk_signal_connect_full() for long enough now.
1998-12-07 02:31:19 +00:00
|
|
|
gtk_signal_emit_stop_by_name (GTK_OBJECT (widget), "key_press_event");
|
1998-05-16 07:22:00 +00:00
|
|
|
|
reverted marius change to expose the type systems internal type info data
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: reverted marius change to expose the type systems
internal type info data to the user. if such functionality is required
we should provide wrapped accessors, ala gtk_signal_query().
* gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change,
since it destroys the possibility to implement automatic marshaller
lookups some day, and it also disables third party code's ability to
connect to any signal. also the GtkTypeInfo structures are dynamically
allocated memory portions, so only the type system is really allowed
to access that stuff.
Mon Dec 7 01:32:18 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the
Tab key on the entry. the focus shouldn't get lost even if completion
is attempted from an empty entry, since an empty entry string does
indeed have a valid completion meaning (complete all).
(gtk_file_selection_init): cast the gchar array parameter in calls to
gtk_clist_new_with_titles() to quit compiler warnings.
(check_dir): the no_stat_dirs struct must not be const, since we do
indeed modify its contents.
* gtk/testgtk.c (event_watcher): adapted prototype to fit new emission
hook semantics.
* gtk/gtksignal.h:
* gtk/gtksignal.c:
changed emission allocation, so we don't use a doubly linked list
but link ourselfs (singly linked).
changed emission hooks, they get the emision parameters passed as
well now and are emitted during the actuall signal emission (after
the RUN_FIRST class method, but prior to RUN_FIRST handlers).
the existing restrictions do still apply to signal emission hooks,
i.e. an emission may not be stopped or restarted from an emission hook.
due to possibly huge perfomance impacts, frequent use of emision hooks
is also not recommended.
(gtk_signal_next_and_invalidate): added an
assertments which explicits what the code assumes anyways: a
maximum amount of 65535 signals.
* gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(),
gtk_container_foreach_full() should be used instead.
* gtk/gtkmain.h:
deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since
we provide _full variants.
* gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide
gtk_signal_connect_full() for long enough now.
1998-12-07 02:31:19 +00:00
|
|
|
return TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
static void
|
|
|
|
gtk_file_selection_history_callback (GtkWidget *widget, gpointer data)
|
|
|
|
{
|
|
|
|
GtkFileSelection *fs = data;
|
|
|
|
HistoryCallbackArg *callback_arg;
|
|
|
|
GList *list;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
list = fs->history_list;
|
|
|
|
|
|
|
|
while (list) {
|
|
|
|
callback_arg = list->data;
|
|
|
|
|
|
|
|
if (callback_arg->menu_item == widget)
|
|
|
|
{
|
|
|
|
gtk_file_selection_populate (fs, callback_arg->directory, FALSE);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
list = list->next;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
static void
|
|
|
|
gtk_file_selection_update_history_menu (GtkFileSelection *fs,
|
|
|
|
gchar *current_directory)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-21 07:53:07 +00:00
|
|
|
HistoryCallbackArg *callback_arg;
|
|
|
|
GtkWidget *menu_item;
|
|
|
|
GList *list;
|
|
|
|
gchar *current_dir;
|
|
|
|
gint dir_len;
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
g_return_if_fail (current_directory != NULL);
|
|
|
|
|
|
|
|
list = fs->history_list;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
if (fs->history_menu)
|
|
|
|
{
|
|
|
|
while (list) {
|
|
|
|
callback_arg = list->data;
|
|
|
|
g_free (callback_arg->directory);
|
1998-03-24 05:27:00 +00:00
|
|
|
g_free (callback_arg);
|
1998-01-21 07:53:07 +00:00
|
|
|
list = list->next;
|
|
|
|
}
|
|
|
|
g_list_free (fs->history_list);
|
|
|
|
fs->history_list = NULL;
|
|
|
|
|
|
|
|
gtk_widget_destroy (fs->history_menu);
|
|
|
|
}
|
|
|
|
|
|
|
|
fs->history_menu = gtk_menu_new();
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-02-03 14:13:05 +00:00
|
|
|
current_dir = g_strdup (current_directory);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
dir_len = strlen (current_dir);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
for (i = dir_len; i >= 0; i--)
|
|
|
|
{
|
1998-03-09 10:54:13 +00:00
|
|
|
/* the i == dir_len is to catch the full path for the first
|
|
|
|
* entry. */
|
1999-03-13 01:14:19 +00:00
|
|
|
if ( (current_dir[i] == G_DIR_SEPARATOR) || (i == dir_len))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-03-09 10:54:13 +00:00
|
|
|
/* another small hack to catch the full path */
|
|
|
|
if (i != dir_len)
|
|
|
|
current_dir[i + 1] = '\0';
|
1999-10-06 19:47:24 +00:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-13 01:14:19 +00:00
|
|
|
if (!strcmp(current_dir, "//"))
|
|
|
|
continue;
|
|
|
|
#endif
|
1998-03-09 10:54:13 +00:00
|
|
|
menu_item = gtk_menu_item_new_with_label (current_dir);
|
1998-01-21 07:53:07 +00:00
|
|
|
|
|
|
|
callback_arg = g_new (HistoryCallbackArg, 1);
|
|
|
|
callback_arg->menu_item = menu_item;
|
1998-01-21 08:50:47 +00:00
|
|
|
|
1998-03-09 10:54:13 +00:00
|
|
|
/* since the autocompletion gets confused if you don't
|
|
|
|
* supply a trailing '/' on a dir entry, set the full
|
|
|
|
* (current) path to "" which just refreshes the filesel */
|
|
|
|
if (dir_len == i) {
|
|
|
|
callback_arg->directory = g_strdup ("");
|
|
|
|
} else {
|
1998-03-24 05:27:00 +00:00
|
|
|
callback_arg->directory = g_strdup (current_dir);
|
1998-03-09 10:54:13 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
fs->history_list = g_list_append (fs->history_list, callback_arg);
|
|
|
|
|
|
|
|
gtk_signal_connect (GTK_OBJECT (menu_item), "activate",
|
|
|
|
(GtkSignalFunc) gtk_file_selection_history_callback,
|
|
|
|
(gpointer) fs);
|
|
|
|
gtk_menu_append (GTK_MENU (fs->history_menu), menu_item);
|
|
|
|
gtk_widget_show (menu_item);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
1998-03-09 10:54:13 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_option_menu_set_menu (GTK_OPTION_MENU (fs->history_pulldown),
|
|
|
|
fs->history_menu);
|
|
|
|
g_free (current_dir);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
static void
|
|
|
|
gtk_file_selection_file_button (GtkWidget *widget,
|
1998-02-19 02:59:55 +00:00
|
|
|
gint row,
|
|
|
|
gint column,
|
|
|
|
GdkEventButton *bevent,
|
|
|
|
gpointer user_data)
|
1998-02-18 10:03:54 +00:00
|
|
|
{
|
|
|
|
GtkFileSelection *fs = NULL;
|
1998-03-11 07:59:46 +00:00
|
|
|
gchar *filename, *temp = NULL;
|
1998-02-18 10:03:54 +00:00
|
|
|
|
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
|
|
|
|
|
|
|
fs = user_data;
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
1998-03-11 07:59:46 +00:00
|
|
|
gtk_clist_get_text (GTK_CLIST (fs->file_list), row, 0, &temp);
|
|
|
|
filename = g_strdup (temp);
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-13 01:14:19 +00:00
|
|
|
/* Check to see if the selection was a drive selector */
|
|
|
|
if (isalpha(filename[0]) && (filename[1] == ':')) {
|
|
|
|
/* It is... map it to a CYGWIN32 drive */
|
|
|
|
char temp_filename[10];
|
|
|
|
|
|
|
|
sprintf(temp_filename, "//%c/", tolower(filename[0]));
|
|
|
|
g_free(filename);
|
|
|
|
filename = g_strdup(temp_filename);
|
|
|
|
}
|
1999-10-06 19:47:24 +00:00
|
|
|
#endif /* G_WITH_CYGWIN */
|
1999-03-13 01:14:19 +00:00
|
|
|
|
1998-07-16 13:05:02 +00:00
|
|
|
if (filename)
|
1998-02-19 02:59:55 +00:00
|
|
|
{
|
1998-07-16 13:05:02 +00:00
|
|
|
if (bevent)
|
|
|
|
switch (bevent->type)
|
|
|
|
{
|
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
gtk_button_clicked (GTK_BUTTON (fs->ok_button));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename);
|
1998-03-11 07:59:46 +00:00
|
|
|
|
1998-07-16 13:05:02 +00:00
|
|
|
g_free (filename);
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_file_selection_dir_button (GtkWidget *widget,
|
|
|
|
gint row,
|
|
|
|
gint column,
|
1998-02-19 02:59:55 +00:00
|
|
|
GdkEventButton *bevent,
|
1998-01-21 07:53:07 +00:00
|
|
|
gpointer user_data)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-21 07:53:07 +00:00
|
|
|
GtkFileSelection *fs = NULL;
|
1998-03-11 07:59:46 +00:00
|
|
|
gchar *filename, *temp = NULL;
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
g_return_if_fail (GTK_IS_CLIST (widget));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
fs = GTK_FILE_SELECTION (user_data);
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-03-11 07:59:46 +00:00
|
|
|
gtk_clist_get_text (GTK_CLIST (fs->dir_list), row, 0, &temp);
|
|
|
|
filename = g_strdup (temp);
|
|
|
|
|
1998-07-16 13:05:02 +00:00
|
|
|
if (filename)
|
1998-03-11 07:59:46 +00:00
|
|
|
{
|
1998-07-16 13:05:02 +00:00
|
|
|
if (bevent)
|
|
|
|
switch (bevent->type)
|
|
|
|
{
|
|
|
|
case GDK_2BUTTON_PRESS:
|
|
|
|
gtk_file_selection_populate (fs, filename, FALSE);
|
|
|
|
break;
|
1998-03-11 07:59:46 +00:00
|
|
|
|
1998-07-16 13:05:02 +00:00
|
|
|
default:
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), filename);
|
|
|
|
|
|
|
|
g_free (filename);
|
1998-03-11 07:59:46 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
1999-03-13 01:14:19 +00:00
|
|
|
|
|
|
|
static void
|
|
|
|
win32_gtk_add_drives_to_dir_list(GtkWidget *the_dir_list)
|
|
|
|
{
|
|
|
|
gchar *text[2], *textPtr;
|
|
|
|
gchar buffer[128];
|
|
|
|
char volumeNameBuf[128];
|
|
|
|
char formatBuffer[128];
|
|
|
|
gint row;
|
|
|
|
|
|
|
|
text[1] = NULL;
|
|
|
|
|
|
|
|
/* Get the Drives string */
|
|
|
|
GetLogicalDriveStrings(sizeof(buffer), buffer);
|
|
|
|
|
|
|
|
/* Add the drives as necessary */
|
|
|
|
textPtr = buffer;
|
|
|
|
while (*textPtr != '\0') {
|
|
|
|
/* Get the volume information for this drive */
|
|
|
|
if ((tolower(textPtr[0]) != 'a') && (tolower(textPtr[0]) != 'b'))
|
|
|
|
{
|
|
|
|
/* Ignore floppies (?) */
|
|
|
|
DWORD maxComponentLength, flags;
|
|
|
|
|
|
|
|
GetVolumeInformation(textPtr,
|
|
|
|
volumeNameBuf, sizeof(volumeNameBuf),
|
|
|
|
NULL, &maxComponentLength,
|
|
|
|
&flags, NULL, 0);
|
|
|
|
/* Build the actual displayable string */
|
|
|
|
|
|
|
|
sprintf(formatBuffer, "%c:\\", toupper(textPtr[0]));
|
|
|
|
#if 0 /* HB: removed to allow drive change AND directory update with one click */
|
|
|
|
if (strlen(volumeNameBuf) > 0)
|
|
|
|
sprintf(formatBuffer, "%s (%s)", formatBuffer, volumeNameBuf);
|
|
|
|
#endif
|
|
|
|
/* Add to the list */
|
|
|
|
text[0] = formatBuffer;
|
|
|
|
row = gtk_clist_append (GTK_CLIST (the_dir_list), text);
|
|
|
|
}
|
|
|
|
textPtr += (strlen(textPtr) + 1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static void
|
|
|
|
gtk_file_selection_populate (GtkFileSelection *fs,
|
|
|
|
gchar *rel_path,
|
|
|
|
gint try_complete)
|
|
|
|
{
|
|
|
|
CompletionState *cmpl_state;
|
|
|
|
PossibleCompletion* poss;
|
|
|
|
gchar* filename;
|
1998-01-21 07:53:07 +00:00
|
|
|
gint row;
|
1997-11-24 22:37:52 +00:00
|
|
|
gchar* rem_path = rel_path;
|
|
|
|
gchar* sel_text;
|
1998-01-21 07:53:07 +00:00
|
|
|
gchar* text[2];
|
1997-11-24 22:37:52 +00:00
|
|
|
gint did_recurse = FALSE;
|
|
|
|
gint possible_count = 0;
|
|
|
|
gint selection_index = -1;
|
1998-03-13 09:19:03 +00:00
|
|
|
gint file_list_width;
|
|
|
|
gint dir_list_width;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_return_if_fail (fs != NULL);
|
|
|
|
g_return_if_fail (GTK_IS_FILE_SELECTION (fs));
|
|
|
|
|
|
|
|
cmpl_state = (CompletionState*) fs->cmpl_state;
|
|
|
|
poss = cmpl_completion_matches (rel_path, &rem_path, cmpl_state);
|
|
|
|
|
|
|
|
if (!cmpl_state_okay (cmpl_state))
|
|
|
|
{
|
|
|
|
/* Something went wrong. */
|
|
|
|
gtk_file_selection_abort (fs);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert (cmpl_state->reference_dir);
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_clist_freeze (GTK_CLIST (fs->dir_list));
|
|
|
|
gtk_clist_clear (GTK_CLIST (fs->dir_list));
|
|
|
|
gtk_clist_freeze (GTK_CLIST (fs->file_list));
|
|
|
|
gtk_clist_clear (GTK_CLIST (fs->file_list));
|
|
|
|
|
|
|
|
/* Set the dir_list to include ./ and ../ */
|
|
|
|
text[1] = NULL;
|
1999-03-13 01:14:19 +00:00
|
|
|
text[0] = "." G_DIR_SEPARATOR_S;
|
1998-01-21 07:53:07 +00:00
|
|
|
row = gtk_clist_append (GTK_CLIST (fs->dir_list), text);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
text[0] = ".." G_DIR_SEPARATOR_S;
|
1998-01-21 07:53:07 +00:00
|
|
|
row = gtk_clist_append (GTK_CLIST (fs->dir_list), text);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-03-13 09:19:03 +00:00
|
|
|
/*reset the max widths of the lists*/
|
1999-03-13 01:14:19 +00:00
|
|
|
dir_list_width = gdk_string_width(fs->dir_list->style->font,".." G_DIR_SEPARATOR_S);
|
1998-03-13 09:19:03 +00:00
|
|
|
gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,dir_list_width);
|
|
|
|
file_list_width = 1;
|
|
|
|
gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,file_list_width);
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
while (poss)
|
|
|
|
{
|
|
|
|
if (cmpl_is_a_completion (poss))
|
|
|
|
{
|
|
|
|
possible_count += 1;
|
|
|
|
|
1998-03-24 01:43:21 +00:00
|
|
|
filename = cmpl_this_completion (poss);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
text[0] = filename;
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (cmpl_is_directory (poss))
|
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
if (strcmp (filename, "." G_DIR_SEPARATOR_S) != 0 &&
|
|
|
|
strcmp (filename, ".." G_DIR_SEPARATOR_S) != 0)
|
1998-01-21 07:53:07 +00:00
|
|
|
{
|
1998-03-13 09:19:03 +00:00
|
|
|
int width = gdk_string_width(fs->dir_list->style->font,
|
|
|
|
filename);
|
1998-01-21 07:53:07 +00:00
|
|
|
row = gtk_clist_append (GTK_CLIST (fs->dir_list), text);
|
1998-03-13 09:19:03 +00:00
|
|
|
if(width > dir_list_width)
|
|
|
|
{
|
|
|
|
dir_list_width = width;
|
|
|
|
gtk_clist_set_column_width(GTK_CLIST(fs->dir_list),0,
|
|
|
|
width);
|
|
|
|
}
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1998-01-21 07:53:07 +00:00
|
|
|
{
|
1998-03-13 09:19:03 +00:00
|
|
|
int width = gdk_string_width(fs->file_list->style->font,
|
|
|
|
filename);
|
1998-01-21 07:53:07 +00:00
|
|
|
row = gtk_clist_append (GTK_CLIST (fs->file_list), text);
|
1998-03-13 09:19:03 +00:00
|
|
|
if(width > file_list_width)
|
|
|
|
{
|
|
|
|
file_list_width = width;
|
|
|
|
gtk_clist_set_column_width(GTK_CLIST(fs->file_list),0,
|
|
|
|
width);
|
|
|
|
}
|
1998-01-21 07:53:07 +00:00
|
|
|
}
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
poss = cmpl_next_completion (cmpl_state);
|
|
|
|
}
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
1999-03-13 01:14:19 +00:00
|
|
|
/* For Windows, add drives as potential selections */
|
|
|
|
win32_gtk_add_drives_to_dir_list (fs->dir_list);
|
|
|
|
#endif
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_clist_thaw (GTK_CLIST (fs->dir_list));
|
|
|
|
gtk_clist_thaw (GTK_CLIST (fs->file_list));
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* File lists are set. */
|
|
|
|
|
|
|
|
g_assert (cmpl_state->reference_dir);
|
|
|
|
|
|
|
|
if (try_complete)
|
|
|
|
{
|
1998-01-21 07:53:07 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* User is trying to complete filenames, so advance the user's input
|
|
|
|
* string to the updated_text, which is the common leading substring
|
|
|
|
* of all possible completions, and if its a directory attempt
|
|
|
|
* attempt completions in it. */
|
|
|
|
|
|
|
|
if (cmpl_updated_text (cmpl_state)[0])
|
|
|
|
{
|
1998-01-21 07:53:07 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
if (cmpl_updated_dir (cmpl_state))
|
|
|
|
{
|
1998-01-21 07:53:07 +00:00
|
|
|
gchar* dir_name = g_strdup (cmpl_updated_text (cmpl_state));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
did_recurse = TRUE;
|
|
|
|
|
|
|
|
gtk_file_selection_populate (fs, dir_name, TRUE);
|
|
|
|
|
|
|
|
g_free (dir_name);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (fs->selection_entry)
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->selection_entry),
|
|
|
|
cmpl_updated_text (cmpl_state));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
selection_index = cmpl_last_valid_char (cmpl_state) -
|
|
|
|
(strlen (rel_path) - strlen (rem_path));
|
|
|
|
if (fs->selection_entry)
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), rem_path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (fs->selection_entry)
|
|
|
|
gtk_entry_set_text (GTK_ENTRY (fs->selection_entry), "");
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!did_recurse)
|
|
|
|
{
|
|
|
|
if (fs->selection_entry)
|
|
|
|
gtk_entry_set_position (GTK_ENTRY (fs->selection_entry), selection_index);
|
|
|
|
|
|
|
|
if (fs->selection_entry)
|
|
|
|
{
|
1999-01-09 22:34:28 +00:00
|
|
|
sel_text = g_strconcat (_("Selection: "),
|
|
|
|
cmpl_reference_position (cmpl_state),
|
|
|
|
NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-12-15 20:31:26 +00:00
|
|
|
gtk_label_set_text (GTK_LABEL (fs->selection_text), sel_text);
|
1997-11-24 22:37:52 +00:00
|
|
|
g_free (sel_text);
|
|
|
|
}
|
|
|
|
|
1998-01-21 07:53:07 +00:00
|
|
|
if (fs->history_pulldown)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-01-21 07:53:07 +00:00
|
|
|
gtk_file_selection_update_history_menu (fs, cmpl_reference_position (cmpl_state));
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-01-21 07:53:07 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
gtk_file_selection_abort (GtkFileSelection *fs)
|
|
|
|
{
|
|
|
|
gchar err_buf[256];
|
|
|
|
|
1998-12-14 17:39:58 +00:00
|
|
|
sprintf (err_buf, _("Directory unreadable: %s"), cmpl_strerror (cmpl_errno));
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
/* BEEP gdk_beep(); */
|
|
|
|
|
|
|
|
if (fs->selection_entry)
|
1998-12-15 20:31:26 +00:00
|
|
|
gtk_label_set_text (GTK_LABEL (fs->selection_text), err_buf);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************/
|
|
|
|
/* External Interface */
|
|
|
|
/**********************************************************************/
|
|
|
|
|
|
|
|
/* The four completion state selectors
|
|
|
|
*/
|
|
|
|
static gchar*
|
|
|
|
cmpl_updated_text (CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
return cmpl_state->updated_text;
|
|
|
|
}
|
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
static gboolean
|
1997-11-24 22:37:52 +00:00
|
|
|
cmpl_updated_dir (CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
return cmpl_state->re_complete;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar*
|
|
|
|
cmpl_reference_position (CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
return cmpl_state->reference_dir->fullname;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
cmpl_last_valid_char (CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
return cmpl_state->last_valid_char;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar*
|
|
|
|
cmpl_completion_fullname (gchar* text, CompletionState* cmpl_state)
|
|
|
|
{
|
1998-05-01 04:23:59 +00:00
|
|
|
static char nothing[2] = "";
|
|
|
|
|
|
|
|
if (!cmpl_state_okay (cmpl_state))
|
|
|
|
{
|
|
|
|
return nothing;
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
else if (g_path_is_absolute (text))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
strcpy (cmpl_state->updated_text, text);
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (text[0] == '~')
|
|
|
|
{
|
|
|
|
CompletionDir* dir;
|
|
|
|
char* slash;
|
|
|
|
|
|
|
|
dir = open_user_dir (text, cmpl_state);
|
|
|
|
|
|
|
|
if (!dir)
|
|
|
|
{
|
|
|
|
/* spencer says just return ~something, so
|
|
|
|
* for now just do it. */
|
|
|
|
strcpy (cmpl_state->updated_text, text);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
|
|
|
|
strcpy (cmpl_state->updated_text, dir->fullname);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
slash = strchr (text, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (slash)
|
|
|
|
strcat (cmpl_state->updated_text, slash);
|
|
|
|
}
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
strcpy (cmpl_state->updated_text, cmpl_state->reference_dir->fullname);
|
1999-03-13 01:14:19 +00:00
|
|
|
if (cmpl_state->updated_text[strlen (cmpl_state->updated_text) - 1] != G_DIR_SEPARATOR)
|
|
|
|
strcat (cmpl_state->updated_text, G_DIR_SEPARATOR_S);
|
1997-11-24 22:37:52 +00:00
|
|
|
strcat (cmpl_state->updated_text, text);
|
|
|
|
}
|
|
|
|
|
|
|
|
return cmpl_state->updated_text;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* The three completion selectors
|
|
|
|
*/
|
|
|
|
static gchar*
|
|
|
|
cmpl_this_completion (PossibleCompletion* pc)
|
|
|
|
{
|
|
|
|
return pc->text;
|
|
|
|
}
|
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
static gboolean
|
1997-11-24 22:37:52 +00:00
|
|
|
cmpl_is_directory (PossibleCompletion* pc)
|
|
|
|
{
|
|
|
|
return pc->is_directory;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
cmpl_is_a_completion (PossibleCompletion* pc)
|
|
|
|
{
|
|
|
|
return pc->is_a_completion;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************/
|
|
|
|
/* Construction, deletion */
|
|
|
|
/**********************************************************************/
|
|
|
|
|
|
|
|
static CompletionState*
|
|
|
|
cmpl_init_state (void)
|
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
gchar *getcwd_buf;
|
1997-11-24 22:37:52 +00:00
|
|
|
CompletionState *new_state;
|
|
|
|
|
|
|
|
new_state = g_new (CompletionState, 1);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
getcwd_buf = g_get_current_dir ();
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-05-01 04:23:59 +00:00
|
|
|
tryagain:
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
new_state->reference_dir = NULL;
|
|
|
|
new_state->completion_dir = NULL;
|
|
|
|
new_state->active_completion_dir = NULL;
|
|
|
|
new_state->directory_storage = NULL;
|
|
|
|
new_state->directory_sent_storage = NULL;
|
|
|
|
new_state->last_valid_char = 0;
|
|
|
|
new_state->updated_text = g_new (gchar, MAXPATHLEN);
|
|
|
|
new_state->updated_text_alloc = MAXPATHLEN;
|
|
|
|
new_state->the_completion.text = g_new (gchar, MAXPATHLEN);
|
|
|
|
new_state->the_completion.text_alloc = MAXPATHLEN;
|
|
|
|
new_state->user_dir_name_buffer = NULL;
|
|
|
|
new_state->user_directories = NULL;
|
|
|
|
|
|
|
|
new_state->reference_dir = open_dir (getcwd_buf, new_state);
|
|
|
|
|
|
|
|
if (!new_state->reference_dir)
|
1998-05-01 04:23:59 +00:00
|
|
|
{
|
|
|
|
/* Directories changing from underneath us, grumble */
|
1999-03-13 01:14:19 +00:00
|
|
|
strcpy (getcwd_buf, G_DIR_SEPARATOR_S);
|
1998-05-01 04:23:59 +00:00
|
|
|
goto tryagain;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
g_free (getcwd_buf);
|
1997-11-24 22:37:52 +00:00
|
|
|
return new_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cmpl_free_dir_list(GList* dp0)
|
|
|
|
{
|
|
|
|
GList *dp = dp0;
|
|
|
|
|
|
|
|
while (dp) {
|
|
|
|
free_dir (dp->data);
|
|
|
|
dp = dp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free(dp0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cmpl_free_dir_sent_list(GList* dp0)
|
|
|
|
{
|
|
|
|
GList *dp = dp0;
|
|
|
|
|
|
|
|
while (dp) {
|
|
|
|
free_dir_sent (dp->data);
|
|
|
|
dp = dp->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free(dp0);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
cmpl_free_state (CompletionState* cmpl_state)
|
|
|
|
{
|
1998-02-02 18:44:28 +00:00
|
|
|
cmpl_free_dir_list (cmpl_state->directory_storage);
|
|
|
|
cmpl_free_dir_sent_list (cmpl_state->directory_sent_storage);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (cmpl_state->user_dir_name_buffer)
|
|
|
|
g_free (cmpl_state->user_dir_name_buffer);
|
|
|
|
if (cmpl_state->user_directories)
|
|
|
|
g_free (cmpl_state->user_directories);
|
|
|
|
if (cmpl_state->the_completion.text)
|
|
|
|
g_free (cmpl_state->the_completion.text);
|
|
|
|
if (cmpl_state->updated_text)
|
|
|
|
g_free (cmpl_state->updated_text);
|
|
|
|
|
|
|
|
g_free (cmpl_state);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
free_dir(CompletionDir* dir)
|
|
|
|
{
|
|
|
|
g_free(dir->fullname);
|
|
|
|
g_free(dir);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
free_dir_sent(CompletionDirSent* sent)
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
gint i;
|
|
|
|
for (i = 0; i < sent->entry_count; i++)
|
|
|
|
g_free(sent->entries[i].entry_name);
|
1997-11-24 22:37:52 +00:00
|
|
|
g_free(sent->entries);
|
|
|
|
g_free(sent);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
prune_memory_usage(CompletionState *cmpl_state)
|
|
|
|
{
|
|
|
|
GList* cdsl = cmpl_state->directory_sent_storage;
|
|
|
|
GList* cdl = cmpl_state->directory_storage;
|
|
|
|
GList* cdl0 = cdl;
|
|
|
|
gint len = 0;
|
|
|
|
|
|
|
|
for(; cdsl && len < CMPL_DIRECTORY_CACHE_SIZE; len += 1)
|
|
|
|
cdsl = cdsl->next;
|
|
|
|
|
|
|
|
if (cdsl) {
|
|
|
|
cmpl_free_dir_sent_list(cdsl->next);
|
|
|
|
cdsl->next = NULL;
|
|
|
|
}
|
|
|
|
|
1997-12-07 02:34:38 +00:00
|
|
|
cmpl_state->directory_storage = NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
while (cdl) {
|
|
|
|
if (cdl->data == cmpl_state->reference_dir)
|
|
|
|
cmpl_state->directory_storage = g_list_prepend(NULL, cdl->data);
|
|
|
|
else
|
|
|
|
free_dir (cdl->data);
|
|
|
|
cdl = cdl->next;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_list_free(cdl0);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************/
|
|
|
|
/* The main entrances. */
|
|
|
|
/**********************************************************************/
|
|
|
|
|
|
|
|
static PossibleCompletion*
|
|
|
|
cmpl_completion_matches (gchar* text_to_complete,
|
|
|
|
gchar** remaining_text,
|
|
|
|
CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
gchar* first_slash;
|
|
|
|
PossibleCompletion *poss;
|
|
|
|
|
|
|
|
prune_memory_usage(cmpl_state);
|
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
g_assert (text_to_complete != NULL);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
cmpl_state->user_completion_index = -1;
|
|
|
|
cmpl_state->last_completion_text = text_to_complete;
|
|
|
|
cmpl_state->the_completion.text[0] = 0;
|
|
|
|
cmpl_state->last_valid_char = 0;
|
|
|
|
cmpl_state->updated_text_len = -1;
|
|
|
|
cmpl_state->updated_text[0] = 0;
|
|
|
|
cmpl_state->re_complete = FALSE;
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
|
|
|
first_slash = strchr (text_to_complete, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-10-22 00:54:57 +00:00
|
|
|
if (text_to_complete[0] == '~' && !first_slash)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
/* Text starts with ~ and there is no slash, show all the
|
|
|
|
* home directory completions.
|
|
|
|
*/
|
1998-10-22 00:54:57 +00:00
|
|
|
poss = attempt_homedir_completion (text_to_complete, cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
update_cmpl(poss, cmpl_state);
|
|
|
|
|
|
|
|
return poss;
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
cmpl_state->reference_dir =
|
1998-10-22 00:54:57 +00:00
|
|
|
open_ref_dir (text_to_complete, remaining_text, cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if(!cmpl_state->reference_dir)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
cmpl_state->completion_dir =
|
1998-10-22 00:54:57 +00:00
|
|
|
find_completion_dir (*remaining_text, remaining_text, cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
cmpl_state->last_valid_char = *remaining_text - text_to_complete;
|
|
|
|
|
|
|
|
if(!cmpl_state->completion_dir)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
cmpl_state->completion_dir->cmpl_index = -1;
|
|
|
|
cmpl_state->completion_dir->cmpl_parent = NULL;
|
|
|
|
cmpl_state->completion_dir->cmpl_text = *remaining_text;
|
|
|
|
|
|
|
|
cmpl_state->active_completion_dir = cmpl_state->completion_dir;
|
|
|
|
|
|
|
|
cmpl_state->reference_dir = cmpl_state->completion_dir;
|
|
|
|
|
|
|
|
poss = attempt_file_completion(cmpl_state);
|
|
|
|
|
|
|
|
update_cmpl(poss, cmpl_state);
|
|
|
|
|
|
|
|
return poss;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PossibleCompletion*
|
|
|
|
cmpl_next_completion (CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
PossibleCompletion* poss = NULL;
|
|
|
|
|
|
|
|
cmpl_state->the_completion.text[0] = 0;
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
if(cmpl_state->user_completion_index >= 0)
|
|
|
|
poss = attempt_homedir_completion(cmpl_state->last_completion_text, cmpl_state);
|
|
|
|
else
|
|
|
|
poss = attempt_file_completion(cmpl_state);
|
1999-03-13 01:14:19 +00:00
|
|
|
#else
|
|
|
|
poss = attempt_file_completion(cmpl_state);
|
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
update_cmpl(poss, cmpl_state);
|
|
|
|
|
|
|
|
return poss;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**********************************************************************/
|
|
|
|
/* Directory Operations */
|
|
|
|
/**********************************************************************/
|
|
|
|
|
|
|
|
/* Open the directory where completion will begin from, if possible. */
|
|
|
|
static CompletionDir*
|
|
|
|
open_ref_dir(gchar* text_to_complete,
|
|
|
|
gchar** remaining_text,
|
|
|
|
CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
gchar* first_slash;
|
|
|
|
CompletionDir *new_dir;
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
first_slash = strchr(text_to_complete, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#ifdef G_WITH_CYGWIN
|
1999-03-13 01:14:19 +00:00
|
|
|
if (text_to_complete[0] == '/' && text_to_complete[1] == '/')
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
char root_dir[5];
|
|
|
|
sprintf(root_dir, "//%c", text_to_complete[2]);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
new_dir = open_dir(root_dir, cmpl_state);
|
|
|
|
|
|
|
|
if (new_dir) {
|
|
|
|
*remaining_text = text_to_complete + 4;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
#else
|
|
|
|
if (FALSE)
|
|
|
|
;
|
|
|
|
#endif
|
|
|
|
else if (g_path_is_absolute (text_to_complete) || !cmpl_state->reference_dir)
|
|
|
|
{
|
|
|
|
char *root;
|
|
|
|
int rootlen;
|
|
|
|
|
|
|
|
rootlen = g_path_skip_root (text_to_complete) - text_to_complete;
|
|
|
|
root = g_malloc (rootlen + 1);
|
|
|
|
memcpy (root, text_to_complete, rootlen);
|
|
|
|
root[rootlen] = '\0';
|
|
|
|
new_dir = open_dir (root, cmpl_state);
|
|
|
|
if (new_dir)
|
|
|
|
*remaining_text = g_path_skip_root (text_to_complete);
|
|
|
|
g_free (root);
|
|
|
|
}
|
|
|
|
#ifdef HAVE_PWD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
else if (text_to_complete[0] == '~')
|
|
|
|
{
|
|
|
|
new_dir = open_user_dir(text_to_complete, cmpl_state);
|
|
|
|
|
|
|
|
if(new_dir)
|
|
|
|
{
|
|
|
|
if(first_slash)
|
|
|
|
*remaining_text = first_slash + 1;
|
|
|
|
else
|
|
|
|
*remaining_text = text_to_complete + strlen(text_to_complete);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
*remaining_text = text_to_complete;
|
|
|
|
|
|
|
|
new_dir = open_dir(cmpl_state->reference_dir->fullname, cmpl_state);
|
|
|
|
}
|
|
|
|
|
|
|
|
if(new_dir)
|
|
|
|
{
|
|
|
|
new_dir->cmpl_index = -1;
|
|
|
|
new_dir->cmpl_parent = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return new_dir;
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* open a directory by user name */
|
|
|
|
static CompletionDir*
|
|
|
|
open_user_dir(gchar* text_to_complete,
|
|
|
|
CompletionState *cmpl_state)
|
|
|
|
{
|
|
|
|
gchar *first_slash;
|
|
|
|
gint cmp_len;
|
|
|
|
|
|
|
|
g_assert(text_to_complete && text_to_complete[0] == '~');
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
first_slash = strchr(text_to_complete, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (first_slash)
|
|
|
|
cmp_len = first_slash - text_to_complete - 1;
|
|
|
|
else
|
|
|
|
cmp_len = strlen(text_to_complete + 1);
|
|
|
|
|
|
|
|
if(!cmp_len)
|
|
|
|
{
|
|
|
|
/* ~/ */
|
1999-01-28 01:04:38 +00:00
|
|
|
gchar *homedir = g_get_home_dir ();
|
|
|
|
|
|
|
|
if (homedir)
|
|
|
|
return open_dir(homedir, cmpl_state);
|
|
|
|
else
|
1997-11-24 22:37:52 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* ~user/ */
|
|
|
|
char* copy = g_new(char, cmp_len + 1);
|
|
|
|
struct passwd *pwd;
|
|
|
|
strncpy(copy, text_to_complete + 1, cmp_len);
|
|
|
|
copy[cmp_len] = 0;
|
|
|
|
pwd = getpwnam(copy);
|
|
|
|
g_free(copy);
|
|
|
|
if (!pwd)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return open_dir(pwd->pw_dir, cmpl_state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* open a directory relative the the current relative directory */
|
|
|
|
static CompletionDir*
|
|
|
|
open_relative_dir(gchar* dir_name,
|
|
|
|
CompletionDir* dir,
|
|
|
|
CompletionState *cmpl_state)
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
CompletionDir *result;
|
|
|
|
GString *path;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
path = g_string_sized_new (dir->fullname_len + strlen (dir_name) + 10);
|
|
|
|
g_string_assign (path, dir->fullname);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
if(dir->fullname_len > 1
|
|
|
|
&& path->str[dir->fullname_len - 1] != G_DIR_SEPARATOR)
|
|
|
|
g_string_append_c (path, G_DIR_SEPARATOR);
|
|
|
|
g_string_append (path, dir_name);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
result = open_dir(path->str, cmpl_state);
|
|
|
|
|
|
|
|
g_string_free (path, TRUE);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
return result;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* after the cache lookup fails, really open a new directory */
|
|
|
|
static CompletionDirSent*
|
1998-09-12 14:41:04 +00:00
|
|
|
open_new_dir(gchar* dir_name, struct stat* sbuf, gboolean stat_subdirs)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
CompletionDirSent* sent;
|
|
|
|
DIR* directory;
|
|
|
|
struct dirent *dirent_ptr;
|
|
|
|
gint entry_count = 0;
|
|
|
|
gint i;
|
|
|
|
struct stat ent_sbuf;
|
2000-02-03 01:19:03 +00:00
|
|
|
GString *path;
|
2000-02-13 08:16:48 +00:00
|
|
|
gchar *xdir;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
sent = g_new(CompletionDirSent, 1);
|
|
|
|
sent->mtime = sbuf->st_mtime;
|
|
|
|
sent->inode = sbuf->st_ino;
|
1998-04-07 23:59:25 +00:00
|
|
|
sent->device = sbuf->st_dev;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
path = g_string_sized_new (2*MAXPATHLEN + 10);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
xdir = g_filename_from_utf8 (dir_name);
|
|
|
|
directory = opendir(xdir);
|
|
|
|
g_free (xdir);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if(!directory)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
while((dirent_ptr = readdir(directory)) != NULL)
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
entry_count++;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
sent->entries = g_new(CompletionDirEntry, entry_count);
|
|
|
|
sent->entry_count = entry_count;
|
|
|
|
|
|
|
|
rewinddir(directory);
|
|
|
|
|
|
|
|
for(i = 0; i < entry_count; i += 1)
|
|
|
|
{
|
|
|
|
dirent_ptr = readdir(directory);
|
|
|
|
|
|
|
|
if(!dirent_ptr)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
closedir(directory);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
sent->entries[i].entry_name = g_filename_to_utf8 (dirent_ptr->d_name);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
g_string_assign (path, dir_name);
|
|
|
|
if (path->str[path->len-1] != G_DIR_SEPARATOR)
|
1999-03-13 01:14:19 +00:00
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
g_string_append_c (path, G_DIR_SEPARATOR);
|
1999-03-13 01:14:19 +00:00
|
|
|
}
|
2000-02-03 01:19:03 +00:00
|
|
|
g_string_append (path, dirent_ptr->d_name);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-09-12 14:41:04 +00:00
|
|
|
if (stat_subdirs)
|
|
|
|
{
|
2000-02-03 01:19:03 +00:00
|
|
|
if(stat(path->str, &ent_sbuf) >= 0 && S_ISDIR(ent_sbuf.st_mode))
|
|
|
|
sent->entries[i].is_dir = TRUE;
|
1998-09-12 14:41:04 +00:00
|
|
|
else
|
|
|
|
/* stat may fail, and we don't mind, since it could be a
|
|
|
|
* dangling symlink. */
|
2000-02-03 01:19:03 +00:00
|
|
|
sent->entries[i].is_dir = FALSE;
|
1998-09-12 14:41:04 +00:00
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
1998-09-12 14:41:04 +00:00
|
|
|
sent->entries[i].is_dir = 1;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
2000-02-03 01:19:03 +00:00
|
|
|
g_string_free (path, TRUE);
|
1997-11-24 22:37:52 +00:00
|
|
|
qsort(sent->entries, sent->entry_count, sizeof(CompletionDirEntry), compare_cmpl_dir);
|
|
|
|
|
|
|
|
closedir(directory);
|
|
|
|
|
|
|
|
return sent;
|
|
|
|
}
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
|
1999-03-13 01:14:19 +00:00
|
|
|
|
1998-09-12 14:41:04 +00:00
|
|
|
static gboolean
|
|
|
|
check_dir(gchar *dir_name, struct stat *result, gboolean *stat_subdirs)
|
|
|
|
{
|
|
|
|
/* A list of directories that we know only contain other directories.
|
|
|
|
* Trying to stat every file in these directories would be very
|
|
|
|
* expensive.
|
|
|
|
*/
|
|
|
|
|
reverted marius change to expose the type systems internal type info data
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: reverted marius change to expose the type systems
internal type info data to the user. if such functionality is required
we should provide wrapped accessors, ala gtk_signal_query().
* gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change,
since it destroys the possibility to implement automatic marshaller
lookups some day, and it also disables third party code's ability to
connect to any signal. also the GtkTypeInfo structures are dynamically
allocated memory portions, so only the type system is really allowed
to access that stuff.
Mon Dec 7 01:32:18 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the
Tab key on the entry. the focus shouldn't get lost even if completion
is attempted from an empty entry, since an empty entry string does
indeed have a valid completion meaning (complete all).
(gtk_file_selection_init): cast the gchar array parameter in calls to
gtk_clist_new_with_titles() to quit compiler warnings.
(check_dir): the no_stat_dirs struct must not be const, since we do
indeed modify its contents.
* gtk/testgtk.c (event_watcher): adapted prototype to fit new emission
hook semantics.
* gtk/gtksignal.h:
* gtk/gtksignal.c:
changed emission allocation, so we don't use a doubly linked list
but link ourselfs (singly linked).
changed emission hooks, they get the emision parameters passed as
well now and are emitted during the actuall signal emission (after
the RUN_FIRST class method, but prior to RUN_FIRST handlers).
the existing restrictions do still apply to signal emission hooks,
i.e. an emission may not be stopped or restarted from an emission hook.
due to possibly huge perfomance impacts, frequent use of emision hooks
is also not recommended.
(gtk_signal_next_and_invalidate): added an
assertments which explicits what the code assumes anyways: a
maximum amount of 65535 signals.
* gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(),
gtk_container_foreach_full() should be used instead.
* gtk/gtkmain.h:
deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since
we provide _full variants.
* gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide
gtk_signal_connect_full() for long enough now.
1998-12-07 02:31:19 +00:00
|
|
|
static struct {
|
1998-09-12 14:41:04 +00:00
|
|
|
gchar *name;
|
|
|
|
gboolean present;
|
|
|
|
struct stat statbuf;
|
|
|
|
} no_stat_dirs[] = {
|
|
|
|
{ "/afs", FALSE, { 0 } },
|
1998-11-30 19:07:15 +00:00
|
|
|
{ "/net", FALSE, { 0 } }
|
1998-09-12 14:41:04 +00:00
|
|
|
};
|
|
|
|
|
1998-11-30 19:07:15 +00:00
|
|
|
static const gint n_no_stat_dirs = sizeof(no_stat_dirs) / sizeof(no_stat_dirs[0]);
|
1998-09-12 14:41:04 +00:00
|
|
|
static gboolean initialized = FALSE;
|
|
|
|
|
|
|
|
gint i;
|
|
|
|
|
|
|
|
if (!initialized)
|
|
|
|
{
|
|
|
|
initialized = TRUE;
|
reverted marius change to expose the type systems internal type info data
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: reverted marius change to expose the type systems
internal type info data to the user. if such functionality is required
we should provide wrapped accessors, ala gtk_signal_query().
* gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change,
since it destroys the possibility to implement automatic marshaller
lookups some day, and it also disables third party code's ability to
connect to any signal. also the GtkTypeInfo structures are dynamically
allocated memory portions, so only the type system is really allowed
to access that stuff.
Mon Dec 7 01:32:18 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the
Tab key on the entry. the focus shouldn't get lost even if completion
is attempted from an empty entry, since an empty entry string does
indeed have a valid completion meaning (complete all).
(gtk_file_selection_init): cast the gchar array parameter in calls to
gtk_clist_new_with_titles() to quit compiler warnings.
(check_dir): the no_stat_dirs struct must not be const, since we do
indeed modify its contents.
* gtk/testgtk.c (event_watcher): adapted prototype to fit new emission
hook semantics.
* gtk/gtksignal.h:
* gtk/gtksignal.c:
changed emission allocation, so we don't use a doubly linked list
but link ourselfs (singly linked).
changed emission hooks, they get the emision parameters passed as
well now and are emitted during the actuall signal emission (after
the RUN_FIRST class method, but prior to RUN_FIRST handlers).
the existing restrictions do still apply to signal emission hooks,
i.e. an emission may not be stopped or restarted from an emission hook.
due to possibly huge perfomance impacts, frequent use of emision hooks
is also not recommended.
(gtk_signal_next_and_invalidate): added an
assertments which explicits what the code assumes anyways: a
maximum amount of 65535 signals.
* gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(),
gtk_container_foreach_full() should be used instead.
* gtk/gtkmain.h:
deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since
we provide _full variants.
* gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide
gtk_signal_connect_full() for long enough now.
1998-12-07 02:31:19 +00:00
|
|
|
for (i = 0; i < n_no_stat_dirs; i++)
|
1998-09-12 14:41:04 +00:00
|
|
|
{
|
reverted marius change to expose the type systems internal type info data
Mon Dec 7 03:08:39 1998 Tim Janik <timj@gtk.org>
* gtk/gtktypeutils.h:
* gtk/gtktypeutils.c: reverted marius change to expose the type systems
internal type info data to the user. if such functionality is required
we should provide wrapped accessors, ala gtk_signal_query().
* gtk/gtksignal.c (gtk_signal_connect_by_type): reverted marius change,
since it destroys the possibility to implement automatic marshaller
lookups some day, and it also disables third party code's ability to
connect to any signal. also the GtkTypeInfo structures are dynamically
allocated memory portions, so only the type system is really allowed
to access that stuff.
Mon Dec 7 01:32:18 1998 Tim Janik <timj@gtk.org>
* gtk/gtkfilesel.c (gtk_file_selection_key_press): always intercept the
Tab key on the entry. the focus shouldn't get lost even if completion
is attempted from an empty entry, since an empty entry string does
indeed have a valid completion meaning (complete all).
(gtk_file_selection_init): cast the gchar array parameter in calls to
gtk_clist_new_with_titles() to quit compiler warnings.
(check_dir): the no_stat_dirs struct must not be const, since we do
indeed modify its contents.
* gtk/testgtk.c (event_watcher): adapted prototype to fit new emission
hook semantics.
* gtk/gtksignal.h:
* gtk/gtksignal.c:
changed emission allocation, so we don't use a doubly linked list
but link ourselfs (singly linked).
changed emission hooks, they get the emision parameters passed as
well now and are emitted during the actuall signal emission (after
the RUN_FIRST class method, but prior to RUN_FIRST handlers).
the existing restrictions do still apply to signal emission hooks,
i.e. an emission may not be stopped or restarted from an emission hook.
due to possibly huge perfomance impacts, frequent use of emision hooks
is also not recommended.
(gtk_signal_next_and_invalidate): added an
assertments which explicits what the code assumes anyways: a
maximum amount of 65535 signals.
* gtk/gtkcontainer.h: deprecated gtk_container_foreach_interp(),
gtk_container_foreach_full() should be used instead.
* gtk/gtkmain.h:
deprecated gtk_timeout_add_interp and gtk_idle_add_interp, since
we provide _full variants.
* gtk/gtksignal.h: deprecated gtk_signal_connect_interp(), we provide
gtk_signal_connect_full() for long enough now.
1998-12-07 02:31:19 +00:00
|
|
|
if (stat (no_stat_dirs[i].name, &no_stat_dirs[i].statbuf) == 0)
|
1998-09-12 14:41:04 +00:00
|
|
|
no_stat_dirs[i].present = TRUE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(stat(dir_name, result) < 0)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
*stat_subdirs = TRUE;
|
|
|
|
for (i=0; i<n_no_stat_dirs; i++)
|
|
|
|
{
|
|
|
|
if (no_stat_dirs[i].present &&
|
|
|
|
(no_stat_dirs[i].statbuf.st_dev == result->st_dev) &&
|
|
|
|
(no_stat_dirs[i].statbuf.st_ino == result->st_ino))
|
|
|
|
{
|
|
|
|
*stat_subdirs = FALSE;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* open a directory by absolute pathname */
|
|
|
|
static CompletionDir*
|
|
|
|
open_dir(gchar* dir_name, CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
struct stat sbuf;
|
1998-09-12 14:41:04 +00:00
|
|
|
gboolean stat_subdirs;
|
1997-11-24 22:37:52 +00:00
|
|
|
CompletionDirSent *sent;
|
|
|
|
GList* cdsl;
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
|
1998-09-12 14:41:04 +00:00
|
|
|
if (!check_dir (dir_name, &sbuf, &stat_subdirs))
|
|
|
|
return NULL;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
cdsl = cmpl_state->directory_sent_storage;
|
|
|
|
|
|
|
|
while (cdsl)
|
|
|
|
{
|
|
|
|
sent = cdsl->data;
|
|
|
|
|
|
|
|
if(sent->inode == sbuf.st_ino &&
|
1998-04-07 23:59:25 +00:00
|
|
|
sent->mtime == sbuf.st_mtime &&
|
|
|
|
sent->device == sbuf.st_dev)
|
1997-11-24 22:37:52 +00:00
|
|
|
return attach_dir(sent, dir_name, cmpl_state);
|
|
|
|
|
|
|
|
cdsl = cdsl->next;
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
#else
|
|
|
|
stat_subdirs = TRUE;
|
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1998-09-12 14:41:04 +00:00
|
|
|
sent = open_new_dir(dir_name, &sbuf, stat_subdirs);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if (sent) {
|
|
|
|
cmpl_state->directory_sent_storage =
|
|
|
|
g_list_prepend(cmpl_state->directory_sent_storage, sent);
|
|
|
|
|
|
|
|
return attach_dir(sent, dir_name, cmpl_state);
|
|
|
|
}
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static CompletionDir*
|
|
|
|
attach_dir(CompletionDirSent* sent, gchar* dir_name, CompletionState *cmpl_state)
|
|
|
|
{
|
|
|
|
CompletionDir* new_dir;
|
|
|
|
|
|
|
|
new_dir = g_new(CompletionDir, 1);
|
|
|
|
|
|
|
|
cmpl_state->directory_storage =
|
|
|
|
g_list_prepend(cmpl_state->directory_storage, new_dir);
|
|
|
|
|
|
|
|
new_dir->sent = sent;
|
|
|
|
new_dir->fullname = g_strdup(dir_name);
|
|
|
|
new_dir->fullname_len = strlen(dir_name);
|
|
|
|
|
|
|
|
return new_dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
correct_dir_fullname(CompletionDir* cmpl_dir)
|
|
|
|
{
|
|
|
|
gint length = strlen(cmpl_dir->fullname);
|
1999-03-13 01:14:19 +00:00
|
|
|
gchar *first_slash = strchr(cmpl_dir->fullname, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
struct stat sbuf;
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
/* Does it end with /. (\.) ? */
|
|
|
|
if (length >= 2 &&
|
|
|
|
strcmp(cmpl_dir->fullname + length - 2, G_DIR_SEPARATOR_S ".") == 0)
|
1998-01-11 04:03:32 +00:00
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
/* Is it just the root directory (on a drive) ? */
|
|
|
|
if (cmpl_dir->fullname + length - 2 == first_slash)
|
1998-01-11 04:03:32 +00:00
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
cmpl_dir->fullname[length - 1] = 0;
|
|
|
|
cmpl_dir->fullname_len = length - 1;
|
1998-01-11 04:03:32 +00:00
|
|
|
return TRUE;
|
1999-03-13 01:14:19 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
1998-01-11 04:03:32 +00:00
|
|
|
cmpl_dir->fullname[length - 2] = 0;
|
|
|
|
}
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
|
|
|
|
/* Ends with /./ (\.\)? */
|
|
|
|
else if (length >= 3 &&
|
|
|
|
strcmp(cmpl_dir->fullname + length - 3,
|
|
|
|
G_DIR_SEPARATOR_S "." G_DIR_SEPARATOR_S) == 0)
|
1998-01-11 04:03:32 +00:00
|
|
|
cmpl_dir->fullname[length - 2] = 0;
|
1999-03-13 01:14:19 +00:00
|
|
|
|
|
|
|
/* Ends with /.. (\..) ? */
|
|
|
|
else if (length >= 3 &&
|
|
|
|
strcmp(cmpl_dir->fullname + length - 3,
|
|
|
|
G_DIR_SEPARATOR_S "..") == 0)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
/* Is it just /.. (X:\..)? */
|
|
|
|
if(cmpl_dir->fullname + length - 3 == first_slash)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
cmpl_dir->fullname[length - 2] = 0;
|
|
|
|
cmpl_dir->fullname_len = length - 2;
|
1997-11-24 22:37:52 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(stat(cmpl_dir->fullname, &sbuf) < 0)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
cmpl_dir->fullname[length - 3] = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if(!correct_parent(cmpl_dir, &sbuf))
|
|
|
|
return FALSE;
|
|
|
|
}
|
1999-03-13 01:14:19 +00:00
|
|
|
|
|
|
|
/* Ends with /../ (\..\)? */
|
|
|
|
else if (length >= 4 &&
|
|
|
|
strcmp(cmpl_dir->fullname + length - 4,
|
|
|
|
G_DIR_SEPARATOR_S ".." G_DIR_SEPARATOR_S) == 0)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
/* Is it just /../ (X:\..\)? */
|
|
|
|
if(cmpl_dir->fullname + length - 4 == first_slash)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
cmpl_dir->fullname[length - 3] = 0;
|
|
|
|
cmpl_dir->fullname_len = length - 3;
|
1997-11-24 22:37:52 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(stat(cmpl_dir->fullname, &sbuf) < 0)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
cmpl_dir->fullname[length - 4] = 0;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if(!correct_parent(cmpl_dir, &sbuf))
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
cmpl_dir->fullname_len = strlen(cmpl_dir->fullname);
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
correct_parent(CompletionDir* cmpl_dir, struct stat *sbuf)
|
|
|
|
{
|
|
|
|
struct stat parbuf;
|
|
|
|
gchar *last_slash;
|
1999-03-13 01:14:19 +00:00
|
|
|
gchar *first_slash;
|
1997-11-24 22:37:52 +00:00
|
|
|
gchar *new_name;
|
|
|
|
gchar c = 0;
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
last_slash = strrchr(cmpl_dir->fullname, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
g_assert(last_slash);
|
1999-03-13 01:14:19 +00:00
|
|
|
first_slash = strchr(cmpl_dir->fullname, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
/* Clever (?) way to check for top-level directory that works also on
|
|
|
|
* Win32, where there is a drive letter and colon prefixed...
|
|
|
|
*/
|
|
|
|
if (last_slash != first_slash)
|
|
|
|
{
|
|
|
|
last_slash[0] = 0;
|
|
|
|
}
|
1997-11-24 22:37:52 +00:00
|
|
|
else
|
|
|
|
{
|
|
|
|
c = last_slash[1];
|
|
|
|
last_slash[1] = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (stat(cmpl_dir->fullname, &parbuf) < 0)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
1999-03-13 01:14:19 +00:00
|
|
|
if (!c)
|
|
|
|
last_slash[0] = G_DIR_SEPARATOR;
|
1997-11-24 22:37:52 +00:00
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
1999-10-04 19:03:05 +00:00
|
|
|
#ifndef G_OS_WIN32 /* No inode numbers on Win32 */
|
1997-11-24 22:37:52 +00:00
|
|
|
if (parbuf.st_ino == sbuf->st_ino && parbuf.st_dev == sbuf->st_dev)
|
|
|
|
/* it wasn't a link */
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
if(c)
|
|
|
|
last_slash[1] = c;
|
1999-03-13 01:14:19 +00:00
|
|
|
else
|
|
|
|
last_slash[0] = G_DIR_SEPARATOR;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
/* it was a link, have to figure it out the hard way */
|
|
|
|
|
|
|
|
new_name = find_parent_dir_fullname(cmpl_dir->fullname);
|
|
|
|
|
|
|
|
if (!new_name)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
g_free(cmpl_dir->fullname);
|
|
|
|
|
|
|
|
cmpl_dir->fullname = new_name;
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
1999-10-04 19:03:05 +00:00
|
|
|
#ifndef G_OS_WIN32
|
1999-03-13 01:14:19 +00:00
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static gchar*
|
|
|
|
find_parent_dir_fullname(gchar* dirname)
|
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
gchar *orig_dir;
|
|
|
|
gchar *result;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
orig_dir = g_get_current_dir ();
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if(chdir(dirname) != 0 || chdir("..") != 0)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
result = g_get_current_dir ();
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
if(chdir(orig_dir) != 0)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
g_free (orig_dir);
|
|
|
|
return result;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/**********************************************************************/
|
|
|
|
/* Completion Operations */
|
|
|
|
/**********************************************************************/
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static PossibleCompletion*
|
|
|
|
attempt_homedir_completion(gchar* text_to_complete,
|
|
|
|
CompletionState *cmpl_state)
|
|
|
|
{
|
|
|
|
gint index, length;
|
|
|
|
|
|
|
|
if (!cmpl_state->user_dir_name_buffer &&
|
|
|
|
!get_pwdb(cmpl_state))
|
|
|
|
return NULL;
|
|
|
|
length = strlen(text_to_complete) - 1;
|
|
|
|
|
|
|
|
cmpl_state->user_completion_index += 1;
|
|
|
|
|
|
|
|
while(cmpl_state->user_completion_index < cmpl_state->user_directories_len)
|
|
|
|
{
|
|
|
|
index = first_diff_index(text_to_complete + 1,
|
|
|
|
cmpl_state->user_directories
|
|
|
|
[cmpl_state->user_completion_index].login);
|
|
|
|
|
|
|
|
switch(index)
|
|
|
|
{
|
|
|
|
case PATTERN_MATCH:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if(cmpl_state->last_valid_char < (index + 1))
|
|
|
|
cmpl_state->last_valid_char = index + 1;
|
|
|
|
cmpl_state->user_completion_index += 1;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
cmpl_state->the_completion.is_a_completion = 1;
|
2000-02-03 01:19:03 +00:00
|
|
|
cmpl_state->the_completion.is_directory = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
append_completion_text("~", cmpl_state);
|
|
|
|
|
|
|
|
append_completion_text(cmpl_state->
|
|
|
|
user_directories[cmpl_state->user_completion_index].login,
|
|
|
|
cmpl_state);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
return append_completion_text(G_DIR_SEPARATOR_S, cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(text_to_complete[1] ||
|
|
|
|
cmpl_state->user_completion_index > cmpl_state->user_directories_len)
|
|
|
|
{
|
|
|
|
cmpl_state->user_completion_index = -1;
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cmpl_state->user_completion_index += 1;
|
|
|
|
cmpl_state->the_completion.is_a_completion = 1;
|
2000-02-03 01:19:03 +00:00
|
|
|
cmpl_state->the_completion.is_directory = TRUE;
|
1997-11-24 22:37:52 +00:00
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
return append_completion_text("~" G_DIR_SEPARATOR_S, cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
|
1999-10-06 19:47:24 +00:00
|
|
|
#if defined(G_OS_WIN32) || defined(G_WITH_CYGWIN)
|
1999-03-13 01:14:19 +00:00
|
|
|
#define FOLD(c) (tolower(c))
|
|
|
|
#else
|
|
|
|
#define FOLD(c) (c)
|
|
|
|
#endif
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
/* returns the index (>= 0) of the first differing character,
|
|
|
|
* PATTERN_MATCH if the completion matches */
|
|
|
|
static gint
|
|
|
|
first_diff_index(gchar* pat, gchar* text)
|
|
|
|
{
|
|
|
|
gint diff = 0;
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
while(*pat && *text && FOLD(*text) == FOLD(*pat))
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
pat += 1;
|
|
|
|
text += 1;
|
|
|
|
diff += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(*pat)
|
|
|
|
return diff;
|
|
|
|
|
|
|
|
return PATTERN_MATCH;
|
|
|
|
}
|
|
|
|
|
|
|
|
static PossibleCompletion*
|
|
|
|
append_completion_text(gchar* text, CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
gint len, i = 1;
|
|
|
|
|
|
|
|
if(!cmpl_state->the_completion.text)
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
len = strlen(text) + strlen(cmpl_state->the_completion.text) + 1;
|
|
|
|
|
|
|
|
if(cmpl_state->the_completion.text_alloc > len)
|
|
|
|
{
|
|
|
|
strcat(cmpl_state->the_completion.text, text);
|
|
|
|
return &cmpl_state->the_completion;
|
|
|
|
}
|
|
|
|
|
|
|
|
while(i < len) { i <<= 1; }
|
|
|
|
|
|
|
|
cmpl_state->the_completion.text_alloc = i;
|
|
|
|
|
|
|
|
cmpl_state->the_completion.text = (gchar*)g_realloc(cmpl_state->the_completion.text, i);
|
|
|
|
|
|
|
|
if(!cmpl_state->the_completion.text)
|
|
|
|
return NULL;
|
|
|
|
else
|
|
|
|
{
|
|
|
|
strcat(cmpl_state->the_completion.text, text);
|
|
|
|
return &cmpl_state->the_completion;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static CompletionDir*
|
|
|
|
find_completion_dir(gchar* text_to_complete,
|
|
|
|
gchar** remaining_text,
|
|
|
|
CompletionState* cmpl_state)
|
|
|
|
{
|
1999-03-13 01:14:19 +00:00
|
|
|
gchar* first_slash = strchr(text_to_complete, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
CompletionDir* dir = cmpl_state->reference_dir;
|
1998-09-12 14:41:04 +00:00
|
|
|
CompletionDir* next;
|
1997-11-24 22:37:52 +00:00
|
|
|
*remaining_text = text_to_complete;
|
|
|
|
|
|
|
|
while(first_slash)
|
|
|
|
{
|
|
|
|
gint len = first_slash - *remaining_text;
|
|
|
|
gint found = 0;
|
1998-09-12 14:41:04 +00:00
|
|
|
gchar *found_name = NULL; /* Quiet gcc */
|
1997-11-24 22:37:52 +00:00
|
|
|
gint i;
|
|
|
|
gchar* pat_buf = g_new (gchar, len + 1);
|
|
|
|
|
|
|
|
strncpy(pat_buf, *remaining_text, len);
|
|
|
|
pat_buf[len] = 0;
|
|
|
|
|
|
|
|
for(i = 0; i < dir->sent->entry_count; i += 1)
|
|
|
|
{
|
|
|
|
if(dir->sent->entries[i].is_dir &&
|
|
|
|
fnmatch(pat_buf, dir->sent->entries[i].entry_name,
|
|
|
|
FNMATCH_FLAGS)!= FNM_NOMATCH)
|
|
|
|
{
|
|
|
|
if(found)
|
|
|
|
{
|
|
|
|
g_free (pat_buf);
|
|
|
|
return dir;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
found = 1;
|
1998-09-12 14:41:04 +00:00
|
|
|
found_name = dir->sent->entries[i].entry_name;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1998-09-12 14:41:04 +00:00
|
|
|
if (!found)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
1998-09-12 14:41:04 +00:00
|
|
|
/* Perhaps we are trying to open an automount directory */
|
|
|
|
found_name = pat_buf;
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
1998-09-12 14:41:04 +00:00
|
|
|
|
|
|
|
next = open_relative_dir(found_name, dir, cmpl_state);
|
|
|
|
|
|
|
|
if(!next)
|
1997-11-24 22:37:52 +00:00
|
|
|
{
|
|
|
|
g_free (pat_buf);
|
|
|
|
return NULL;
|
|
|
|
}
|
1998-09-12 14:41:04 +00:00
|
|
|
|
|
|
|
next->cmpl_parent = dir;
|
|
|
|
|
|
|
|
dir = next;
|
|
|
|
|
|
|
|
if(!correct_dir_fullname(dir))
|
|
|
|
{
|
|
|
|
g_free(pat_buf);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
*remaining_text = first_slash + 1;
|
1999-03-13 01:14:19 +00:00
|
|
|
first_slash = strchr(*remaining_text, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_free (pat_buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
return dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
update_cmpl(PossibleCompletion* poss, CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
gint cmpl_len;
|
|
|
|
|
|
|
|
if(!poss || !cmpl_is_a_completion(poss))
|
|
|
|
return;
|
|
|
|
|
|
|
|
cmpl_len = strlen(cmpl_this_completion(poss));
|
|
|
|
|
|
|
|
if(cmpl_state->updated_text_alloc < cmpl_len + 1)
|
|
|
|
{
|
|
|
|
cmpl_state->updated_text =
|
|
|
|
(gchar*)g_realloc(cmpl_state->updated_text,
|
|
|
|
cmpl_state->updated_text_alloc);
|
|
|
|
cmpl_state->updated_text_alloc = 2*cmpl_len;
|
|
|
|
}
|
|
|
|
|
|
|
|
if(cmpl_state->updated_text_len < 0)
|
|
|
|
{
|
|
|
|
strcpy(cmpl_state->updated_text, cmpl_this_completion(poss));
|
|
|
|
cmpl_state->updated_text_len = cmpl_len;
|
|
|
|
cmpl_state->re_complete = cmpl_is_directory(poss);
|
|
|
|
}
|
|
|
|
else if(cmpl_state->updated_text_len == 0)
|
|
|
|
{
|
|
|
|
cmpl_state->re_complete = FALSE;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gint first_diff =
|
|
|
|
first_diff_index(cmpl_state->updated_text,
|
|
|
|
cmpl_this_completion(poss));
|
|
|
|
|
|
|
|
cmpl_state->re_complete = FALSE;
|
|
|
|
|
|
|
|
if(first_diff == PATTERN_MATCH)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if(first_diff > cmpl_state->updated_text_len)
|
|
|
|
strcpy(cmpl_state->updated_text, cmpl_this_completion(poss));
|
|
|
|
|
|
|
|
cmpl_state->updated_text_len = first_diff;
|
|
|
|
cmpl_state->updated_text[first_diff] = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static PossibleCompletion*
|
|
|
|
attempt_file_completion(CompletionState *cmpl_state)
|
|
|
|
{
|
|
|
|
gchar *pat_buf, *first_slash;
|
|
|
|
CompletionDir *dir = cmpl_state->active_completion_dir;
|
|
|
|
|
|
|
|
dir->cmpl_index += 1;
|
|
|
|
|
|
|
|
if(dir->cmpl_index == dir->sent->entry_count)
|
|
|
|
{
|
|
|
|
if(dir->cmpl_parent == NULL)
|
|
|
|
{
|
|
|
|
cmpl_state->active_completion_dir = NULL;
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
cmpl_state->active_completion_dir = dir->cmpl_parent;
|
|
|
|
|
|
|
|
return attempt_file_completion(cmpl_state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
g_assert(dir->cmpl_text);
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
first_slash = strchr(dir->cmpl_text, G_DIR_SEPARATOR);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
if(first_slash)
|
|
|
|
{
|
|
|
|
gint len = first_slash - dir->cmpl_text;
|
|
|
|
|
|
|
|
pat_buf = g_new (gchar, len + 1);
|
|
|
|
strncpy(pat_buf, dir->cmpl_text, len);
|
|
|
|
pat_buf[len] = 0;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
gint len = strlen(dir->cmpl_text);
|
|
|
|
|
|
|
|
pat_buf = g_new (gchar, len + 2);
|
|
|
|
strcpy(pat_buf, dir->cmpl_text);
|
1999-03-13 01:24:10 +00:00
|
|
|
/* Don't append a * if the user entered one herself.
|
|
|
|
* This way one can complete *.h and don't get matches
|
|
|
|
* on any .help files, for instance.
|
|
|
|
*/
|
|
|
|
if (strchr(pat_buf, '*') == NULL)
|
|
|
|
strcpy(pat_buf + len, "*");
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(first_slash)
|
|
|
|
{
|
|
|
|
if(dir->sent->entries[dir->cmpl_index].is_dir)
|
|
|
|
{
|
|
|
|
if(fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name,
|
|
|
|
FNMATCH_FLAGS) != FNM_NOMATCH)
|
|
|
|
{
|
|
|
|
CompletionDir* new_dir;
|
|
|
|
|
|
|
|
new_dir = open_relative_dir(dir->sent->entries[dir->cmpl_index].entry_name,
|
|
|
|
dir, cmpl_state);
|
|
|
|
|
|
|
|
if(!new_dir)
|
|
|
|
{
|
|
|
|
g_free (pat_buf);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
new_dir->cmpl_parent = dir;
|
|
|
|
|
|
|
|
new_dir->cmpl_index = -1;
|
|
|
|
new_dir->cmpl_text = first_slash + 1;
|
|
|
|
|
|
|
|
cmpl_state->active_completion_dir = new_dir;
|
|
|
|
|
|
|
|
g_free (pat_buf);
|
|
|
|
return attempt_file_completion(cmpl_state);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_free (pat_buf);
|
|
|
|
return attempt_file_completion(cmpl_state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
g_free (pat_buf);
|
|
|
|
return attempt_file_completion(cmpl_state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if(dir->cmpl_parent != NULL)
|
|
|
|
{
|
|
|
|
append_completion_text(dir->fullname +
|
|
|
|
strlen(cmpl_state->completion_dir->fullname) + 1,
|
|
|
|
cmpl_state);
|
1999-03-13 01:14:19 +00:00
|
|
|
append_completion_text(G_DIR_SEPARATOR_S, cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
append_completion_text(dir->sent->entries[dir->cmpl_index].entry_name, cmpl_state);
|
|
|
|
|
|
|
|
cmpl_state->the_completion.is_a_completion =
|
|
|
|
(fnmatch(pat_buf, dir->sent->entries[dir->cmpl_index].entry_name,
|
|
|
|
FNMATCH_FLAGS) != FNM_NOMATCH);
|
|
|
|
|
|
|
|
cmpl_state->the_completion.is_directory = dir->sent->entries[dir->cmpl_index].is_dir;
|
|
|
|
if(dir->sent->entries[dir->cmpl_index].is_dir)
|
1999-03-13 01:14:19 +00:00
|
|
|
append_completion_text(G_DIR_SEPARATOR_S, cmpl_state);
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
g_free (pat_buf);
|
|
|
|
return &cmpl_state->the_completion;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#ifdef HAVE_PWD_H
|
1997-11-24 22:37:52 +00:00
|
|
|
|
|
|
|
static gint
|
|
|
|
get_pwdb(CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
struct passwd *pwd_ptr;
|
1998-03-24 05:27:00 +00:00
|
|
|
gchar* buf_ptr;
|
1997-11-24 22:37:52 +00:00
|
|
|
gint len = 0, i, count = 0;
|
|
|
|
|
|
|
|
if(cmpl_state->user_dir_name_buffer)
|
|
|
|
return TRUE;
|
|
|
|
setpwent ();
|
|
|
|
|
|
|
|
while ((pwd_ptr = getpwent()) != NULL)
|
|
|
|
{
|
|
|
|
len += strlen(pwd_ptr->pw_name);
|
|
|
|
len += strlen(pwd_ptr->pw_dir);
|
|
|
|
len += 2;
|
|
|
|
count += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
setpwent ();
|
|
|
|
|
|
|
|
cmpl_state->user_dir_name_buffer = g_new(gchar, len);
|
|
|
|
cmpl_state->user_directories = g_new(CompletionUserDir, count);
|
|
|
|
cmpl_state->user_directories_len = count;
|
|
|
|
|
|
|
|
buf_ptr = cmpl_state->user_dir_name_buffer;
|
|
|
|
|
|
|
|
for(i = 0; i < count; i += 1)
|
|
|
|
{
|
|
|
|
pwd_ptr = getpwent();
|
|
|
|
if(!pwd_ptr)
|
|
|
|
{
|
|
|
|
cmpl_errno = errno;
|
|
|
|
goto error;
|
|
|
|
}
|
|
|
|
|
|
|
|
strcpy(buf_ptr, pwd_ptr->pw_name);
|
|
|
|
cmpl_state->user_directories[i].login = buf_ptr;
|
|
|
|
buf_ptr += strlen(buf_ptr);
|
|
|
|
buf_ptr += 1;
|
|
|
|
strcpy(buf_ptr, pwd_ptr->pw_dir);
|
|
|
|
cmpl_state->user_directories[i].homedir = buf_ptr;
|
|
|
|
buf_ptr += strlen(buf_ptr);
|
|
|
|
buf_ptr += 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
qsort(cmpl_state->user_directories,
|
|
|
|
cmpl_state->user_directories_len,
|
|
|
|
sizeof(CompletionUserDir),
|
|
|
|
compare_user_dir);
|
|
|
|
|
|
|
|
endpwent();
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
error:
|
|
|
|
|
|
|
|
if(cmpl_state->user_dir_name_buffer)
|
|
|
|
g_free(cmpl_state->user_dir_name_buffer);
|
|
|
|
if(cmpl_state->user_directories)
|
|
|
|
g_free(cmpl_state->user_directories);
|
|
|
|
|
|
|
|
cmpl_state->user_dir_name_buffer = NULL;
|
|
|
|
cmpl_state->user_directories = NULL;
|
|
|
|
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
compare_user_dir(const void* a, const void* b)
|
|
|
|
{
|
|
|
|
return strcmp((((CompletionUserDir*)a))->login,
|
|
|
|
(((CompletionUserDir*)b))->login);
|
|
|
|
}
|
|
|
|
|
1999-03-13 01:14:19 +00:00
|
|
|
#endif
|
|
|
|
|
1997-11-24 22:37:52 +00:00
|
|
|
static gint
|
|
|
|
compare_cmpl_dir(const void* a, const void* b)
|
|
|
|
{
|
1999-10-06 19:47:24 +00:00
|
|
|
#if !defined(G_OS_WIN32) && !defined(G_WITH_CYGWIN)
|
1997-11-24 22:37:52 +00:00
|
|
|
return strcmp((((CompletionDirEntry*)a))->entry_name,
|
|
|
|
(((CompletionDirEntry*)b))->entry_name);
|
1999-03-13 01:14:19 +00:00
|
|
|
#else
|
|
|
|
return g_strcasecmp((((CompletionDirEntry*)a))->entry_name,
|
|
|
|
(((CompletionDirEntry*)b))->entry_name);
|
|
|
|
#endif
|
1997-11-24 22:37:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static gint
|
|
|
|
cmpl_state_okay(CompletionState* cmpl_state)
|
|
|
|
{
|
|
|
|
return cmpl_state && cmpl_state->reference_dir;
|
|
|
|
}
|
|
|
|
|
|
|
|
static gchar*
|
|
|
|
cmpl_strerror(gint err)
|
|
|
|
{
|
|
|
|
if(err == CMPL_ERRNO_TOO_LONG)
|
|
|
|
return "Name too long";
|
|
|
|
else
|
|
|
|
return g_strerror (err);
|
|
|
|
}
|