Adopt to new prototypes for unicode,locale,filename conversion functions.

Fri Jan  5 16:16:29 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
	modules/input/gtkimcontextxim.c: Adopt to new prototypes
	for unicode,locale,filename conversion functions.
This commit is contained in:
Owen Taylor 2001-01-05 21:23:53 +00:00 committed by Owen Taylor
parent 1299c1df6f
commit eb2fdbb176
11 changed files with 68 additions and 26 deletions

View File

@ -1,3 +1,9 @@
Fri Jan 5 16:16:29 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
modules/input/gtkimcontextxim.c: Adopt to new prototypes
for unicode,locale,filename conversion functions.
2001-01-05 Havoc Pennington <hp@redhat.com> 2001-01-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was * gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was

View File

@ -1,3 +1,9 @@
Fri Jan 5 16:16:29 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
modules/input/gtkimcontextxim.c: Adopt to new prototypes
for unicode,locale,filename conversion functions.
2001-01-05 Havoc Pennington <hp@redhat.com> 2001-01-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was * gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was

View File

@ -1,3 +1,9 @@
Fri Jan 5 16:16:29 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
modules/input/gtkimcontextxim.c: Adopt to new prototypes
for unicode,locale,filename conversion functions.
2001-01-05 Havoc Pennington <hp@redhat.com> 2001-01-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was * gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was

View File

@ -1,3 +1,9 @@
Fri Jan 5 16:16:29 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
modules/input/gtkimcontextxim.c: Adopt to new prototypes
for unicode,locale,filename conversion functions.
2001-01-05 Havoc Pennington <hp@redhat.com> 2001-01-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was * gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was

View File

@ -1,3 +1,9 @@
Fri Jan 5 16:16:29 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
modules/input/gtkimcontextxim.c: Adopt to new prototypes
for unicode,locale,filename conversion functions.
2001-01-05 Havoc Pennington <hp@redhat.com> 2001-01-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was * gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was

View File

@ -1,3 +1,9 @@
Fri Jan 5 16:16:29 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
modules/input/gtkimcontextxim.c: Adopt to new prototypes
for unicode,locale,filename conversion functions.
2001-01-05 Havoc Pennington <hp@redhat.com> 2001-01-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was * gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was

View File

@ -1,3 +1,9 @@
Fri Jan 5 16:16:29 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkcalender.c,gtkfilesel.c,gtkimcontext.c},
modules/input/gtkimcontextxim.c: Adopt to new prototypes
for unicode,locale,filename conversion functions.
2001-01-05 Havoc Pennington <hp@redhat.com> 2001-01-05 Havoc Pennington <hp@redhat.com>
* gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was * gtk/gtktextiter.c (gtk_text_iter_ends_line): this function was

View File

@ -438,7 +438,7 @@ gtk_calendar_init (GtkCalendar *calendar)
{ {
tmp_time= (i+3)*86400; tmp_time= (i+3)*86400;
strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time)); strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, NULL); default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
} }
if (!default_monthname[0]) if (!default_monthname[0])
@ -446,7 +446,7 @@ gtk_calendar_init (GtkCalendar *calendar)
{ {
tmp_time=i*2764800; tmp_time=i*2764800;
strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time)); strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time));
default_monthname[i] = g_locale_to_utf8 (buffer, NULL); default_monthname[i] = g_locale_to_utf8 (buffer, -1, NULL, NULL, NULL);
} }
/* Set defaults */ /* Set defaults */

View File

