X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=modules%2Finput%2Fgtkimcontextime.c;h=3dd06506e48c4cb668e0d858bdc6d525de267bcb;hb=9d0febc9a64a5bfb0fcfc3a88de4757f6c1ff090;hp=c2a87d9f9f50a9890ebbe28711b6e73636208bc8;hpb=d6ef4416f5d8e315981df89089e8c3d970bb27c6;p=~andy%2Fgtk diff --git a/modules/input/gtkimcontextime.c b/modules/input/gtkimcontextime.c index c2a87d9f9..3dd06506e 100644 --- a/modules/input/gtkimcontextime.c +++ b/modules/input/gtkimcontextime.c @@ -14,9 +14,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . * */ @@ -25,6 +23,10 @@ * http://msdn.microsoft.com/library/default.asp?url=/library/en-us/appendix/hh/appendix/imeimes2_35ph.asp */ +#ifdef GTK_DISABLE_DEPRECATED +#undef GTK_DISABLE_DEPRECATED +#endif + #include "gtkimcontextime.h" #include "imm-extra.h" @@ -124,7 +126,7 @@ static GObjectClass *parent_class; void gtk_im_context_ime_register_type (GTypeModule *type_module) { - static const GTypeInfo im_context_ime_info = { + const GTypeInfo im_context_ime_info = { sizeof (GtkIMContextIMEClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, @@ -344,6 +346,9 @@ gtk_im_context_ime_reset (GtkIMContext *context) HWND hwnd; HIMC himc; + if (!context_ime->client_window) + return; + hwnd = GDK_WINDOW_HWND (context_ime->client_window); himc = ImmGetContext (hwnd); if (!himc) @@ -353,7 +358,7 @@ gtk_im_context_ime_reset (GtkIMContext *context) ImmNotifyIME (himc, NI_COMPOSITIONSTR, CPS_CANCEL, 0); context_ime->preediting = FALSE; - g_signal_emit_by_name (context, "preedit_changed"); + g_signal_emit_by_name (context, "preedit-changed"); ImmReleaseContext (hwnd, himc); } @@ -851,7 +856,7 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context) PangoLanguage *pango_lang = pango_language_from_string (lang); PangoFontset *fontset = pango_context_load_fontset (pango_context, - widget->style->font_desc, + gtk_widget_get_style (widget)->font_desc, pango_lang); gunichar *sample = g_utf8_to_ucs4 (pango_language_get_sample_string (pango_lang), @@ -873,7 +878,7 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context) g_object_unref (fontset); } else - font = pango_context_load_font (pango_context, widget->style->font_desc); + font = pango_context_load_font (pango_context, gtk_widget_get_style (widget)->font_desc); if (!font) goto ERROR_OUT; @@ -946,7 +951,7 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, ImmSetCandidateWindow (himc, &cf); if ((msg->lParam & GCS_COMPSTR)) - g_signal_emit_by_name (context, "preedit_changed"); + g_signal_emit_by_name (context, "preedit-changed"); if (msg->lParam & GCS_RESULTSTR) { @@ -985,15 +990,15 @@ gtk_im_context_ime_message_filter (GdkXEvent *xevent, case WM_IME_STARTCOMPOSITION: context_ime->preediting = TRUE; gtk_im_context_ime_set_cursor_location (context, NULL); - g_signal_emit_by_name (context, "preedit_start"); + g_signal_emit_by_name (context, "preedit-start"); if (context_ime->use_preedit) retval = TRUE; break; case WM_IME_ENDCOMPOSITION: context_ime->preediting = FALSE; - g_signal_emit_by_name (context, "preedit_changed"); - g_signal_emit_by_name (context, "preedit_end"); + g_signal_emit_by_name (context, "preedit-changed"); + g_signal_emit_by_name (context, "preedit-end"); if (context_ime->use_preedit) retval = TRUE; break;