Mercurial > pidgin.yaz
comparison pidgin/gtkimhtml.c @ 25478:f444605c27b6
propagate from branch 'im.pidgin.pidgin' (head a78e36058a13ec01e5cb75f8badbf2585519b0e0)
to branch 'im.pidgin.pidgin.yaz' (head e7f401ccaaa979509d744d1fba49075a9b5f0676)
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Thu, 03 May 2007 10:14:49 +0000 |
parents | be098f796b32 |
children | 48ef40b32eb7 |
comparison
equal
deleted
inserted
replaced
16818:f7466b0379e8 | 25478:f444605c27b6 |
---|---|
93 GdkDragContext *context, | 93 GdkDragContext *context, |
94 gint x, | 94 gint x, |
95 gint y, | 95 gint y, |
96 guint time); | 96 guint time); |
97 | 97 |
98 /* yaz. If you want to use shortcut keys that may conflict with | |
99 inputmethods, change this to 1. */ | |
100 #define ENABLE_SHORTCUT 0 | |
101 | |
98 static void preinsert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml); | 102 static void preinsert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml); |
99 static void insert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml); | 103 static void insert_cb(GtkTextBuffer *buffer, GtkTextIter *iter, gchar *text, gint len, GtkIMHtml *imhtml); |
100 static void delete_cb(GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextIter *end, GtkIMHtml *imhtml); | 104 static void delete_cb(GtkTextBuffer *buffer, GtkTextIter *iter, GtkTextIter *end, GtkIMHtml *imhtml); |
101 static void insert_ca_cb(GtkTextBuffer *buffer, GtkTextIter *arg1, GtkTextChildAnchor *arg2, gpointer user_data); | 105 static void insert_ca_cb(GtkTextBuffer *buffer, GtkTextIter *arg1, GtkTextChildAnchor *arg2, gpointer user_data); |
102 static void gtk_imhtml_apply_tags_on_insert(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *end); | 106 static void gtk_imhtml_apply_tags_on_insert(GtkIMHtml *imhtml, GtkTextIter *start, GtkTextIter *end); |
400 } | 404 } |
401 | 405 |
402 static gint | 406 static gint |
403 gtk_imhtml_tip (gpointer data) | 407 gtk_imhtml_tip (gpointer data) |
404 { | 408 { |
405 GtkIMHtml *imhtml = data; | 409 GtkIMHtml *imhtml = (GtkIMHtml *)data; |
406 PangoFontMetrics *font_metrics; | 410 PangoFontMetrics *font_metrics; |
407 PangoLayout *layout; | 411 PangoLayout *layout; |
408 PangoFont *font; | 412 PangoFont *font; |
413 PangoLanguage *lang; | |
409 | 414 |
410 gint gap, x, y, h, w, scr_w, baseline_skip; | 415 gint gap, x, y, h, w, scr_w, baseline_skip; |
411 | 416 |
412 g_return_val_if_fail(GTK_IS_IMHTML(imhtml), FALSE); | 417 g_return_val_if_fail(GTK_IS_IMHTML(imhtml), FALSE); |
413 | 418 |
444 g_free(tmp); | 449 g_free(tmp); |
445 | 450 |
446 return FALSE; | 451 return FALSE; |
447 } | 452 } |
448 | 453 |
449 font_metrics = pango_font_get_metrics(font, NULL); | 454 lang = pango_context_get_language (pango_layout_get_context(layout)); |
455 font_metrics = pango_font_get_metrics(font, lang); //it's ok. | |
456 // font_metrics = pango_font_get_metrics(font, NULL); //crash! | |
450 | 457 |
451 pango_layout_get_pixel_size(layout, &scr_w, NULL); | 458 pango_layout_get_pixel_size(layout, &scr_w, NULL); |
452 gap = PANGO_PIXELS((pango_font_metrics_get_ascent(font_metrics) + | 459 gap = PANGO_PIXELS((pango_font_metrics_get_ascent(font_metrics) + |
453 pango_font_metrics_get_descent(font_metrics))/ 4); | 460 pango_font_metrics_get_descent(font_metrics))/ 4); |
454 | 461 |
549 gdk_window_set_cursor(win, GTK_IMHTML(imhtml)->arrow_cursor); | 556 gdk_window_set_cursor(win, GTK_IMHTML(imhtml)->arrow_cursor); |
550 if (GTK_IMHTML(imhtml)->tip_timer) | 557 if (GTK_IMHTML(imhtml)->tip_timer) |
551 g_source_remove(GTK_IMHTML(imhtml)->tip_timer); | 558 g_source_remove(GTK_IMHTML(imhtml)->tip_timer); |
552 GTK_IMHTML(imhtml)->tip_timer = 0; | 559 GTK_IMHTML(imhtml)->tip_timer = 0; |
553 } | 560 } |
554 | 561 //yaz here bomb explodes |
562 #if 1 | |
555 if (tip){ | 563 if (tip){ |
556 if (!GTK_IMHTML(imhtml)->editable) | 564 if (!GTK_IMHTML(imhtml)->editable) |
557 gdk_window_set_cursor(win, GTK_IMHTML(imhtml)->hand_cursor); | 565 gdk_window_set_cursor(win, GTK_IMHTML(imhtml)->hand_cursor); |
558 GTK_IMHTML(imhtml)->tip_timer = g_timeout_add (TOOLTIP_TIMEOUT, | 566 GTK_IMHTML(imhtml)->tip_timer = g_timeout_add (TOOLTIP_TIMEOUT, |
559 gtk_imhtml_tip, imhtml); | 567 gtk_imhtml_tip, imhtml); |
560 } | 568 } |
561 | 569 #endif |
562 GTK_IMHTML(imhtml)->tip = tip; | 570 GTK_IMHTML(imhtml)->tip = tip; |
563 g_slist_free(tags); | 571 g_slist_free(tags); |
564 return FALSE; | 572 return FALSE; |
565 } | 573 } |
566 | 574 |