mirror of
https://github.com/elementary/gala.git
synced 2024-11-27 07:38:47 +03:00
remove Gee as a depedency for libgala, use GVariant instead of GValue for ActivatableComponent.open
This commit is contained in:
parent
438e42e1a7
commit
d62757998e
@ -32,7 +32,7 @@ namespace Gala
|
||||
* to the component. Currently, the only one implemented is the
|
||||
* 'all-windows' hint to the windowoverview.
|
||||
*/
|
||||
public abstract void open (Gee.HashMap<string,Value?>? hints = null);
|
||||
public abstract void open (HashTable<string,Variant>? hints = null);
|
||||
|
||||
/**
|
||||
* The component was requested to be closed.
|
||||
|
@ -127,7 +127,7 @@ namespace Gala
|
||||
|
||||
private bool _freeze_track = false;
|
||||
private Meta.Rectangle[]? _custom_region = null;
|
||||
private Gee.LinkedList<Clutter.Actor> tracked_actors = new Gee.LinkedList<Clutter.Actor> ();
|
||||
private List<Clutter.Actor> tracked_actors = new List<Clutter.Actor> ();
|
||||
|
||||
/**
|
||||
* Once this method is called you can start adding actors to the stage
|
||||
@ -154,7 +154,7 @@ namespace Gala
|
||||
*/
|
||||
public void track_actor (Clutter.Actor actor)
|
||||
{
|
||||
tracked_actors.add (actor);
|
||||
tracked_actors.prepend (actor);
|
||||
actor.allocation_changed.connect (actor_allocation_changed);
|
||||
|
||||
update_region ();
|
||||
@ -168,9 +168,8 @@ namespace Gala
|
||||
*/
|
||||
public void untrack_actor (Clutter.Actor actor)
|
||||
{
|
||||
if (tracked_actors.remove (actor)) {
|
||||
actor.allocation_changed.disconnect (actor_allocation_changed);
|
||||
}
|
||||
tracked_actors.remove (actor);
|
||||
actor.allocation_changed.disconnect (actor_allocation_changed);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -184,7 +183,7 @@ namespace Gala
|
||||
public void update_region ()
|
||||
{
|
||||
var has_custom = custom_region != null;
|
||||
var len = tracked_actors.size + (has_custom ? custom_region.length : 0);
|
||||
var len = tracked_actors.length () + (has_custom ? custom_region.length : 0);
|
||||
|
||||
Meta.Rectangle[] regions = new Meta.Rectangle[len];
|
||||
var i = 0;
|
||||
|
@ -20,16 +20,16 @@ namespace Gala
|
||||
public class Utils
|
||||
{
|
||||
// Cache xid:pixbuf and icon:pixbuf pairs to provide a faster way aquiring icons
|
||||
static Gee.HashMap<string, Gdk.Pixbuf> xid_pixbuf_cache;
|
||||
static Gee.HashMap<string, Gdk.Pixbuf> icon_pixbuf_cache;
|
||||
static HashTable<string, Gdk.Pixbuf> xid_pixbuf_cache;
|
||||
static HashTable<string, Gdk.Pixbuf> icon_pixbuf_cache;
|
||||
static uint cache_clear_timeout = 0;
|
||||
|
||||
static Gdk.Pixbuf? close_pixbuf = null;
|
||||
|
||||
static construct
|
||||
{
|
||||
xid_pixbuf_cache = new Gee.HashMap<string, Gdk.Pixbuf> ();
|
||||
icon_pixbuf_cache = new Gee.HashMap<string, Gdk.Pixbuf> ();
|
||||
xid_pixbuf_cache = new HashTable<string, Gdk.Pixbuf> (str_hash, str_equal);
|
||||
icon_pixbuf_cache = new HashTable<string, Gdk.Pixbuf> (str_hash, str_equal);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -37,21 +37,21 @@ namespace Gala
|
||||
*/
|
||||
static void clean_icon_cache (uint32[] xids)
|
||||
{
|
||||
var list = xid_pixbuf_cache.keys.to_array ();
|
||||
var pixbuf_list = icon_pixbuf_cache.values.to_array ();
|
||||
var icon_list = icon_pixbuf_cache.keys.to_array ();
|
||||
var list = xid_pixbuf_cache.get_keys ();
|
||||
var pixbuf_list = icon_pixbuf_cache.get_values ();
|
||||
var icon_list = icon_pixbuf_cache.get_keys ();
|
||||
|
||||
foreach (var xid_key in list) {
|
||||
var xid = (uint32)uint64.parse (xid_key.split ("::")[0]);
|
||||
if (!(xid in xids)) {
|
||||
var pixbuf = xid_pixbuf_cache.get (xid_key);
|
||||
for (var j = 0; j < pixbuf_list.length; j++) {
|
||||
if (pixbuf_list[j] == pixbuf) {
|
||||
xid_pixbuf_cache.unset (icon_list[j]);
|
||||
for (var j = 0; j < pixbuf_list.length (); j++) {
|
||||
if (pixbuf_list.nth_data (j) == pixbuf) {
|
||||
xid_pixbuf_cache.remove (icon_list.nth_data (j));
|
||||
}
|
||||
}
|
||||
|
||||
xid_pixbuf_cache.unset (xid_key);
|
||||
xid_pixbuf_cache.remove (xid_key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ namespace Gala
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public void open (Gee.HashMap<string,GLib.Value?>? hints = null)
|
||||
public void open (HashTable<string,Variant>? hints = null)
|
||||
{
|
||||
if (opened)
|
||||
return;
|
||||
|
@ -103,7 +103,7 @@ namespace Gala
|
||||
* {@inheritDoc}
|
||||
* You may specify 'all-windows' in hints to expose all windows
|
||||
*/
|
||||
public void open (Gee.HashMap<string,GLib.Value?>? hints = null)
|
||||
public void open (HashTable<string,Variant>? hints = null)
|
||||
{
|
||||
if (!ready)
|
||||
return;
|
||||
@ -113,7 +113,7 @@ namespace Gala
|
||||
return;
|
||||
}
|
||||
|
||||
var all_windows = hints != null && hints.has_key ("all-windows");
|
||||
var all_windows = hints != null && "all-windows" in hints;
|
||||
|
||||
var used_windows = new SList<Window> ();
|
||||
|
||||
|
@ -258,7 +258,7 @@ namespace Gala
|
||||
if (window_overview.is_opened ())
|
||||
window_overview.close ();
|
||||
else {
|
||||
var hints = new Gee.HashMap<string,GLib.Value?> ();
|
||||
var hints = new HashTable<string,Variant> (str_hash, str_equal);
|
||||
hints.@set ("all-windows", true);
|
||||
window_overview.open (hints);
|
||||
}
|
||||
@ -607,7 +607,7 @@ namespace Gala
|
||||
if (window_overview.is_opened ())
|
||||
window_overview.close ();
|
||||
else {
|
||||
var hints = new Gee.HashMap<string,GLib.Value?> ();
|
||||
var hints = new HashTable<string,Variant> (str_hash, str_equal);
|
||||
hints.@set ("all-windows", true);
|
||||
window_overview.open (hints);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user