Mercurial > emacs
comparison src/gtkutil.c @ 83544:58cf725f5330
Merged from emacs@sv.gnu.org.
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-474
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-475
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-476
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-477
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-478
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-150
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-151
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-152
Update from CVS
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-584
author | Karoly Lorentey <lorentey@elte.hu> |
---|---|
date | Sun, 03 Dec 2006 12:15:03 +0000 |
parents | 2d56e13fd23d 7b5c0104efb0 |
children | c71725faff1a |
comparison
equal
deleted
inserted
replaced
83543:6b25ef5cc276 | 83544:58cf725f5330 |
---|---|
521 gsize bytes_written; | 521 gsize bytes_written; |
522 unsigned char *p = (unsigned char *)str; | 522 unsigned char *p = (unsigned char *)str; |
523 char *cp, *up; | 523 char *cp, *up; |
524 GError *error = NULL; | 524 GError *error = NULL; |
525 | 525 |
526 while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read, | 526 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read, |
527 &bytes_written, &error)) | 527 &bytes_written, &error)) |
528 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) | 528 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) |
529 { | 529 { |
530 ++nr_bad; | 530 ++nr_bad; |
531 p += bytes_written+1; | 531 p += bytes_written+1; |
532 g_error_free (error); | 532 g_error_free (error); |
539 error = NULL; | 539 error = NULL; |
540 } | 540 } |
541 if (cp) g_free (cp); | 541 if (cp) g_free (cp); |
542 | 542 |
543 up = utf8_str = xmalloc (strlen (str) + nr_bad * 4 + 1); | 543 up = utf8_str = xmalloc (strlen (str) + nr_bad * 4 + 1); |
544 p = str; | 544 p = (unsigned char *)str; |
545 | 545 |
546 while (! (cp = g_locale_to_utf8 (p, -1, &bytes_read, | 546 while (! (cp = g_locale_to_utf8 ((char *)p, -1, &bytes_read, |
547 &bytes_written, &error)) | 547 &bytes_written, &error)) |
548 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) | 548 && error->code == G_CONVERT_ERROR_ILLEGAL_SEQUENCE) |
549 { | 549 { |
550 strncpy (up, p, bytes_written); | 550 strncpy (up, (char *)p, bytes_written); |
551 sprintf (up + bytes_written, "\\%03o", p[bytes_written]); | 551 sprintf (up + bytes_written, "\\%03o", p[bytes_written]); |
552 up[bytes_written+4] = '\0'; | 552 up[bytes_written+4] = '\0'; |
553 up += bytes_written+4; | 553 up += bytes_written+4; |
554 p += bytes_written+1; | 554 p += bytes_written+1; |
555 g_error_free (error); | 555 g_error_free (error); |
3360 xg_tool_bar_button_cb (widget, event, user_data) | 3360 xg_tool_bar_button_cb (widget, event, user_data) |
3361 GtkWidget *widget; | 3361 GtkWidget *widget; |
3362 GdkEventButton *event; | 3362 GdkEventButton *event; |
3363 gpointer user_data; | 3363 gpointer user_data; |
3364 { | 3364 { |
3365 g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, | 3365 /* Casts to avoid warnings when gpointer is 64 bits and int is 32 bits */ |
3366 (gpointer) event->state); | 3366 gpointer ptr = (gpointer) (EMACS_INT) event->state; |
3367 g_object_set_data (G_OBJECT (user_data), XG_TOOL_BAR_LAST_MODIFIER, ptr); | |
3367 return FALSE; | 3368 return FALSE; |
3368 } | 3369 } |
3369 | 3370 |
3370 | 3371 |
3371 static void | 3372 static void |
3373 GtkWidget *w; | 3374 GtkWidget *w; |
3374 gpointer client_data; | 3375 gpointer client_data; |
3375 { | 3376 { |
3376 /* The EMACS_INT cast avoids a warning. */ | 3377 /* The EMACS_INT cast avoids a warning. */ |
3377 int idx = (int) (EMACS_INT) client_data; | 3378 int idx = (int) (EMACS_INT) client_data; |
3378 int mod = (int) g_object_get_data (G_OBJECT (w), XG_TOOL_BAR_LAST_MODIFIER); | 3379 int mod = (int) (EMACS_INT) g_object_get_data (G_OBJECT (w), |
3380 XG_TOOL_BAR_LAST_MODIFIER); | |
3379 | 3381 |
3380 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); | 3382 FRAME_PTR f = (FRAME_PTR) g_object_get_data (G_OBJECT (w), XG_FRAME_DATA); |
3381 Lisp_Object key, frame; | 3383 Lisp_Object key, frame; |
3382 struct input_event event; | 3384 struct input_event event; |
3383 EVENT_INIT (event); | 3385 EVENT_INIT (event); |