Commit b17f1a96 authored by Robert Brady's avatar Robert Brady Committed by Robert Brady

g_filename_{to,from}_utf8 now takes an extra parameter.

Sun Nov 12 22:15:35 2000  Robert Brady  <robert@suse.co.uk>

	* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
	g_filename_{to,from}_utf8 now takes an extra parameter.

	* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
	strftime into UTF-8.

	(column_from_x, gtk_calendar_paint_day_names): Support RTL
	calendars.

	(gtk_calendar_paint_day_names): Draw day names in the right
	place.
parent 2cb2d33b
Sun Nov 12 22:15:35 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
g_filename_{to,from}_utf8 now takes an extra parameter.
* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
strftime into UTF-8.
(column_from_x, gtk_calendar_paint_day_names): Support RTL
calendars.
(gtk_calendar_paint_day_names): Draw day names in the right
place.
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
......
Sun Nov 12 22:15:35 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
g_filename_{to,from}_utf8 now takes an extra parameter.
* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
strftime into UTF-8.
(column_from_x, gtk_calendar_paint_day_names): Support RTL
calendars.
(gtk_calendar_paint_day_names): Draw day names in the right
place.
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
......
Sun Nov 12 22:15:35 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
g_filename_{to,from}_utf8 now takes an extra parameter.
* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
strftime into UTF-8.
(column_from_x, gtk_calendar_paint_day_names): Support RTL
calendars.
(gtk_calendar_paint_day_names): Draw day names in the right
place.
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
......
Sun Nov 12 22:15:35 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
g_filename_{to,from}_utf8 now takes an extra parameter.
* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
strftime into UTF-8.
(column_from_x, gtk_calendar_paint_day_names): Support RTL
calendars.
(gtk_calendar_paint_day_names): Draw day names in the right
place.
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
......
Sun Nov 12 22:15:35 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
g_filename_{to,from}_utf8 now takes an extra parameter.
* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
strftime into UTF-8.
(column_from_x, gtk_calendar_paint_day_names): Support RTL
calendars.
(gtk_calendar_paint_day_names): Draw day names in the right
place.
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
......
Sun Nov 12 22:15:35 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
g_filename_{to,from}_utf8 now takes an extra parameter.
* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
strftime into UTF-8.
(column_from_x, gtk_calendar_paint_day_names): Support RTL
calendars.
(gtk_calendar_paint_day_names): Draw day names in the right
place.
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
......
Sun Nov 12 22:15:35 2000 Robert Brady <robert@suse.co.uk>
* gtk/gtkfileselection.c, gdk/win32/gdkfont-win32.c:
g_filename_{to,from}_utf8 now takes an extra parameter.
* gtk/gtkcalendar.c (gtk_calendar_init): Convert output of
strftime into UTF-8.
(column_from_x, gtk_calendar_paint_day_names): Support RTL
calendars.
(gtk_calendar_paint_day_names): Draw day names in the right
place.
Sun Nov 12 14:10:09 2000 Owen Taylor <otaylor@redhat.com>
* gdk/x11/gdkselection-x11.c (gdk_utf8_to_compound_text): Fix
......
......@@ -224,7 +224,7 @@ logfont_to_xlfd (const LOGFONT *lfp,
/* Convert the facename Windows fives us from the locale-dependent
* codepage to UTF-8.
*/
utf8_facename = g_filename_to_utf8 (lfp->lfFaceName);
utf8_facename = g_filename_to_utf8 (lfp->lfFaceName, NULL);
/* Replace characters illegal in an XLFD with hex escapes. */
p = facename;
......@@ -1284,7 +1284,7 @@ gdk_font_load_internal (const gchar *font_name)
logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
logfont.lfQuality = PROOF_QUALITY;
logfont.lfPitchAndFamily = DEFAULT_PITCH;
fn = g_filename_from_utf8 (font_name);
fn = g_filename_from_utf8 (font_name, NULL);
strcpy (logfont.lfFaceName, fn);
g_free (fn);
}
......@@ -1473,7 +1473,7 @@ gdk_font_load_internal (const gchar *font_name)
logfont.lfPitchAndFamily = VARIABLE_PITCH;
else
logfont.lfPitchAndFamily = DEFAULT_PITCH;
fn = g_filename_from_utf8 (family);
fn = g_filename_from_utf8 (family, NULL);
strcpy (logfont.lfFaceName, fn);
g_free (fn);
}
......
......@@ -440,7 +440,7 @@ gtk_calendar_init (GtkCalendar *calendar)
{
tmp_time= (i+3)*86400;
strftime ( buffer, sizeof (buffer), "%a", gmtime (&tmp_time));
default_abbreviated_dayname[i] = g_strdup (buffer);
default_abbreviated_dayname[i] = g_locale_to_utf8 (buffer, NULL);
}
if (!default_monthname[0])
......@@ -448,7 +448,7 @@ gtk_calendar_init (GtkCalendar *calendar)
{
tmp_time=i*2764800;
strftime ( buffer, sizeof (buffer), "%B", gmtime (&tmp_time));
default_monthname[i] = g_strdup (buffer);
default_monthname[i] = g_locale_to_utf8 (buffer, NULL);
}
/* Set defaults */
......@@ -570,6 +570,9 @@ left_x_for_column (GtkCalendar *calendar,
gint width;
gint x_left;
if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
column = 6 - column;
width = GTK_CALENDAR_PRIVATE_DATA (calendar)->day_width;
if (calendar->display_flags & GTK_CALENDAR_SHOW_WEEK_NUMBERS)
x_left = DAY_XSEP + (width + DAY_XSEP) * column;
......@@ -1671,7 +1674,10 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
gdk_gc_set_foreground (gc, &widget->style->fg[GTK_STATE_SELECTED]);
for (i = 0; i < 7; i++)
{
day=i;
if (gtk_widget_get_direction (GTK_WIDGET (calendar)) == GTK_TEXT_DIR_RTL)
day = 6 - i;
else
day = i;
if (calendar->display_flags & GTK_CALENDAR_WEEK_START_MONDAY)
day= (day+1)%7;
sprintf (buffer, "%s", default_abbreviated_dayname[day]);
......@@ -1684,7 +1690,7 @@ gtk_calendar_paint_day_names (GtkWidget *widget)
+ day_wid_sep * i
+ private_data->week_width
+ (day_width - logical_rect.width)/2),
CALENDAR_MARGIN + DAY_YPAD + private_data->max_label_char_ascent + logical_rect.y,
CALENDAR_MARGIN + DAY_YPAD + logical_rect.y,
layout);
}
......
......@@ -739,7 +739,7 @@ gtk_file_selection_get_filename (GtkFileSelection *filesel)
text = gtk_entry_get_text (GTK_ENTRY (filesel->selection_entry));
if (text)
{
sys_filename = g_filename_from_utf8 (cmpl_completion_fullname (text, filesel->cmpl_state));
sys_filename = g_filename_from_utf8 (cmpl_completion_fullname (text, filesel->cmpl_state), NULL);
strncpy (something, sys_filename, sizeof (something));
g_free (sys_filename);
return something;
......@@ -890,7 +890,7 @@ gtk_file_selection_create_dir_confirmed (GtkWidget *widget,
path = cmpl_reference_position (cmpl_state);
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, dirname, NULL);
sys_full_path = g_filename_from_utf8 (full_path);
sys_full_path = g_filename_from_utf8 (full_path, NULL);
if (mkdir (sys_full_path, 0755) < 0)
{
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);
full_path = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
sys_full_path = g_filename_from_utf8 (full_path);
sys_full_path = g_filename_from_utf8 (full_path, NULL);
if (unlink (sys_full_path) < 0)
{
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);
old_filename = g_strconcat (path, G_DIR_SEPARATOR_S, fs->fileop_file, NULL);
sys_new_filename = g_filename_from_utf8 (new_filename);
sys_old_filename = g_filename_from_utf8 (old_filename);
sys_new_filename = g_filename_from_utf8 (new_filename, NULL);
sys_old_filename = g_filename_from_utf8 (old_filename, NULL);
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 */
sys_getcwd_buf = g_get_current_dir ();
utf8_cwd = g_filename_to_utf8 (sys_getcwd_buf);
utf8_cwd = g_filename_to_utf8 (sys_getcwd_buf, NULL);
g_free (sys_getcwd_buf);
tryagain:
......@@ -2049,7 +2049,7 @@ open_ref_dir (gchar *text_to_complete,
{
/* If no possible candidates, use the cwd */
gchar *sys_curdir = g_get_current_dir ();
gchar *utf8_curdir = g_filename_to_utf8 (sys_curdir);
gchar *utf8_curdir = g_filename_to_utf8 (sys_curdir, NULL);
g_free (sys_curdir);
......@@ -2103,7 +2103,7 @@ open_user_dir (gchar *text_to_complete,
{
/* ~/ */
gchar *homedir = g_get_home_dir ();
gchar *utf8_homedir = g_filename_to_utf8 (homedir);
gchar *utf8_homedir = g_filename_to_utf8 (homedir, NULL);
g_free (homedir);
......@@ -2130,7 +2130,7 @@ open_user_dir (gchar *text_to_complete,
cmpl_errno = errno;
return NULL;
}
utf8_dir = g_filename_to_utf8 (pwd->pw_dir);
utf8_dir = g_filename_to_utf8 (pwd->pw_dir, NULL);
result = open_dir (utf8_dir, cmpl_state);
g_free (utf8_dir);
}
......@@ -2185,7 +2185,7 @@ open_new_dir (gchar *dir_name,
path = g_string_sized_new (2*MAXPATHLEN + 10);
sys_dir_name = g_filename_from_utf8 (dir_name);
sys_dir_name = g_filename_from_utf8 (dir_name, NULL);
directory = opendir (sys_dir_name);
if (!directory)
......@@ -2215,7 +2215,7 @@ open_new_dir (gchar *dir_name,
return NULL;
}
sent->entries[i].entry_name = g_filename_to_utf8 (dirent_ptr->d_name);
sent->entries[i].entry_name = g_filename_to_utf8 (dirent_ptr->d_name, NULL);
g_string_assign (path, sys_dir_name);
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);
sys_dir_name = g_filename_from_utf8 (dir_name, NULL);
if (stat (sys_dir_name, result) < 0)
{
g_free (sys_dir_name);
......@@ -2416,7 +2416,7 @@ correct_dir_fullname (CompletionDir* cmpl_dir)
return TRUE;
}
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname);
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, NULL);
if (stat (sys_filename, &sbuf) < 0)
{
g_free (sys_filename);
......@@ -2444,7 +2444,7 @@ correct_dir_fullname (CompletionDir* cmpl_dir)
return TRUE;
}
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname);
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, NULL);
if (stat (sys_filename, &sbuf) < 0)
{
g_free (sys_filename);
......@@ -2492,7 +2492,7 @@ correct_parent (CompletionDir *cmpl_dir,
last_slash[1] = 0;
}
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname);
sys_filename = g_filename_from_utf8 (cmpl_dir->fullname, NULL);
if (stat (sys_filename, &parbuf) < 0)
{
g_free (sys_filename);
......@@ -2539,7 +2539,7 @@ find_parent_dir_fullname (gchar* dirname)
gchar *sys_dirname;
sys_orig_dir = g_get_current_dir ();
sys_dirname = g_filename_from_utf8 (dirname);
sys_dirname = g_filename_from_utf8 (dirname, NULL);
if (chdir (sys_dirname) != 0 || chdir ("..") != 0)
{
g_free (sys_dirname);
......@@ -2550,7 +2550,7 @@ find_parent_dir_fullname (gchar* dirname)
g_free (sys_dirname);
sys_cwd = g_get_current_dir ();
result = g_filename_to_utf8 (sys_cwd);
result = g_filename_to_utf8 (sys_cwd, NULL);
g_free (sys_cwd);
if (chdir (sys_orig_dir) != 0)
......@@ -2944,10 +2944,10 @@ get_pwdb (CompletionState* cmpl_state)
while ((pwd_ptr = getpwent ()) != NULL)
{
utf8 = g_filename_to_utf8 (pwd_ptr->pw_name);
utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, NULL);
len += strlen (utf8);
g_free (utf8);
utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir);
utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, NULL);
len += strlen (utf8);
g_free (utf8);
len += 2;
......@@ -2971,7 +2971,7 @@ get_pwdb (CompletionState* cmpl_state)
goto error;
}
utf8 = g_filename_to_utf8 (pwd_ptr->pw_name);
utf8 = g_filename_to_utf8 (pwd_ptr->pw_name, NULL);
strcpy (buf_ptr, utf8);
g_free (utf8);
......@@ -2980,7 +2980,7 @@ get_pwdb (CompletionState* cmpl_state)
buf_ptr += strlen (buf_ptr);
buf_ptr += 1;
utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir);
utf8 = g_filename_to_utf8 (pwd_ptr->pw_dir, NULL);
strcpy (buf_ptr, utf8);
g_free (utf8);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment