Commits

Anonymous committed a4d4c27

#i88303# allow compile on ancient baseline (gtk<2.8.1)

Comments (0)

Files changed (1)

vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx

 #include "saldisp.hxx"
 #include "vcl/svapp.hxx"
 
+#include "cairo/cairo.h"
+
 // initialize statics
 BOOL GtkSalGraphics::bThemeChanged = TRUE;
 BOOL GtkSalGraphics::bNeedPixmapPaint = FALSE;
     // preferred icon style
     gchar* pIconThemeName = NULL;
     g_object_get( gtk_settings_get_default(), "gtk-icon-theme-name", &pIconThemeName, (char *)NULL );
-    aStyleSet.SetPreferredSymbolsStyleName( OUString::createFromAscii(pIconThemeName) );
-    g_free (pIconThemeName);
+    aStyleSet.SetPreferredSymbolsStyleName( OUString::createFromAscii( pIconThemeName ) );
+    g_free( pIconThemeName );
 
     //  FIXME: need some way of fetching toolbar icon size.
 //	aStyleSet.SetToolbarIconSize( STYLE_TOOLBAR_ICONSIZE_SMALL );
 
-    const cairo_font_options_t *pNewOptions = 0;
-    if (GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), m_nScreen ))
-        pNewOptions = gdk_screen_get_font_options(pScreen);
+    const cairo_font_options_t* pNewOptions = NULL;
+    if( GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), m_nScreen ) )
+    {
+#if !GTK_CHECK_VERSION(2,8,1)
+	static cairo_font_options_t* (*gdk_screen_get_font_options)(GdkScreen*) = 
+		(cairo_font_options_t*(*)(GdkScreen*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" );
+	if( gdk_screen_get_font_options != NULL )
+#endif
+		pNewOptions = gdk_screen_get_font_options( pScreen );
+    }
     aStyleSet.SetCairoFontOptions( pNewOptions );
 
     // finally update the collected settings
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.