Drop support for plank < 0.11.0

This commit is contained in:
Rico Tzschichholz 2017-07-18 16:52:53 +02:00
parent b8bfcb2747
commit 12788ef9ce
5 changed files with 1 additions and 67 deletions

View File

@ -104,7 +104,7 @@ fi
# -----------------------------------------------------------
GTK_MIN_VERSION=3.4.0
GLIB_MIN_VERSION=2.44.0
PLANK_MIN_VERSION=0.3.0
PLANK_MIN_VERSION=0.11.0
CLUTTER_MIN_VERSION=1.12.0
GSD_MIN_VERSION=3.15.2
MUTTER_MIN_VERSION=3.18.3
@ -184,13 +184,6 @@ if test "x$have_mutter324" = "xyes" ; then
MUTTER_LDFLAGS="-R`$PKG_CONFIG --variable=typelibdir libmutter-0`"
fi
# Check for newer Plank
PLANK_PKGS="plank >= 0.10.9"
PKG_CHECK_MODULES(PLANK_0_11, $PLANK_PKGS, [enable_plank_0_11=yes], [enable_plank_0_11=no])
if test "x$enable_plank_0_11" = "xyes" ; then
VALAFLAGS="$VALAFLAGS --define HAVE_PLANK_0_11"
fi
GALA_CORE_PKGS="$GALA_CORE_PKGS $MUTTER_PKGS"
GALA_CORE_VALA_PKGS="$GALA_CORE_VALA_PKGS $MUTTER_VALA_PKGS"
CFLAGS="$CFLAGS $MUTTER_CFLAGS"

View File

@ -132,18 +132,10 @@ namespace Gala
if (app != null && app.get_desktop_file () != null) {
var appinfo = new DesktopAppInfo.from_filename (app.get_desktop_file ());
if (appinfo != null) {
#if HAVE_PLANK_0_11
icon = Plank.DrawingService.get_icon_from_gicon (appinfo.get_icon ());
#else
icon = Plank.Drawing.DrawingService.get_icon_from_gicon (appinfo.get_icon ());
#endif
icon_key = "%s::%i".printf (icon, size);
if (ignore_cache || (image = icon_pixbuf_cache.get (icon_key)) == null) {
#if HAVE_PLANK_0_11
image = Plank.DrawingService.load_icon (icon, size, size);
#else
image = Plank.Drawing.DrawingService.load_icon (icon, size, size);
#endif
not_cached = true;
}
}
@ -174,11 +166,7 @@ namespace Gala
}
if (size != image.width || size != image.height)
#if HAVE_PLANK_0_11
image = Plank.DrawingService.ar_scale (image, size, size);
#else
image = Plank.Drawing.DrawingService.ar_scale (image, size, size);
#endif
if (not_cached)
icon_pixbuf_cache.set (icon_key, image);

View File

@ -33,35 +33,18 @@ namespace Gala
}
Plank.DockPreferences? dock_settings = null;
#if HAVE_PLANK_0_11
Plank.DockTheme? dock_theme = null;
public signal void dock_theme_changed (Plank.DockTheme? old_theme,
Plank.DockTheme new_theme);
#else
Plank.Drawing.DockTheme? dock_theme = null;
public signal void dock_theme_changed (Plank.Drawing.DockTheme? old_theme,
Plank.Drawing.DockTheme new_theme);
#endif
DockThemeManager ()
{
#if HAVE_PLANK_0_11
dock_settings = new Plank.DockPreferences ("dock1");
#else
var file = Environment.get_user_config_dir () + "/plank/dock1/settings";
dock_settings = new Plank.DockPreferences.with_filename (file);
#endif
dock_settings.notify["Theme"].connect (load_dock_theme);
}
#if HAVE_PLANK_0_11
public Plank.DockTheme get_dock_theme ()
#else
public Plank.Drawing.DockTheme get_dock_theme ()
#endif
{
if (dock_theme == null)
load_dock_theme ();
@ -76,11 +59,7 @@ namespace Gala
void load_dock_theme ()
{
#if HAVE_PLANK_0_11
var new_theme = new Plank.DockTheme (dock_settings.Theme);
#else
var new_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);
#endif
new_theme.load ("dock");
dock_theme_changed (dock_theme, new_theme);
dock_theme = new_theme;

View File

@ -52,11 +52,7 @@ namespace Gala
GLib.Environment.unset_variable ("NO_GAIL");
GLib.Environment.unset_variable ("NO_AT_BRIDGE");
#if HAVE_PLANK_0_11
Plank.Paths.initialize ("plank", Config.DATADIR + "/plank");
#else
Plank.Services.Paths.initialize ("plank", Config.DATADIR + "/plank");
#endif
// Force initialization of static fields in Utils class
// https://bugzilla.gnome.org/show_bug.cgi?id=543189

View File

@ -33,13 +33,8 @@ namespace Gala
WindowActor? dock_window;
Actor dock;
#if HAVE_PLANK_0_11
Plank.Surface? dock_surface;
Plank.DockTheme dock_theme;
#else
Plank.Drawing.DockSurface? dock_surface;
Plank.Drawing.DockTheme dock_theme;
#endif
Plank.DockPreferences dock_settings;
float dock_y_offset;
float dock_height_offset;
@ -62,20 +57,11 @@ namespace Gala
construct
{
// pull drawing methods from libplank
#if HAVE_PLANK_0_11
dock_settings = new Plank.DockPreferences ("dock1");
#else
var settings_file = Environment.get_user_config_dir () + "/plank/dock1/settings";
dock_settings = new Plank.DockPreferences.with_filename (settings_file);
#endif
dock_settings.notify.connect (update_dock);
dock_settings.notify["Theme"].connect (load_dock_theme);
#if HAVE_PLANK_0_11
var launcher_folder = Plank.Paths.AppConfigFolder.get_child ("dock1").get_child ("launchers");
#else
var launcher_folder = Plank.Services.Paths.AppConfigFolder.get_child ("dock1").get_child ("launchers");
#endif
if (launcher_folder.query_exists ()) {
try {
@ -124,11 +110,7 @@ namespace Gala
if (dock_theme != null)
dock_theme.notify.disconnect (update_dock);
#if HAVE_PLANK_0_11
dock_theme = new Plank.DockTheme (dock_settings.Theme);
#else
dock_theme = new Plank.Drawing.DockTheme (dock_settings.Theme);
#endif
dock_theme.load ("dock");
dock_theme.notify.connect (update_dock);
@ -218,11 +200,7 @@ namespace Gala
}
if (dock_surface == null || dock_surface.Width != width || dock_surface.Height != height) {
#if HAVE_PLANK_0_11
var dummy_surface = new Plank.Surface.with_cairo_surface (1, 1, cr.get_target ());
#else
var dummy_surface = new Plank.Drawing.DockSurface.with_surface (1, 1, cr.get_target ());
#endif
dock_surface = dock_theme.create_background (width, height, position, dummy_surface);
}