@ -739,7 +739,7 @@ gtk_file_selection_get_filename (GtkFileSelection *filesel)
text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry)); text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry));
if (text) if (text)
{ {
sys_filename = g_filename_from_utf8 (cmpl_completion_fullname (text, filesel->cmpl_state), NULL); sys_filename = g_filename_from_utf8 (cmpl_completion_fullname (text, filesel->cmpl_state), -1, NULL, NULL, NULL);
strncpy (something, sys_filename, sizeof (something)); strncpy (something, sys_filename, sizeof (something));
g_free (sys_filename); g_free (sys_filename);
return something; return something;
@ -890,7 +890,7 @@ gtk_file_selection_create_dir_confirmed (GtkWidget *widget,
path = cmpl_reference_position (cmpl_state); path = cmpl_reference_position (cmpl_state);
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, dirname, NULL); full_path = g_strconcat (path, G_DIR_SEPARATOR_S, dirname, NULL);
sys_full_path = g_filename_from_utf8 (full_path, NULL); sys_full_path = g_filename_from_utf8 (full_path, -1, NULL, NULL, NULL);
if (mkdir (sys_full_path, 0755) < 0) if (mkdir (sys_full_path, 0755) < 0)
{ {
buf = g_strconcat ("Error creating directory \"", dirname, "\": ", buf = g_strconcat ("Error creating directory \"", dirname, "\": ",
@ -993,7 +993,7 @@ gtk_file_selection_delete_file_confirmed (GtkWidget *widget,
path = cmpl_reference_position (cmpl_state); path = cmpl_reference_position (cmpl_state);
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL); full_path = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
sys_full_path = g_filename_from_utf8 (full_path, NULL); sys_full_path = g_filename_from_utf8 (full_path, -1, NULL, NULL, NULL);
if (unlink (sys_full_path) < 0) if (unlink (sys_full_path) < 0)
{ {
buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ", buf = g_strconcat ("Error deleting file \"", fs->fileop_file, "\": ",
@ -1109,8 +1109,8 @@ gtk_file_selection_rename_file_confirmed (GtkWidget *widget,
new_filename = g_strconcat (path, G_DIR_SEPARATOR_S, file, NULL); new_filename = g_strconcat (path, G_DIR_SEPARATOR_S, file, NULL);
old_filename = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL); old_filename = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
sys_new_filename = g_filename_from_utf8 (new_filename, NULL); sys_new_filename = g_filename_from_utf8 (new_filename, -1, NULL, NULL, NULL);
sys_old_filename = g_filename_from_utf8 (old_filename, NULL); sys_old_filename = g_filename_from_utf8 (old_filename, -1, NULL, NULL, NULL);
if (rename (sys_old_filename, sys_new_filename) < 0) if (rename (sys_old_filename, sys_new_filename) < 0)
{ {
@ -1757,7 +1757,7 @@ cmpl_init_state (void)
/* g_get_current_dir() returns a string in the "system" charset */ /* g_get_current_dir() returns a string in the "system" charset */
sys_getcwd_buf = g_get_current_dir (); sys_getcwd_buf = g_get_current_dir ();
utf8_cwd = g_filename_to_utf8 (sys_getcwd_buf, NULL); utf8_cwd = g_filename_to_utf8 (sys_getcwd_buf, -1, NULL, NULL, NULL);
g_free (sys_getcwd_buf); g_free (sys_getcwd_buf);
tryagain: tryagain:
@ -2049,7 +2049,7 @@ open_ref_dir (gchar *text_to_complete,
{ {
/* If no possible candidates, use the cwd */ /* If no possible candidates, use the cwd */
gchar *sys_curdir = g_get_current_dir (); gchar *sys_curdir = g_get_current_dir ();
gchar *utf8_curdir = g_filename_to_utf8 (sys_curdir, NULL); gchar *utf8_curdir = g_filename_to_utf8 (sys_curdir, -1, NULL, NULL, NULL);
g_free (sys_curdir); g_free (sys_curdir);
@ -2103,7 +2103,7 @@ open_user_dir (gchar *text_to_complete,
{ {
/* ~/ */ /* ~/ */
gchar *homedir = g_get_home_dir (); gchar *homedir = g_get_home_dir ();
gchar *utf8_homedir = g_filename_to_utf8 (homedir, NULL); gchar *utf8_homedir = g_filename_to_utf8 (homedir, -1, NULL, NULL, NULL);
g_free (homedir); g_free (homedir);
@ -2130,7 +2130,7 @@ open_user_dir (gchar *text_to_complete,
cmpl_errno = errno; cmpl_errno = errno;
return NULL; return NULL;
} }
utf8_dir = g_filename_to_utf8 (pwd->pw_dir, NULL); utf8_dir = g_filename_to_utf8 (pwd->pw_dir, -1, NULL, NULL, NULL);
result = open_dir (utf8_dir, cmpl_state); result = open_dir (utf8_dir, cmpl_state);
g_free (utf8_dir); g_free (utf8_dir);
} }
@ -2185,7 +2185,7 @@ open_new_dir (gchar *dir_name,
path = g_string_sized_new (2*MAXPATHLEN + 10); path = g_string_sized_new (2*MAXPATHLEN + 10);
sys_dir_name = g_filename_from_utf8 (dir_name, NULL); sys_dir_name = g_filename_from_utf8 (dir_name, -1, NULL, NULL, NULL);
directory = opendir (sys_dir_name); directory = opendir (sys_dir_name);
if (!directory) if (!directory)
@ -2215,7 +2215,7 @@ open_new_dir (gchar *dir_name,
return NULL; return NULL;
} }
sent->entries[i].entry_name = g_filename_to_utf8 (dirent_ptr->d_name, NULL); sent->entries[i].entry_name = g_filename_to_utf8 (dirent_ptr->d_name, -1, NULL, NULL, NULL);
g_string_assign (path, sys_dir_name); g_string_assign (path, sys_dir_name);
if (path->str[path->len-1] != G_DIR_SEPARATOR) if (path->str[path->len-1] != G_DIR_SEPARATOR)
@ -2283,7 +2283,7 @@ check_dir (gchar *dir_name,
} }
} }
sys_dir_name = g_filename_from_utf8 (dir_name, NULL); sys_dir_name = g_filename_from_utf8 (dir_name, -1, NULL, NULL, NULL);
if (stat (sys_dir_name, result) < 0) if (stat (sys_dir_name, result) < 0)
{ {
g_free (sys_dir_name); g_free (sys_dir_name);
@ -2416,7 +2416,7 @@ correct_dir_fullname (CompletionDir* cmpl_dir)
return TRUE; return TRUE;
} }
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, NULL); sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, -1, NULL, NULL, NULL);
if (stat (sys_filename, &sbuf) < 0) if (stat (sys_filename, &sbuf) < 0)
{ {
g_free (sys_filename); g_free (sys_filename);
@ -2444,7 +2444,7 @@ correct_dir_fullname (CompletionDir* cmpl_dir)
return TRUE; return TRUE;
} }
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, NULL); sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, -1, NULL, NULL, NULL);
if (stat (sys_filename, &sbuf) < 0) if (stat (sys_filename, &sbuf) < 0)
{ {
g_free (sys_filename); g_free (sys_filename);
@ -2492,7 +2492,7 @@ correct_parent (CompletionDir *cmpl_dir,
last_slash[1] = 0; last_slash[1] = 0;
} }
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, NULL); sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, -1, NULL, NULL, NULL);
if (stat (sys_filename, &parbuf) < 0) if (stat (sys_filename, &parbuf) < 0)
{ {
g_free (sys_filename); g_free (sys_filename);
@ -2539,7 +2539,7 @@ find_parent_dir_fullname (gchar* dirname)
gchar *sys_dirname; gchar *sys_dirname;
sys_orig_dir = g_get_current_dir (); sys_orig_dir = g_get_current_dir ();
sys_dirname = g_filename_from_utf8 (dirname, NULL); sys_dirname = g_filename_from_utf8 (dirname, -1, NULL, NULL, NULL);
if (chdir (sys_dirname) != 0 || chdir ("..") != 0) if (chdir (sys_dirname) != 0 || chdir ("..") != 0)
{ {
g_free (sys_dirname); g_free (sys_dirname);
@ -2550,7 +2550,7 @@ find_parent_dir_fullname (gchar* dirname)
g_free (sys_dirname); g_free (sys_dirname);
sys_cwd = g_get_current_dir (); sys_cwd = g_get_current_dir ();
result = g_filename_to_utf8 (sys_cwd, NULL); result = g_filename_to_utf8 (sys_cwd, -1, NULL, NULL, NULL);
g_free (sys_cwd); g_free (sys_cwd);
if (chdir (sys_orig_dir) != 0) if (chdir (sys_orig_dir) != 0)
@ -2944,10 +2944,10 @@ get_pwdb (CompletionState* cmpl_state)
while ((pwd_ptr = getpwent ()) != NULL) while ((pwd_ptr = getpwent ()) != NULL)
{ {
utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, NULL); utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, -1, NULL, NULL, NULL);
len += strlen (utf8); len += strlen (utf8);
g_free (utf8); g_free (utf8);
utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, NULL); utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, -1, NULL, NULL, NULL);
len += strlen (utf8); len += strlen (utf8);
g_free (utf8); g_free (utf8);
len += 2; len += 2;
@ -2971,7 +2971,7 @@ get_pwdb (CompletionState* cmpl_state)
goto error; goto error;
} }
utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, NULL); utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, -1, NULL, NULL, NULL);
strcpy (buf_ptr, utf8); strcpy (buf_ptr, utf8);
g_free (utf8); g_free (utf8);
@ -2980,7 +2980,7 @@ get_pwdb (CompletionState* cmpl_state)
buf_ptr += strlen (buf_ptr); buf_ptr += strlen (buf_ptr);
buf_ptr += 1; buf_ptr += 1;
utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, NULL); utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, -1, NULL, NULL, NULL);
strcpy (buf_ptr, utf8); strcpy (buf_ptr, utf8);
g_free (utf8); g_free (utf8);

View File

@ -189,7 +189,7 @@ gtk_im_context_get_preedit_string (GtkIMContext *context,
klass = GTK_IM_CONTEXT_GET_CLASS (context); klass = GTK_IM_CONTEXT_GET_CLASS (context);
klass->get_preedit_string (context, str, attrs, cursor_pos); klass->get_preedit_string (context, str, attrs, cursor_pos);
g_return_if_fail (str == NULL || g_utf8_validate (*str, -1, NULL)); g_return_if_fail (str == NULL || g_utf8_validate (*str, -1, NULL));
} }
/** /**

View File

@ -499,7 +499,7 @@ gtk_im_context_xim_get_preedit_string (GtkIMContext *context,
gint *cursor_pos) gint *cursor_pos)
{ {
GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context); GtkIMContextXIM *context_xim = GTK_IM_CONTEXT_XIM (context);
gchar *utf8 = g_ucs4_to_utf8 (context_xim->preedit_chars, context_xim->preedit_length); gchar *utf8 = g_ucs4_to_utf8 (context_xim->preedit_chars, context_xim->preedit_length, NULL, NULL, NULL);
if (attrs) if (attrs)
{ {
@ -631,7 +631,7 @@ preedit_draw_callback (XIC xic,
new_text_length = xim_text_to_utf8 (context, new_xim_text, &tmp); new_text_length = xim_text_to_utf8 (context, new_xim_text, &tmp);
if (tmp) if (tmp)
{ {
new_text = g_utf8_to_ucs4 (tmp, -1); new_text = g_utf8_to_ucs4_fast (tmp, -1, NULL);
g_free (tmp); g_free (tmp);
} }