* 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
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,
HWND hwnd;
HIMC himc;
+ if (!context_ime->client_window)
+ return;
+
hwnd = GDK_WINDOW_HWND (context_ime->client_window);
himc = ImmGetContext (hwnd);
if (!himc)
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);
}
/*
* 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.
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),
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;
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)
{
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;