]> Pileus Git - ~andy/gtk/blobdiff - modules/input/gtkimcontextime.c
Change FSF Address
[~andy/gtk] / modules / input / gtkimcontextime.c
index 833cf160b571880de4c8e52ce03e7c76feb7aec5..3dd06506e48c4cb668e0d858bdc6d525de267bcb 100644 (file)
@@ -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 <http://www.gnu.org/licenses/>.
  *
  */
 
  *  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"
 
 #include "gdk/win32/gdkwin32.h"
 #include "gdk/gdkkeysyms.h"
-#include "gtk/gtkwidget.h"
 
-#include <pango/pango-utils.h>
+#include <pango/pango.h>
 
 /* avoid warning */
 #ifdef STRICT
@@ -125,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,
@@ -345,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)
@@ -354,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);
 }
@@ -446,9 +450,9 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const gchar *utf8str)
       /*
        *  get attributes list of IME.
        */
-      len = ImmGetCompositionStringA (himc, GCS_COMPATTR, NULL, 0);
+      len = ImmGetCompositionStringW (himc, GCS_COMPATTR, NULL, 0);
       buf = g_alloca (len);
-      ImmGetCompositionStringA (himc, GCS_COMPATTR, buf, len);
+      ImmGetCompositionStringW (himc, GCS_COMPATTR, buf, len);
 
       /*
        *  schr and echr are pointer in utf8str.
@@ -852,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),
@@ -874,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;
@@ -947,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)
           {
@@ -986,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;