summaryrefslogtreecommitdiff
path: root/font-viewer
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-24 16:13:05 +0100
committerStefano Karapetsas <[email protected]>2014-01-24 16:13:05 +0100
commitab448aa9ca1a2d697964aba7f31ebce0e1ed3147 (patch)
treeba88099ff5ffda10bb2cc4ae6c8079fb9db312e3 /font-viewer
parent80c3d8ace4794481e711fb63e4eefd9f1f5cc1ef (diff)
downloadmate-control-center-ab448aa9ca1a2d697964aba7f31ebce0e1ed3147.tar.bz2
mate-control-center-ab448aa9ca1a2d697964aba7f31ebce0e1ed3147.tar.xz
font-viewer: Allow to compile with GTK3
However, drawing signal is disabled with GTK3. It need to be fixed later.
Diffstat (limited to 'font-viewer')
-rw-r--r--font-viewer/font-view.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c
index fceada3f..8ae289b8 100644
--- a/font-viewer/font-view.c
+++ b/font-viewer/font-view.c
@@ -93,7 +93,10 @@ check_font_contain_text (FT_Face face, const gchar *text)
return TRUE;
}
-
+#if GTK_CHECK_VERSION (3, 0, 0)
+ /* FIXME */
+ /* https://git.gnome.org/browse/gnome-control-center/commit/font-viewer?h=gnome-3-0&id=7ea3249a4a0fa9a176a120257355a4ca75593386 */
+#else
static gboolean expose_event(GtkWidget *widget, GdkEventExpose *event, GdkPixmap *pixmap);
static GdkPixmap *
@@ -228,6 +231,7 @@ create_text_pixmap(GtkWidget *drawing_area, FT_Face face)
FcCharSetDestroy (charset);
return pixmap;
}
+#endif
static void
add_row(GtkWidget *table, gint *row_p,
@@ -379,6 +383,7 @@ add_face_info(GtkWidget *table, gint *row_p, const gchar *uri, FT_Face face)
}
}
+#if !GTK_CHECK_VERSION (3, 0, 0)
static gboolean
expose_event(GtkWidget *widget, GdkEventExpose *event, GdkPixmap *pixmap)
{
@@ -390,6 +395,7 @@ expose_event(GtkWidget *widget, GdkEventExpose *event, GdkPixmap *pixmap)
event->area.width, event->area.height);
return FALSE;
}
+#endif
static void
set_icon(GtkWindow *window, const gchar *uri)
@@ -511,7 +517,9 @@ main(int argc, char **argv)
gchar *font_file, *title;
gint row;
GtkWidget *window, *hbox, *table, *swin, *drawing_area;
+#if !GTK_CHECK_VERSION (3, 0, 0)
GdkPixmap *pixmap;
+#endif
GdkColor white = { 0, 0xffff, 0xffff, 0xffff };
GtkWidget *button, *align;
@@ -573,7 +581,9 @@ main(int argc, char **argv)
gtk_widget_modify_bg(drawing_area, GTK_STATE_NORMAL, &white);
gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(swin),
drawing_area);
+#if !GTK_CHECK_VERSION (3, 0, 0)
g_signal_connect (drawing_area, "realize", create_text_pixmap, face);
+#endif
/* set the minimum size on the scrolled window to prevent
* unnecessary scrolling */