diff -urN --exclude configure gcin-1.4.6.orig/anthy.cpp gcin-1.4.6/anthy.cpp
--- gcin-1.4.6.orig/anthy.cpp 2009-12-17 22:02:20.000000000 +0900
+++ gcin-1.4.6/anthy.cpp 2010-04-22 12:50:00.300366245 +0900
@@ -993,7 +993,11 @@
int anthy_visible()
{
+#if GTK_CHECK_VERSION(2,18,0)
+ return gtk_widget_get_visible(win_anthy);
+#else
return GTK_WIDGET_VISIBLE(win_anthy);
+#endif
}
extern gboolean force_show;
diff -urN --exclude configure gcin-1.4.6.orig/eggtrayicon.cpp gcin-1.4.6/eggtrayicon.cpp
--- gcin-1.4.6.orig/eggtrayicon.cpp 2009-08-07 13:25:45.000000000 +0900
+++ gcin-1.4.6/eggtrayicon.cpp 2010-04-22 12:51:35.247365986 +0900
@@ -352,7 +352,11 @@
gdk_window_add_filter (gdkwin, egg_tray_icon_manager_filter, icon);
+#if GTK_CHECK_VERSION(2,20,0)
+ if (dock_if_realized && gtk_widget_get_realized (icon))
+#else
if (dock_if_realized && GTK_WIDGET_REALIZED (icon))
+#endif
egg_tray_icon_send_dock_request (icon);
egg_tray_icon_get_orientation_property (icon);
@@ -398,7 +402,11 @@
static void
make_transparent (GtkWidget *widget, gpointer user_data)
{
+#if GTK_CHECK_VERSION(2,18,0)
+ if (!gtk_widget_get_has_window (widget) || gtk_widget_get_app_paintable (widget))
+#else
if (GTK_WIDGET_NO_WINDOW (widget) || GTK_WIDGET_APP_PAINTABLE (widget))
+#endif
return;
gtk_widget_set_app_paintable (widget, TRUE);
diff -urN --exclude configure gcin-1.4.6.orig/eve.cpp gcin-1.4.6/eve.cpp
--- gcin-1.4.6.orig/eve.cpp 2009-12-17 18:24:58.000000000 +0900
+++ gcin-1.4.6/eve.cpp 2010-04-22 12:54:10.853365974 +0900
@@ -661,10 +661,18 @@
return FALSE;
switch (current_CS->in_method) {
case 3:
+#if GTK_CHECK_VERSION(2,18,0)
+ return gwin_pho && gtk_widget_get_visible(gwin_pho);
+#else
return gwin_pho && GTK_WIDGET_VISIBLE(gwin_pho);
+#endif
#if USE_TSIN
case 6:
+# if GTK_CHECK_VERSION(2,18,0)
+ return gwin0 && gtk_widget_get_visible(gwin0);
+# else
return gwin0 && GTK_WIDGET_VISIBLE(gwin0);
+# endif
#endif
case 10:
break;
@@ -675,7 +683,11 @@
default:
if (!gwin_gtab)
return FALSE;
+#if GTK_CHECK_VERSION(2,18,0)
+ return gwin_gtab && gtk_widget_get_visible(gwin_gtab);
+#else
return gwin_gtab && GTK_WIDGET_VISIBLE(gwin_gtab);
+#endif
}
return FALSE;
diff -urN --exclude configure gcin-1.4.6.orig/gtab.cpp gcin-1.4.6/gtab.cpp
--- gcin-1.4.6.orig/gtab.cpp 2009-12-19 16:40:13.000000000 +0900
+++ gcin-1.4.6/gtab.cpp 2010-04-22 12:54:48.344366001 +0900
@@ -1230,7 +1230,11 @@
return feedkey_pho(key, 0);
if (same_pho_query_state == SAME_PHO_QUERY_none && gwin_pho &&
+#if GTK_CHECK_VERSION(2,18,0)
+ gtk_widget_get_visible(gwin_pho))
+#else
GTK_WIDGET_VISIBLE(gwin_pho))
+#endif
hide_win_pho();
diff -urN --exclude configure gcin-1.4.6.orig/tray.cpp gcin-1.4.6/tray.cpp
--- gcin-1.4.6.orig/tray.cpp 2009-12-06 15:54:56.000000000 +0900
+++ gcin-1.4.6/tray.cpp 2010-04-22 12:56:31.115370364 +0900
@@ -286,7 +286,11 @@
gtk_widget_show_all (GTK_WIDGET (tray_icon));
tray_da_win = da->window;
// tray window is not ready ??
+#if GTK_CHECK_VERSION(2,18,0)
+ if (!tray_da_win || !gtk_widget_is_drawable(da)) {
+#else
if (!tray_da_win || !GTK_WIDGET_DRAWABLE(da)) {
+#endif
gtk_widget_destroy(GTK_WIDGET(tray_icon));
da = NULL;
return FALSE;
diff -urN --exclude configure gcin-1.4.6.orig/win0.cpp gcin-1.4.6/win0.cpp
--- gcin-1.4.6.orig/win0.cpp 2009-12-07 10:57:36.000000000 +0900
+++ gcin-1.4.6/win0.cpp 2010-04-22 12:58:58.305366453 +0900
@@ -215,7 +215,11 @@
void disp_pho_sub(GtkWidget *label, int index, char *pho);
void disp_tsin_pho(int index, char *pho)
{
+#if GTK_CHECK_VERSION(2,18,0)
+ if (button_pho && !gtk_widget_get_visible(button_pho))
+#else
if (button_pho && !GTK_WIDGET_VISIBLE(button_pho))
+#endif
gtk_widget_show(button_pho);
disp_pho_sub(label_pho, index, pho);
@@ -603,7 +607,11 @@
if (gcin_pop_up_win && !tsin_has_input() && !force_show)
return;
#if UNIX
+# if GTK_CHECK_VERSION(2,18,0)
+ if (!gtk_widget_get_visible(gwin0))
+# else
if (!GTK_WIDGET_VISIBLE(gwin0))
+# endif
#endif
{
gtk_widget_show(gwin0);
diff -urN --exclude configure gcin-1.4.6.orig/win1.cpp gcin-1.4.6/win1.cpp
--- gcin-1.4.6.orig/win1.cpp 2009-08-19 11:23:53.000000000 +0900
+++ gcin-1.4.6/win1.cpp 2010-04-22 13:00:07.778365894 +0900
@@ -166,7 +166,11 @@
void disp_selections(int x, int y)
{
+#if GTK_CHECK_VERSION(2,18,0)
+ if (!gtk_widget_get_visible(gwin1)) {
+#else
if (!GTK_WIDGET_VISIBLE(gwin1)) {
+#endif
gtk_widget_show(gwin1);
}
@@ -186,7 +190,11 @@
void raise_tsin_selection_win()
{
+#if GTK_CHECK_VERSION(2,18,0)
+ if (gwin1 && gtk_widget_get_visible(gwin1))
+#else
if (gwin1 && GTK_WIDGET_VISIBLE(gwin1))
+#endif
gtk_window_present(GTK_WINDOW(gwin1));
}
diff -urN --exclude configure gcin-1.4.6.orig/win-gtab.cpp gcin-1.4.6/win-gtab.cpp
--- gcin-1.4.6.orig/win-gtab.cpp 2009-12-19 16:19:58.000000000 +0900
+++ gcin-1.4.6/win-gtab.cpp 2010-04-22 13:01:17.766366021 +0900
@@ -526,7 +526,11 @@
// dbg("show_win_gtab()\n");
#if UNIX
+# if GTK_CHECK_VERSION(2,18,0)
+ if (!gtk_widget_get_visible(gwin_gtab))
+# else
if (!GTK_WIDGET_VISIBLE(gwin_gtab))
+# endif
#endif
gtk_widget_show(gwin_gtab);