Make GtkIMContext derive from GObject, not GtkObject. (#62621)

Fri Oct 19 15:08:30 2001  Owen Taylor  <otaylor@redhat.com>

	* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
	modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
	imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
	GObject, not GtkObject. (#62621)
This commit is contained in:
Owen Taylor 2001-10-19 19:28:27 +00:00 committed by Owen Taylor
parent fcc8790748
commit effa390541
16 changed files with 144 additions and 78 deletions

View File

@ -1,3 +1,10 @@
Fri Oct 19 15:08:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
GObject, not GtkObject. (#62621)
Fri Oct 19 12:49:12 2001 Owen Taylor <otaylor@redhat.com>
* tests/testsocket.c: Remove now useless include of unistd.h,

View File

@ -1,3 +1,10 @@
Fri Oct 19 15:08:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
GObject, not GtkObject. (#62621)
Fri Oct 19 12:49:12 2001 Owen Taylor <otaylor@redhat.com>
* tests/testsocket.c: Remove now useless include of unistd.h,

View File

@ -1,3 +1,10 @@
Fri Oct 19 15:08:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
GObject, not GtkObject. (#62621)
Fri Oct 19 12:49:12 2001 Owen Taylor <otaylor@redhat.com>
* tests/testsocket.c: Remove now useless include of unistd.h,

View File

@ -1,3 +1,10 @@
Fri Oct 19 15:08:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
GObject, not GtkObject. (#62621)
Fri Oct 19 12:49:12 2001 Owen Taylor <otaylor@redhat.com>
* tests/testsocket.c: Remove now useless include of unistd.h,

View File

@ -1,3 +1,10 @@
Fri Oct 19 15:08:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
GObject, not GtkObject. (#62621)
Fri Oct 19 12:49:12 2001 Owen Taylor <otaylor@redhat.com>
* tests/testsocket.c: Remove now useless include of unistd.h,

View File

@ -1,3 +1,10 @@
Fri Oct 19 15:08:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
GObject, not GtkObject. (#62621)
Fri Oct 19 12:49:12 2001 Owen Taylor <otaylor@redhat.com>
* tests/testsocket.c: Remove now useless include of unistd.h,

View File

@ -1,3 +1,10 @@
Fri Oct 19 15:08:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/{gtkimcontext.c,gtkimcontextsimple.c,gtkimmulticontext.c}
modules/input/{gtkimcontextxim.c,imcyrillic-translit.c,iminuktitut.c,
imipa.c,imthai-broken.c,imviqr.c}: Make GtkIMContext derive from
GObject, not GtkObject. (#62621)
Fri Oct 19 12:49:12 2001 Owen Taylor <otaylor@redhat.com>
* tests/testsocket.c: Remove now useless include of unistd.h,

View File

@ -47,19 +47,22 @@ gtk_im_context_get_type (void)
if (!im_context_type)
{
static const GtkTypeInfo im_context_info =
static const GTypeInfo im_context_info =
{
"GtkIMContext",
sizeof (GtkIMContext),
sizeof (GtkIMContextClass),
(GtkClassInitFunc) gtk_im_context_class_init,
(GtkObjectInitFunc) gtk_im_context_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
sizeof (GtkIMContextClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gtk_im_context_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkIMContext),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_im_context_init,
};
im_context_type = gtk_type_unique (GTK_TYPE_OBJECT, &im_context_info);
im_context_type = g_type_register_static (G_TYPE_OBJECT,
"GtkIMContext",
&im_context_info, 0);
}
return im_context_type;

View File

@ -761,19 +761,22 @@ gtk_im_context_simple_get_type (void)
if (!im_context_simple_type)
{
static const GtkTypeInfo im_context_simple_info =
static const GTypeInfo im_context_simple_info =
{
"GtkIMContextSimple",
sizeof (GtkIMContextSimple),
sizeof (GtkIMContextSimpleClass),
(GtkClassInitFunc) gtk_im_context_simple_class_init,
(GtkObjectInitFunc) gtk_im_context_simple_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gtk_im_context_simple_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkIMContextSimple),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_im_context_simple_init,
};
im_context_simple_type = gtk_type_unique (GTK_TYPE_IM_CONTEXT, &im_context_simple_info);
im_context_simple_type = g_type_register_static (GTK_TYPE_IM_CONTEXT,
"GtkIMContextSimple",
&im_context_simple_info, 0);
}
return im_context_simple_type;
@ -817,7 +820,7 @@ gtk_im_context_simple_finalize (GObject *obj)
GtkIMContext *
gtk_im_context_simple_new (void)
{
return GTK_IM_CONTEXT (gtk_type_new (GTK_TYPE_IM_CONTEXT_SIMPLE));
return GTK_IM_CONTEXT (g_object_new (GTK_TYPE_IM_CONTEXT_SIMPLE, NULL));
}
static void
@ -840,11 +843,10 @@ gtk_im_context_simple_commit_char (GtkIMContext *context,
{
context_simple->tentative_match = 0;
context_simple->tentative_match_len = 0;
gtk_signal_emit_by_name (GTK_OBJECT (context_simple),
"preedit_changed");
g_signal_emit_by_name (context_simple, "preedit_changed");
}
gtk_signal_emit_by_name (GTK_OBJECT (context), "commit", &buf);
g_signal_emit_by_name (context, "commit", &buf);
}
static int
@ -912,8 +914,7 @@ check_table (GtkIMContextSimple *context_simple,
context_simple->tentative_match = value;
context_simple->tentative_match_len = n_compose;
gtk_signal_emit_by_name (GTK_OBJECT (context_simple),
"preedit_changed");
g_signal_emit_by_name (context_simple, "preedit_changed");
return TRUE;
}
@ -992,8 +993,7 @@ check_hex (GtkIMContextSimple *context_simple,
context_simple->tentative_match = n;
context_simple->tentative_match_len = n_compose;
gtk_signal_emit_by_name (GTK_OBJECT (context_simple),
"preedit-changed");
g_signal_emit_by_name (context_simple, "preedit-changed");
return TRUE;
}

View File

@ -64,22 +64,25 @@ GtkType
gtk_im_multicontext_get_type (void)
{
static GtkType im_multicontext_type = 0;
if (!im_multicontext_type)
{
static const GtkTypeInfo im_multicontext_info =
static const GTypeInfo im_multicontext_info =
{
"GtkIMMulticontext",
sizeof (GtkIMMulticontext),
sizeof (GtkIMMulticontextClass),
(GtkClassInitFunc) gtk_im_multicontext_class_init,
(GtkObjectInitFunc) gtk_im_multicontext_init,
/* reserved_1 */ NULL,
/* reserved_2 */ NULL,
(GtkClassInitFunc) NULL,
sizeof (GtkIMMulticontextClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) gtk_im_multicontext_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkIMMulticontext),
0, /* n_preallocs */
(GInstanceInitFunc) gtk_im_multicontext_init,
};
im_multicontext_type = gtk_type_unique (GTK_TYPE_IM_CONTEXT, &im_multicontext_info);
im_multicontext_type = g_type_register_static (GTK_TYPE_IM_CONTEXT,
"GtkIMMulticontext",
&im_multicontext_info, 0);
}
return im_multicontext_type;
@ -113,7 +116,7 @@ gtk_im_multicontext_init (GtkIMMulticontext *multicontext)
GtkIMContext *
gtk_im_multicontext_new (void)
{
return GTK_IM_CONTEXT (gtk_type_new (GTK_TYPE_IM_MULTICONTEXT));
return GTK_IM_CONTEXT (g_object_new (GTK_TYPE_IM_MULTICONTEXT, NULL));
}
static void
@ -130,30 +133,41 @@ gtk_im_multicontext_set_slave (GtkIMMulticontext *multicontext,
{
if (multicontext->slave)
{
gtk_signal_disconnect_by_data (GTK_OBJECT (multicontext->slave), multicontext);
gtk_object_unref (GTK_OBJECT (multicontext->slave));
g_signal_handlers_disconnect_by_func (multicontext->slave,
gtk_im_multicontext_preedit_start_cb,
multicontext);
g_signal_handlers_disconnect_by_func (multicontext->slave,
gtk_im_multicontext_preedit_end_cb,
multicontext);
g_signal_handlers_disconnect_by_func (multicontext->slave,
gtk_im_multicontext_preedit_changed_cb,
multicontext);
g_signal_handlers_disconnect_by_func (multicontext->slave,
gtk_im_multicontext_commit_cb,
multicontext);
g_object_unref (multicontext->slave);
}
multicontext->slave = slave;
if (multicontext->slave)
{
gtk_object_ref (GTK_OBJECT (multicontext->slave));
gtk_object_sink (GTK_OBJECT (multicontext->slave));
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "preedit_start",
GTK_SIGNAL_FUNC (gtk_im_multicontext_preedit_start_cb),
multicontext);
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "preedit_end",
GTK_SIGNAL_FUNC (gtk_im_multicontext_preedit_end_cb),
multicontext);
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "preedit_changed",
GTK_SIGNAL_FUNC (gtk_im_multicontext_preedit_changed_cb),
multicontext);
gtk_signal_connect (GTK_OBJECT (multicontext->slave), "commit",
GTK_SIGNAL_FUNC (gtk_im_multicontext_commit_cb),
multicontext);
g_object_ref (multicontext->slave);
g_signal_connect (multicontext->slave, "preedit_start",
G_CALLBACK (gtk_im_multicontext_preedit_start_cb),
multicontext);
g_signal_connect (multicontext->slave, "preedit_end",
G_CALLBACK (gtk_im_multicontext_preedit_end_cb),
multicontext);
g_signal_connect (multicontext->slave, "preedit_changed",
G_CALLBACK (gtk_im_multicontext_preedit_changed_cb),
multicontext);
g_signal_connect (multicontext->slave, "commit",
G_CALLBACK (gtk_im_multicontext_commit_cb),
multicontext);
if (multicontext->client_window)
gtk_im_context_set_client_window (slave, multicontext->client_window);
}
@ -284,21 +298,21 @@ void
gtk_im_multicontext_preedit_start_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "preedit_start");
g_signal_emit_by_name (multicontext, "preedit_start");
}
void
gtk_im_multicontext_preedit_end_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "preedit_end");
g_signal_emit_by_name (multicontext, "preedit_end");
}
void
gtk_im_multicontext_preedit_changed_cb (GtkIMContext *slave,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "preedit_changed");
g_signal_emit_by_name (multicontext, "preedit_changed");
}
void
@ -306,7 +320,7 @@ gtk_im_multicontext_commit_cb (GtkIMContext *slave,
const gchar *str,
GtkIMMulticontext *multicontext)
{
gtk_signal_emit_by_name (GTK_OBJECT (multicontext), "commit", str);;
g_signal_emit_by_name (multicontext, "commit", str);;
}
static void
@ -361,7 +375,7 @@ gtk_im_multicontext_append_menuitems (GtkIMMulticontext *context,
gtk_object_set_data (GTK_OBJECT (menuitem), "gtk-context-id",
(char *)contexts[i]->context_id);
gtk_signal_connect (GTK_OBJECT (menuitem), "activate",
GTK_SIGNAL_FUNC (activate_cb), context);
G_CALLBACK (activate_cb), context);
gtk_widget_show (menuitem);
gtk_menu_shell_append (menushell, menuitem);

View File

@ -264,7 +264,7 @@ gtk_im_context_xim_new (void)
if (!info)
return NULL;
result = GTK_IM_CONTEXT_XIM (gtk_type_new (GTK_TYPE_IM_CONTEXT_XIM));
result = GTK_IM_CONTEXT_XIM (g_object_new (GTK_TYPE_IM_CONTEXT_XIM, NULL));
result->im_info = info;
@ -361,7 +361,7 @@ gtk_im_context_xim_filter_keypress (GtkIMContext *context,
* control characters into strings
*/
{
gtk_signal_emit_by_name (GTK_OBJECT (context), "commit", result_utf8);
g_signal_emit_by_name (context, "commit", result_utf8);
result = TRUE;
}
@ -468,7 +468,7 @@ gtk_im_context_xim_reset (GtkIMContext *context)
char *result_utf8 = mb_to_utf8 (context_xim, result);
if (result_utf8)
{
gtk_signal_emit_by_name (GTK_OBJECT (context), "commit", result_utf8);
g_signal_emit_by_name (context, "commit", result_utf8);
g_free (result_utf8);
}
}
@ -476,7 +476,7 @@ gtk_im_context_xim_reset (GtkIMContext *context)
if (context_xim->preedit_length)
{
context_xim->preedit_length = 0;
gtk_signal_emit_by_name (GTK_OBJECT (context), "preedit_changed");
g_signal_emit_by_name (context, "preedit_changed");
}
XFree (result);
@ -576,7 +576,7 @@ preedit_start_callback (XIC xic,
{
GtkIMContext *context = GTK_IM_CONTEXT (client_data);
gtk_signal_emit_by_name (GTK_OBJECT (context), "preedit_start");
g_signal_emit_by_name (context, "preedit_start");
g_print ("Starting preedit!\n");
}
@ -587,7 +587,7 @@ preedit_done_callback (XIC xic,
{
GtkIMContext *context = GTK_IM_CONTEXT (client_data);
gtk_signal_emit_by_name (GTK_OBJECT (context), "preedit_end");
g_signal_emit_by_name (context, "preedit_end");
g_print ("Ending preedit!\n");
}
@ -713,7 +713,7 @@ preedit_draw_callback (XIC xic,
if (new_text)
g_free (new_text);
gtk_signal_emit_by_name (GTK_OBJECT (context), "preedit_changed");
g_signal_emit_by_name (context, "preedit_changed");
}
@ -727,7 +727,7 @@ preedit_caret_callback (XIC xic,
if (call_data->direction == XIMAbsolutePosition)
{
context->preedit_cursor = call_data->position;
gtk_signal_emit_by_name (GTK_OBJECT (context), "preedit_changed");
g_signal_emit_by_name (context, "preedit_changed");
}
else
{

View File

@ -246,7 +246,7 @@ GtkIMContext *
im_module_create (const gchar *context_id)
{
if (strcmp (context_id, "cyrillic_translit") == 0)
return GTK_IM_CONTEXT (gtk_type_new (type_cyrillic_translit));
return GTK_IM_CONTEXT (g_object_new (type_cyrillic_translit, NULL));
else
return NULL;
}

View File

@ -156,7 +156,7 @@ GtkIMContext *
im_module_create (const gchar *context_id)
{
if (strcmp (context_id, "inuktitut") == 0)
return GTK_IM_CONTEXT (gtk_type_new (type_inuktitut_translit));
return GTK_IM_CONTEXT (g_object_new (type_inuktitut_translit, NULL));
else
return NULL;
}

View File

@ -174,7 +174,7 @@ GtkIMContext *
im_module_create (const gchar *context_id)
{
if (strcmp (context_id, "ipa") == 0)
return GTK_IM_CONTEXT (gtk_type_new (type_ipa));
return GTK_IM_CONTEXT (g_object_new (type_ipa, NULL));
else
return NULL;
}

View File

@ -207,7 +207,7 @@ GtkIMContext *
im_module_create (const gchar *context_id)
{
if (strcmp (context_id, "thai_broken") == 0)
return GTK_IM_CONTEXT (gtk_type_new (type_thai_broken));
return GTK_IM_CONTEXT (g_object_new (type_thai_broken, NULL));
else
return NULL;
}

View File

@ -273,7 +273,7 @@ GtkIMContext *
im_module_create (const gchar *context_id)
{
if (strcmp (context_id, "viqr") == 0)
return GTK_IM_CONTEXT (gtk_type_new (type_viqr_translit));
return GTK_IM_CONTEXT (g_object_new (type_viqr_translit, NULL));
else
return NULL;
}