Permalink
Browse files

added some comments

  • Loading branch information...
1 parent e582b1e commit 020449770347f723911a39e6003ed0e35440befd @Simmesimme committed Jan 20, 2012
View
@@ -23,13 +23,13 @@ sudo apt-get install gnome-pie
First of all, install all dependancies. For compilation and linking against GTK3:
~~~~
-sudo apt-get install libgtk-3-dev libcairo2-dev libappindicator3-dev libgee-dev libxml2-dev libxtst-dev libgnome-menu-3-dev valac cmake libunique-3.0-dev libbamf3-dev libwnck-3-dev
+sudo apt-get install libgtk-3-dev libcairo2-dev libappindicator3-dev libgee-dev libxml2-dev libxtst-dev libgnome-menu-3-dev valac cmake libunique-3.0-dev libbamf3-dev libwnck-3-dev bamfdaemon
~~~~
For compilation and linking against GTK2:
~~~~
-sudo apt-get install libgtk2.0-dev libcairo2-dev libappindicator-dev libgee-dev libxml2-dev libxtst-dev libgnome-menu-dev valac cmake libunique-dev libbamf-dev libwnck-dev
+sudo apt-get install libgtk2.0-dev libcairo2-dev libappindicator-dev libgee-dev libxml2-dev libxtst-dev libgnome-menu-dev valac cmake libunique-dev libbamf-dev libwnck-dev bamfdaemon
~~~~
Then build Gnome-Pie by typing:
@@ -71,11 +71,19 @@ public class ActionGroup : GLib.Object {
actions.clear();
}
+ /////////////////////////////////////////////////////////////////////
+ /// Makes all contained Slices no Quick Actions.
+ /////////////////////////////////////////////////////////////////////
+
public void disable_quickactions() {
foreach (var action in actions)
action.is_quickaction = false;
}
+ /////////////////////////////////////////////////////////////////////
+ /// Returns true, if one o the contained Slices is a Quick Action
+ /////////////////////////////////////////////////////////////////////
+
public bool has_quickaction() {
foreach (var action in actions)
if (action.is_quickaction)
@@ -30,7 +30,7 @@ public class GroupRegistry : GLib.Object {
public static Gee.ArrayList<string> types { get; private set; }
/////////////////////////////////////////////////////////////////////
- /// Three maps associating a displayable name for each ActionGroup,
+ /// A map associating a displayable name for each ActionGroup,
/// an icon name and a name for the pies.conf file with it's type.
/////////////////////////////////////////////////////////////////////
@@ -74,6 +74,10 @@ public class GroupRegistry : GLib.Object {
descriptions.set(typeof(WindowListGroup).name(), type_description);
}
+ /////////////////////////////////////////////////////////////////////
+ /// Creates a Group for a given type name.
+ /////////////////////////////////////////////////////////////////////
+
public static ActionGroup? create_group(string type_id, string parent_id) {
switch (type_id) {
case "bookmarks": return new BookmarkGroup(parent_id);
@@ -30,13 +30,17 @@ public class ActionRegistry : GLib.Object {
public static Gee.ArrayList<string> types { get; private set; }
/////////////////////////////////////////////////////////////////////
- /// Three maps associating a displayable name for each Action,
+ /// A map associating a displayable name for each Action,
/// whether it has a custom icon and a name for the pies.conf
/// file with it's type.
/////////////////////////////////////////////////////////////////////
public static Gee.HashMap<string, TypeDescription?> descriptions { get; private set; }
+ /////////////////////////////////////////////////////////////////////
+ /// A helper class storing information on a Action type.
+ /////////////////////////////////////////////////////////////////////
+
public class TypeDescription {
public string name { get; set; default=""; }
public string icon { get; set; default=""; }
@@ -72,6 +76,10 @@ public class ActionRegistry : GLib.Object {
descriptions.set(typeof(UriAction).name(), type_description);
}
+ /////////////////////////////////////////////////////////////////////
+ /// Creates a new Action from the given type name.
+ /////////////////////////////////////////////////////////////////////
+
public static Action? create_action(string type_id, string name, string icon, string command, bool quickaction) {
switch (type_id) {
case "app": return new AppAction(name, icon, command, quickaction);
@@ -208,6 +216,11 @@ public class ActionRegistry : GLib.Object {
return new_for_app_info(info);
}
+ /////////////////////////////////////////////////////////////////////
+ /// Returns for example www.google.com when http://www.google.de/?q=h
+ /// is given.
+ /////////////////////////////////////////////////////////////////////
+
private static string get_domain_name(string url) {
int domain_end = url.index_of_char('/', 7);
int domain_begin = url.index_of_char('/', 0) + 2;
View
@@ -162,13 +162,18 @@ public class Image : GLib.Object {
else ctx.paint_with_alpha(alpha);
}
+ /////////////////////////////////////////////////////////////////////
+ /// Converts the image to a Gdk.Pixbuf.
+ /////////////////////////////////////////////////////////////////////
+
public Gdk.Pixbuf to_pixbuf() {
var pixbuf = new Gdk.Pixbuf.from_data(surface.get_data(), Gdk.Colorspace.RGB, true, 8,
width(), height(), surface.get_stride(), null);
pixbuf = pixbuf.copy();
- // funny stuff here --- need to swap Red end Blue because Cairo and Gdk are different...
+ // funny stuff here --- need to swap Red end Blue because Cairo
+ // and Gdk are different...
uint8* p = pixbuf.pixels;
for (int i=0; i<width()*height()*4-4; i+=4) {
var tmp = *(p + i);
@@ -71,7 +71,8 @@ public class RenderedText : Image {
}
/////////////////////////////////////////////////////////////////////
- /// C'tor, creates a new image representation of a string.
+ /// C'tor, creates a new image representation of a string. This
+ /// string may contain markup information.
/////////////////////////////////////////////////////////////////////
public RenderedText.with_markup(string text, int width, int height, string font,
View
@@ -31,6 +31,11 @@ public class PieManager : GLib.Object {
public static Gee.HashMap<string, Pie?> all_pies { get; private set; }
+ /////////////////////////////////////////////////////////////////////
+ /// Stores all PieWindows which are currently opened. Should be
+ /// rarely more than two...
+ /////////////////////////////////////////////////////////////////////
+
public static Gee.HashSet<PieWindow?> opened_windows { get; private set; }
/////////////////////////////////////////////////////////////////////
@@ -113,6 +118,10 @@ public class PieManager : GLib.Object {
return bindings.get_accelerator_label_of(id);
}
+ /////////////////////////////////////////////////////////////////////
+ /// Bind the Pie with the given ID to the given trigger.
+ /////////////////////////////////////////////////////////////////////
+
public static void bind_trigger(Trigger trigger, string id) {
bindings.unbind(id);
bindings.bind(trigger, id);
@@ -237,6 +246,10 @@ public class PieManager : GLib.Object {
}
}
+ /////////////////////////////////////////////////////////////////////
+ /// Creates a desktop file for which opens the Pie with given ID.
+ /////////////////////////////////////////////////////////////////////
+
public static void create_launcher(string id) {
if (all_pies.has_key(id)) {
Pie? pie = all_pies[id];
@@ -262,6 +275,10 @@ public class PieManager : GLib.Object {
}
}
+ /////////////////////////////////////////////////////////////////////
+ /// Deletes the desktop file for the Pie with the given ID.
+ /////////////////////////////////////////////////////////////////////
+
private static void remove_launcher(string id) {
string launcher = Paths.launchers + "/%s.desktop".printf(id);
if (FileUtils.test(launcher, FileTest.EXISTS)) {
@@ -54,6 +54,12 @@ public class BindingManager : GLib.Object {
Gdk.ModifierType.MOD2_MASK|Gdk.ModifierType.LOCK_MASK|Gdk.ModifierType.MOD5_MASK
};
+ /////////////////////////////////////////////////////////////////////
+ /// Some variables to remember which delayed binding was delayed.
+ /// When the delay passes without another event indicating that the
+ /// Trigger was released, the stored binding will be activated.
+ /////////////////////////////////////////////////////////////////////
+
private uint32 delayed_count = 0;
private X.Event? delayed_event = null;
private Keybinding? delayed_binding = null;
@@ -25,7 +25,7 @@ public class FocusGrabber : GLib.Object {
/////////////////////////////////////////////////////////////////////
/// Utilities for grabbing focus.
- /// Code from Gnome-Do/Synapse.
+ /// Code roughly from Gnome-Do/Synapse.
/////////////////////////////////////////////////////////////////////
public static void grab(Gdk.Window window, bool keyboard = true, bool pointer = true, bool owner_events = true) {
@@ -44,7 +44,7 @@ public class FocusGrabber : GLib.Object {
}
/////////////////////////////////////////////////////////////////////
- /// Code from Gnome-Do/Synapse.
+ /// Code roughly from Gnome-Do/Synapse.
/////////////////////////////////////////////////////////////////////
public static void ungrab(bool keyboard = true, bool pointer = true) {
@@ -70,7 +70,7 @@ public class FocusGrabber : GLib.Object {
}
/////////////////////////////////////////////////////////////////////
- /// Code from Gnome-Do/Synapse.
+ /// Code roughly from Gnome-Do/Synapse.
/////////////////////////////////////////////////////////////////////
private static bool try_grab_window(Gdk.Window window, bool keyboard, bool pointer, bool owner_events) {

0 comments on commit 0204497

Please sign in to comment.