granite-0.1.0/lib/GtkPatch/gtkpatch-utils.h000664 001751 001751 00000000144 11715546243 021745 0ustar00xapantuxapantu000000 000000 #include #include gchar *add_credits_section (gchar *title, gchar **people); granite-0.1.0/lib/GtkPatch/AboutDialog.vala000664 001751 001751 00000036666 11715546243 021712 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Adrien Plazas // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // // Authors: // Adrien Plazas // Artists: // Daniel Foré // using Gtk; using Gdk; public class Granite.GtkPatch.AboutDialog : Gtk.Dialog { /** * The people who contributed artwork to the program, as a null-terminated array of strings. */ public string[] artists { set { _artists = value; if (_artists == null || _artists.length == 0) { artists_label.hide(); artists_label.set_text(""); } else { artists_label.set_markup(set_string_from_string_array("Designed by" + ":\n", _artists)); artists_label.show(); } } get { return _artists; } } string[] _artists = new string[0]; /** * The authors of the program, as a null-terminated array of strings. */ public string[] authors { set { _authors = value; if (_authors == null || _authors.length == 0) { authors_label.hide(); authors_label.set_text(""); } else { authors_label.set_markup(set_string_from_string_array("Written by" + ":\n", _authors)); authors_label.show(); } } get { return _authors; } } string[] _authors = new string[0]; /** * Comments about the program. */ public string comments { set { _comments = value; if (_comments == null || _comments == "") { comments_label.hide(); comments_label.set_text(""); } else { comments_label.set_text(_comments + "\n"); comments_label.show(); } } get { return _comments; } } string _comments = ""; /** * Copyright information for the program. */ public string copyright { set { _copyright = value; if (_copyright == null || _copyright == "") { copyright_label.hide(); copyright_label.set_text(""); } else { copyright_label.set_markup("Copyright © " + _copyright.replace("&", "&") + "\n"); copyright_label.show(); } } get { return _copyright; } } string _copyright = ""; /** * The people documenting the program, as a null-terminated array of strings. */ public string[] documenters { set { _documenters = value; if (documenters.length == 0 || documenters == null) documenters_label.hide(); else { documenters_label.show(); documenters_label.set_markup(set_string_from_string_array("Documented by:\n", documenters)); } } get { return _documenters; } } string[] _documenters = new string[0]; /** * The license of the program. */ public string license { set { _license = value; update_license(); } get { return _license; } } string _license = ""; public License license_type { set { _license_type = value; update_license(); } get { return _license_type; } } License _license_type = License.UNKNOWN; /** * A logo for the about box. */ public Pixbuf logo { set { _logo = value; update_logo_image(); } get { return _logo; } } Pixbuf _logo = null; /** * A named icon to use as the logo for the about box. */ public string logo_icon_name { set { _logo_icon_name = value; update_logo_image(); } get { return _logo_icon_name; } } string _logo_icon_name = ""; /** * The name of the program. */ public string program_name { set { _program_name = value; set_name_and_version(); } get { return _program_name; } } string _program_name = ""; /** * Credits to the translators. */ public string translator_credits { set { _translator_credits = value; if (_translator_credits == null || _translator_credits == "") { translators_label.hide(); translators_label.set_text(""); } else { translators_label.set_markup("Translated by " + _translator_credits.replace("&", "&") + "\n"); translators_label.show(); } } get { return _translator_credits; } } string _translator_credits = ""; /** * The version of the program. */ public string version { set { _version = value; set_name_and_version(); } get { return _version; } } string _version = ""; /** * The URL for the link to the website of the program. */ public string website { set { _website = value; update_website(); } get { return _website; } } string _website = ""; /** * The label for the link to the website of the program. */ public string website_label { set { _website_label = value; update_website(); } get { return _website_label; } } string _website_label = ""; // Signals public virtual signal bool activate_link (string uri) { // Improve error management FIXME bool result = false; if (uri != null) { try { result = Gtk.show_uri(get_screen(), uri, Gtk.get_current_event_time()); } catch (Error err) { stderr.printf ("Unable to open the URI: %s", err.message); } } return result; } // UI elements private Image logo_image; private Label name_label; private Label copyright_label; private Label comments_label; private Label authors_label; private Label artists_label; private Label documenters_label; private Label translators_label; private Label license_label; private Label website_url_label; private Button close_button; // Set the markup used for big text (program name and version) private const string BIG_TEXT_MARKUP_START = ""; private const string BIG_TEXT_MARKUP_END = ""; private const string STYLESHEET = """ * { -GtkDialog-action-area-border: 12; -GtkDialog-button-spacing: 10; -GtkDialog-content-area-border: 0; } """; /** * Creates a new Granite.AboutDialog */ public AboutDialog() { title = ""; has_resize_grip = false; resizable = false; deletable = false; // Hide the window's close button when possible set_default_response(ResponseType.CANCEL); var style_provider = new CssProvider (); try { style_provider.load_from_data (STYLESHEET, -1); } catch (Error e) { warning ("GraniteAboutDialog: %s. The widget will not look as intended.", e.message); } get_style_context().add_provider(style_provider, STYLE_PROVIDER_PRIORITY_APPLICATION); // Set the default containers Box content_area = (Box)get_content_area(); Box action_area = (Box)get_action_area(); var content_hbox = new Box(Orientation.HORIZONTAL, 12); var content_right_box = new Box(Orientation.VERTICAL, 0); var content_scrolled = new ScrolledWindow(null, new Adjustment(0, 0, 100, 1, 10, 0)); var content_scrolled_vbox = new Box(Orientation.VERTICAL, 0); var title_vbox = new Box(Orientation.VERTICAL, 0); var logo_vbox = new Box(Orientation.VERTICAL, 0); content_scrolled.shadow_type = ShadowType.NONE; content_scrolled.hscrollbar_policy = PolicyType.NEVER; content_scrolled.vscrollbar_policy = PolicyType.AUTOMATIC; content_area.pack_start(content_hbox, true, true, 0); logo_image = new Image(); logo_vbox.pack_start(logo_image, false, false, 12); logo_vbox.pack_end(new Box(Orientation.VERTICAL, 0), true, true, 0); // Adjust sizes content_hbox.height_request = 160; content_scrolled_vbox.width_request = 288; logo_image.set_size_request(128, 128); name_label = new Label(""); name_label.halign = Gtk.Align.START; name_label.set_line_wrap(true); name_label.set_selectable(true); copyright_label = new Label(""); copyright_label.set_selectable(true); copyright_label.halign = Gtk.Align.START; copyright_label.set_line_wrap(true); comments_label = new Label(""); comments_label.set_selectable(true); comments_label.halign = Gtk.Align.START; comments_label.set_line_wrap(true); authors_label = new Label(""); authors_label.set_selectable(true); authors_label.halign = Gtk.Align.START; authors_label.set_line_wrap(true); artists_label = new Label(""); artists_label.set_selectable(true); artists_label.halign = Gtk.Align.START; artists_label.set_line_wrap(true); documenters_label = new Label(""); documenters_label.set_selectable(true); documenters_label.halign = Gtk.Align.START; documenters_label.set_line_wrap(true); translators_label = new Label(""); translators_label.set_selectable(true); translators_label.halign = Gtk.Align.START; translators_label.set_line_wrap(true); license_label = new Widgets.WrapLabel(""); license_label.set_selectable(true); website_url_label = new Label(""); website_url_label.halign = Gtk.Align.START; website_url_label.set_line_wrap(true); // left and right padding content_hbox.pack_start(new Box(Orientation.VERTICAL, 0), false, false, 0); content_hbox.pack_end(new Box(Orientation.VERTICAL, 0), false, false, 0); content_hbox.pack_start(logo_vbox); content_hbox.pack_start(content_right_box); content_scrolled.add_with_viewport(content_scrolled_vbox); title_vbox.pack_start(name_label, false, false, 12); //FIXME content_right_box.pack_start(title_vbox, false, false, 0); content_right_box.pack_start(content_scrolled, true, true, 0); // Extra padding between the scrolled window and the action area content_right_box.pack_end(new Box(Orientation.VERTICAL, 0), false, false, 6); content_scrolled_vbox.pack_start(comments_label); content_scrolled_vbox.pack_start(website_url_label); content_scrolled_vbox.pack_start(copyright_label); content_scrolled_vbox.pack_start(license_label); content_scrolled_vbox.pack_start(authors_label); content_scrolled_vbox.pack_start(artists_label); content_scrolled_vbox.pack_start(documenters_label); content_scrolled_vbox.pack_start(translators_label); close_button = new Button.from_stock(Stock.CLOSE); close_button.clicked.connect(() => { response(ResponseType.CANCEL); }); action_area.pack_end (close_button, false, false, 0); show_all(); close_button.grab_focus(); } private string set_string_from_string_array(string title, string[] peoples) { string text = title; text += add_credits_section (title, peoples); return text; } private void update_logo_image() { try { logo_image.set_from_pixbuf(IconTheme.get_default ().load_icon ("application-default-icon", 128, 0)); } catch (Error err) { stderr.printf ("Unable to load terminal icon: %s", err.message); } if (logo_icon_name != null && logo_icon_name != "") { try { logo_image.set_from_pixbuf(IconTheme.get_default ().load_icon (logo_icon_name, 128, 0)); } catch (Error err) { stderr.printf ("Unable to load terminal icon: %s", err.message); } } else if (logo != null) logo_image.set_from_pixbuf(logo); } private void update_license() { switch (license_type) { case License.GPL_2_0: set_generic_license("http://www.gnu.org/licenses/old-licenses/gpl-2.0.html", "gpl-2.0"); break; case License.GPL_3_0: set_generic_license("http://www.gnu.org/licenses/gpl.html", "gpl"); break; case License.LGPL_2_1: set_generic_license("http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html", "lgpl-2.1"); break; case License.LGPL_3_0: set_generic_license("http://www.gnu.org/licenses/lgpl.html", "lgpl"); break; case License.BSD: set_generic_license("http://opensource.org/licenses/bsd-license.php", "bsd"); break; case License.MIT_X11: set_generic_license("http://opensource.org/licenses/mit-license.php", "mit"); break; case License.ARTISTIC: set_generic_license("http://opensource.org/licenses/artistic-license-2.0.php", "artistic"); break; default: if (license != null && license != "") { license_label.set_markup(license + "\n"); license_label.show(); } else license_label.hide(); break; } } private void set_generic_license(string url, string license_type) { license_label.set_markup("This program is published under the terms of the " + license_type + " license, it comes with ABSOLUTELY NO WARRANTY; for details, visit " + url + "\n"); license_label.show(); } private void set_name_and_version() { if (program_name != null && program_name != "") { name_label.set_text(program_name); if (version != null && version != "") name_label.set_text(name_label.get_text() + " " + version); name_label.set_markup(BIG_TEXT_MARKUP_START + name_label.get_text().replace("&", "&") + BIG_TEXT_MARKUP_END); name_label.show(); } else name_label.hide(); } private void update_website() { if (website != null && website != "") { if (website != null && website != "") { website_url_label.set_markup("" + website_label.replace("&", "&") + "\n"); } else website_url_label.set_markup("" + website + "\n"); website_url_label.show(); } else website_url_label.hide(); } } granite-0.1.0/lib/GtkPatch/gtkpatch-utils.c000664 001751 001751 00000010021 11715546243 021733 0ustar00xapantuxapantu000000 000000 /* GTK - The GIMP Toolkit * Copyright (C) 2001 CodeFactory AB * Copyright (C) 2001, 2002 Anders Carlsson * Copyright (C) 2003, 2004 Matthias Clasen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* * Author: Anders Carlsson * * Modified by the GTK+ Team and others 1997-2004. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #include "gtkpatch-utils.h" gchar * add_credits_section (gchar *title, gchar **people) { gchar **p; gchar *q0, *q1, *q2, *r1, *r2; if (people == NULL) return; GString *str; str = g_string_new (""); for (p = people; *p; p++) { q0 = *p; while (*q0) { q1 = strchr (q0, '<'); q2 = q1 ? strchr (q1, '>') : NULL; r1 = strstr (q0, "http://"); if (r1) { r2 = strpbrk (r1, " \n\t"); if (!r2) r2 = strchr (r1, '\0'); } else r2 = NULL; if (r1 && r2 && (!q1 || !q2 || (r1 < q1))) { q1 = r1; q2 = r2; } else if (q1 && (q1[1] == 'a' || q1[1] == 'A') && q1[2] == ' ') { /* if it is a link leave it for the label to parse */ q1 = NULL; } if (q1 && q2) { gchar *link; gchar *text; gchar *name; if (*q1 == '<') { /* email */ gchar *escaped; text = g_strstrip (g_strndup (q0, q1 - q0)); name = g_markup_escape_text (text, -1); q1++; link = g_strndup (q1, q2 - q1); q2++; escaped = g_uri_escape_string (link, NULL, FALSE); g_string_append_printf (str, "%s", escaped, name[0] ? name : link); g_free (escaped); g_free (link); g_free (text); g_free (name); } else { /* uri */ text = g_strstrip (g_strndup (q0, q1 - q0)); name = g_markup_escape_text (text, -1); link = g_strndup (q1, q2 - q1); g_string_append_printf (str, "%s", link, name[0] ? name : link); g_free (link); g_free (text); g_free (name); } q0 = q2; } else { g_string_append (str, q0); break; } } g_string_append (str, "\n"); } g_string_append (str, ""); gchar *result = strdup (str->str); g_string_free (str, TRUE); return result; } granite-0.1.0/lib/GtkPatch/gtkpatch-utils.vapi000664 001751 001751 00000000110 11715546243 022446 0ustar00xapantuxapantu000000 000000 private string add_credits_section (string title, string[] people); granite-0.1.0/lib/granite.pc.cmake000664 001751 001751 00000000431 11715546243 020157 0ustar00xapantuxapantu000000 000000 prefix=@PREFIX@ exec_prefix=@DOLLAR@{prefix} libdir=@DOLLAR@{prefix}/lib includedir=@DOLLAR@{prefix}/include Name: @PKGNAME@ Description: Granite framework Version: @GRANITE_VERSION@ Libs: -L@DOLLAR@{libdir} -lgranite Cflags: -I@DOLLAR@{includedir}/${PKGNAME} Requires: gtk+-3.0 granite-0.1.0/lib/Widgets/widgets-utils.h000664 001751 001751 00000000346 11715546243 021513 0ustar00xapantuxapantu000000 000000 #include #include void granite_widgets_show_about_dialog (GtkWindow *parent, const gchar *first_property_name, ...); granite-0.1.0/lib/Widgets/PopOver.vala000664 001751 001751 00000037250 11715546243 021001 0ustar00xapantuxapantu000000 000000 /* * Copyright (c) 2011 Lucas Baudin * * This is a free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ /** * /!\ Unstable API * * PopOver widget. It is a Dialog you can attach to a widget, e.g. a button. * * It is a dialog you can attach to a widget, to make it look * more consistent, and easier to understand. e.g. if you need to make a popup * after clicking on a button as "Create a new document" to choose the type * of the document, a popover is more adapted because you can see which button * is related to the button, etc... It is also less agressive than a usual * dialog because it doesn't hide a big part of the screen. And it is closed * when it lose focus. * * {{images/popover.png}} * **/ public class Granite.Widgets.PopOver : Gtk.Dialog { protected int BORDER_RADIUS; protected int BORDER_WIDTH; protected int SHADOW_SIZE; protected int ARROW_HEIGHT; protected int ARROW_WIDTH; protected Gtk.Border PADDINGS; double offset = 15.0; const int MARGIN = 12; new bool is_composited; Gtk.Widget menu; static Gtk.CssProvider style_provider; Gtk.Box hbox; Gtk.Box abox; public enum PopPosition { TOPLEFT, TOPRIGHT, BOTTOMLEFT, BOTTOMRIGHT } private const string POPOVER_STYLESHEET = """ .composited { background-color: rgba (0, 0, 0, 0.0); } """; PopPosition pos = PopPosition.TOPRIGHT; protected bool arrow_up = false; protected double arrow_offset = 35.0; static construct { install_style_property (new GLib.ParamSpecInt ("border-radius", "Border radius", "Border radius of the popover", 0, 50, 8, ParamFlags.READABLE)); install_style_property (new GLib.ParamSpecInt ("border-width", "Border width", "Width of the popover's outer border", 0, 8, 1, ParamFlags.READABLE)); install_style_property (new GLib.ParamSpecInt ("shadow-size", "Shadow size", "Size of the popover's shadow", 4, 50, 20, ParamFlags.READABLE)); install_style_property (new GLib.ParamSpecInt ("arrow-height", "Arrow height", "Height of the popover's arrow", 0, 50, 14, ParamFlags.READABLE)); install_style_property (new GLib.ParamSpecInt ("arrow-width", "Arrow width", "Width of the popover's arrow", 0, 50, 30, ParamFlags.READABLE)); } construct { /* Are we composited? */ is_composited = Gdk.Screen.get_default ().is_composited (); if(is_composited) { // Set up css provider style_provider = new Gtk.CssProvider (); try { style_provider.load_from_data (POPOVER_STYLESHEET, -1); } catch (Error e) { warning ("GranitePopOver: %s. The widget will not look as intended.", e.message); } // Window properties set_visual (get_screen ().get_rgba_visual()); get_style_context ().add_class ("popover"); get_style_context ().add_class ("composited"); get_style_context ().add_provider_for_screen (get_screen(), style_provider, 600); } app_paintable = true; decorated = false; resizable = false; set_position(Gtk.WindowPosition.NONE); set_type_hint(Gdk.WindowTypeHint.MENU); skip_pager_hint = true; skip_taskbar_hint = true; } /** * Create a new PopOver **/ public PopOver() { modal = true; hbox = get_content_area() as Gtk.Box; abox = get_action_area() as Gtk.Box; menu = new Gtk.Window(); style_get ("border-radius", out BORDER_RADIUS, "border-width", out BORDER_WIDTH, "shadow-size", out SHADOW_SIZE, "arrow-height", out ARROW_HEIGHT, "arrow_width", out ARROW_WIDTH, null); if (!is_composited) { SHADOW_SIZE = 0; /* we don't need an extra space for the shadow since we won't show it */ } PADDINGS = get_style_context ().get_margin (Gtk.StateFlags.NORMAL); hbox.set_margin_top(PADDINGS.top + ARROW_HEIGHT + SHADOW_SIZE + 5); hbox.set_margin_left(PADDINGS.left + SHADOW_SIZE + 5); hbox.set_margin_right(PADDINGS.right + SHADOW_SIZE + 5); abox.set_margin_left(PADDINGS.left + SHADOW_SIZE + 5); abox.set_margin_right(PADDINGS.right + SHADOW_SIZE + 5); abox.set_margin_bottom(PADDINGS.bottom + SHADOW_SIZE + 5); menu.get_style_context().add_class("popover_bg"); size_allocate.connect(on_size_allocate); focus_out_event.connect_after((f) => { foreach(Gtk.Window window in Gtk.Window.list_toplevels()) { if((window.type_hint == Gdk.WindowTypeHint.POPUP_MENU || window.type_hint == Gdk.WindowTypeHint.MENU) && window.visible && window != this) { return false; } } hide (); return false; }); hide.connect( () => { response(Gtk.ResponseType.CANCEL); }); } /* May be null if the screen is not composited */ protected Granite.Drawing.BufferSurface? main_buffer = null; protected void reset_buffers () { main_buffer = null; } /** * Set the parent window of the popover. It should not be needed, but it * could solve some bugs on some window manager. **/ public void set_parent_pop (Gtk.Window win) { set_transient_for(win); set_parent(win); win.configure_event.connect( () => { hide(); return true; }); } void compute_pop_position(Gdk.Screen screen, Gdk.Rectangle rect) { Gdk.Rectangle monitor_geo; var old_pos = pos; screen.get_monitor_geometry (screen.get_monitor_at_point (rect.x, rect.y), out monitor_geo); if(rect.x > monitor_geo.x + monitor_geo.width/2) { /* left */ if(rect.y < monitor_geo.y + monitor_geo.height/2) { pos = PopPosition.TOPRIGHT; } else { pos = PopPosition.BOTTOMRIGHT; } } else { if(rect.y < monitor_geo.y + monitor_geo.height/2) { pos = PopPosition.TOPLEFT; } else { pos = PopPosition.BOTTOMLEFT; } } switch(pos) { case PopPosition.BOTTOMRIGHT: arrow_up = false; win_x = rect.x - get_allocated_width() + 2*SHADOW_SIZE + ARROW_WIDTH/2 + rect.width / 2; win_y = rect.y - get_allocated_height() + SHADOW_SIZE; arrow_offset = get_allocated_width() - 2*SHADOW_SIZE - 30.0; break; case PopPosition.TOPRIGHT: arrow_up = true; win_x = rect.x - get_allocated_width() + 2*SHADOW_SIZE + ARROW_WIDTH/2 + rect.width / 2; win_y = rect.y - SHADOW_SIZE + rect.height; arrow_offset = get_allocated_width() - 2*SHADOW_SIZE - 30.0; break; case PopPosition.TOPLEFT: arrow_up = true; win_x = rect.x - 30 - SHADOW_SIZE - ARROW_WIDTH/2 + rect.width / 2; win_y = rect.y - SHADOW_SIZE + rect.height; arrow_offset = SHADOW_SIZE + 30.0; break; case PopPosition.BOTTOMLEFT: arrow_up = false; win_x = rect.x - 30 - SHADOW_SIZE - ARROW_WIDTH/2 + rect.width / 2; win_y = rect.y - get_allocated_height() + SHADOW_SIZE; arrow_offset = SHADOW_SIZE + 30.0; break; default: break; } if (arrow_up) { hbox.set_margin_top(PADDINGS.top + SHADOW_SIZE + ARROW_HEIGHT + 5); abox.set_margin_bottom(PADDINGS.bottom + SHADOW_SIZE); } else { hbox.set_margin_top(PADDINGS.top + SHADOW_SIZE + 5); abox.set_margin_bottom(PADDINGS.bottom + SHADOW_SIZE + ARROW_HEIGHT); } if(old_pos != pos) { compute_shadow (get_allocated_width (), get_allocated_height ()); } if(is_composited) { var w = get_allocated_width (); var h = get_allocated_height (); h -= 2* (PADDINGS.top + SHADOW_SIZE) + ARROW_HEIGHT; w -= 2*(PADDINGS.right + SHADOW_SIZE); get_window ().input_shape_combine_region (new Cairo.Region.rectangle({0, 0, w, h}), PADDINGS.right + SHADOW_SIZE, PADDINGS.top + SHADOW_SIZE + (arrow_up ? ARROW_HEIGHT : 0)); } } int win_x; int win_y; /** * Change the position of the popover, to display it under w. * * The arrow of the PopOver is moved at the bottom of the widget, and it is * horizontally centered. * * @param w a normal Gtk.Widget, e.g. a button **/ public void move_to_widget (Gtk.Widget w) { int x, y; Gdk.Rectangle rectangle = Gdk.Rectangle (); bool is_visible_window = false; if (w is Gtk.EventBox) { is_visible_window = (w as Gtk.EventBox).visible_window; (w as Gtk.EventBox).visible_window = false; } w.get_window ().get_origin (out x, out y); Gtk.Allocation alloc; w.get_allocation (out alloc); if(w is Gtk.EventBox) { (w as Gtk.EventBox).visible_window = is_visible_window; } x += alloc.x; y += alloc.y; rectangle.x = x; rectangle.y = y; rectangle.width = alloc.width; rectangle.height = alloc.height; show_all(); compute_pop_position (w.get_screen (), rectangle); move(win_x, win_y); set_parent_pop(w.get_toplevel() as Gtk.Window); } public void move_to_coords (int x, int y) { show_all(); Gdk.Rectangle rect = Gdk.Rectangle (); rect.x = x; rect.y = y; rect.width = 1; rect.height = 1; compute_pop_position (get_screen (), rect); move(win_x, win_y); } /** * Move the popover to the coordinates of the given Gdk.Rectangle and * position it acording to the width and height of the rectangle. **/ public void move_to_rect (Gdk.Rectangle rect) { show_all(); compute_pop_position (get_screen (), rect); move(win_x, win_y); } /** * Move the popover to the Gdk.Window window. The recommand method is * move_to_widget, but this one can be used when we don't know which widget * triggered the action (e.g. with a Gtk.Action). **/ public void move_to_window(Gdk.Window window) { int x, y; window.get_root_origin(out x, out y); window.get_origin(out x, out y); x += window.get_width()/2 - MARGIN - SHADOW_SIZE - (int)offset; y += window.get_height() - SHADOW_SIZE; show_all(); show_now(); move(x, y); } protected void cairo_popover (Cairo.Context cr, double x, double y, double width, double height) { // Start with rounded rectangle as base Granite.Drawing.Utilities.cairo_rounded_rectangle (cr, x, (arrow_up) ? y + ARROW_HEIGHT : y, width, height - ARROW_HEIGHT, BORDER_RADIUS); // Draw arrow if (arrow_up) { cr.move_to (arrow_offset, y + ARROW_HEIGHT); cr.rel_line_to (ARROW_WIDTH / 2.0, -ARROW_HEIGHT); cr.rel_line_to (ARROW_WIDTH / 2.0, ARROW_HEIGHT); } else { cr.move_to (arrow_offset, y + height - ARROW_HEIGHT); cr.rel_line_to (ARROW_WIDTH / 2.0, ARROW_HEIGHT); cr.rel_line_to (ARROW_WIDTH / 2.0, -ARROW_HEIGHT); } cr.close_path (); } int old_w = 0; int old_h = 0; void compute_shadow (int w, int h) { if(!is_composited) { return; } main_buffer = new Granite.Drawing.BufferSurface (w, h); // Shadow first cairo_popover (main_buffer.context, SHADOW_SIZE + BORDER_WIDTH / 2.0, SHADOW_SIZE + BORDER_WIDTH / 2.0, w - SHADOW_SIZE * 2 - BORDER_WIDTH, h - SHADOW_SIZE * 2 - BORDER_WIDTH); main_buffer.context.set_source_rgba (0.0, 0.0, 0.0, 0.4); main_buffer.context.fill_preserve (); main_buffer.exponential_blur (SHADOW_SIZE / 2 - 1); // rough approximation // Outer border main_buffer.context.set_operator (Cairo.Operator.SOURCE); main_buffer.context.set_line_width (BORDER_WIDTH); Gdk.cairo_set_source_rgba (main_buffer.context, get_style_context ().get_border_color (Gtk.StateFlags.NORMAL)); main_buffer.context.stroke_preserve (); // Background main_buffer.context.clip (); Gtk.render_background (menu.get_style_context (), main_buffer.context, SHADOW_SIZE, SHADOW_SIZE, w - 2 * SHADOW_SIZE, h - 2 * SHADOW_SIZE); if(is_composited) { h -= 2* (PADDINGS.top + SHADOW_SIZE) + ARROW_HEIGHT; w -= 2*(PADDINGS.right + SHADOW_SIZE); if(get_window () != null) get_window ().input_shape_combine_region (new Cairo.Region.rectangle({0, 0, w, h}), PADDINGS.right + SHADOW_SIZE, PADDINGS.top + SHADOW_SIZE + (arrow_up ? ARROW_HEIGHT : 0)); } } void on_size_allocate(Gtk.Allocation alloc) { int w = get_allocated_width(); int h = get_allocated_height(); if(old_w == w && old_h == h) return; compute_shadow (w, h); old_w = w; old_h = h; } public override bool draw(Cairo.Context cr) { if (is_composited) { cr.set_source_surface(main_buffer.surface, 0, 0); cr.paint_with_alpha(1.0); } else { cr.rectangle (0, 0, get_allocated_width (), get_allocated_height ()); cr.set_source_rgba (0, 0, 0, 0.3); cr.set_line_width(1); cr.stroke (); } return base.draw(cr); } } granite-0.1.0/lib/Widgets/ContractorView.vala000664 001751 001751 00000015754 11715546243 022365 0ustar00xapantuxapantu000000 000000 /* * Copyright (c) 2012 Tom Beckmann * * This is a free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ using Gtk; public class Granite.Widgets.ContractorView : TreeView { /** * indicates if it was possible to connect to contractor **/ public bool contractor_available; public delegate void ContractCallback (); private Gee.HashMap outsiders; private int[] blacklisted_pos; private ListStore list; private struct DelegateWrapper {ContractCallback method;} /** * the index of the currently selected contract **/ public int selected { get { TreePath path; this.get_cursor (out path, null); return int.parse (path.to_string ()); } set { this.set_cursor (new TreePath.from_string (value.to_string ()), null, false); } } /** * the original array of contracts returned by contractor **/ HashTable[] contracts; /** * Create the default ContractorView * @param filename the file * @param mime the mimetype of the file * @param icon_size the size of the icon in pixel * @param show_contract_name show the name of the contract in the list **/ public ContractorView (string filename, string mime, int icon_size = 32, bool show_contract_name = true) { /* Setup the ListStore */ list = new ListStore (2, typeof (Gdk.Pixbuf), typeof (string)); outsiders = new Gee.HashMap (); this.model = list; /* GUI */ this.headers_visible = false; this.hexpand = true; /* Events */ row_activated.connect(() => { run_selected(); }); /* View */ var cell1 = new CellRendererPixbuf (); cell1.set_padding (5, 8); this.insert_column_with_attributes (-1, "", cell1, "pixbuf", 0); var cell2 = new CellRendererText (); cell2.set_padding (2, 8); this.insert_column_with_attributes (-1, "", cell2, "markup", 1); this.contracts = Granite.Services.Contractor.get_contract (filename, mime); if (this.contracts == null || this.contracts.length == 0) { warning ("You should install contractor (or no contracts found for this mime).\n"); contractor_available = false; TreeIter it; list.append (out it); bool contractor_installed = this.contracts == null; string message = contractor_installed ? _("Could not contact Contractor. You may need to install it") : _("No action found for this file"); try { var icon = IconTheme.get_default ().load_icon ( contractor_installed ? Gtk.Stock.DIALOG_ERROR : Gtk.Stock.DIALOG_INFO, icon_size, 0); list.set (it, 0, icon, 1, message); } catch (Error e) { warning("%s\n", e.message); } set_sensitive(false); } else { contractor_available = true; for (var i=0; i\n"+text; try{ list.set (it, 0, IconTheme.get_default ().load_icon (this.contracts[i].lookup ("IconName"), icon_size, 0), 1, text); } catch (Error e) { error (e.message); } } this.selected = 0; } } /** * A method to add items to the tree * @param name the name * @param text the description * @param icon_name the name of the icon to show * @param icon_size the size of the icon in pixel * @param position the posion the item will be inserted at (first position is 0) * @param method a general method containing all the methods that should be called when the item is activated * (must return void and mustn't have any parameter) **/ public void add_item (string name, string desc, string icon_name, int icon_size, int position, ContractCallback method) { TreeIter it; list.insert (out it, position); string text = "" + name + "\n" + desc; try{ list.set (it, 0, IconTheme.get_default ().load_icon (icon_name, icon_size, 0), 1, text); } catch (Error e) { error (e.message); } DelegateWrapper wr = {method}; outsiders[position] = wr; this.selected = 0; } public void name_blacklist (string[] names) { TreeIter it; TreeIter it2; Value value; bool check; int cur_pos = 0; list.get_iter_first (out it); list.get_iter_first (out it2); while (true) { list.get_value (it, 1, out value); check = list.iter_next (ref it2); string text = value.get_string (); if (text[3:text.index_of ("")] in names) { list.remove (it); blacklisted_pos += cur_pos; } if (!check) break; it = it2; cur_pos++; } } public void run_selected () { if (this.selected in outsiders.keys ) { outsiders[this.selected].method (); } else { try { int corr = 0; foreach (int i in outsiders.keys) { //adjust in case of items added if (i > this.selected) break; corr++; } foreach (int i in blacklisted_pos) { //adjust in case of items removed if (i > this.selected) break; corr--; } Process.spawn_command_line_async ( this.contracts[this.selected-corr].lookup ("Exec")); } catch (Error e) { error (e.message); } } } } granite-0.1.0/lib/Widgets/ModeButton.vala000664 001751 001751 00000016027 11715546243 021466 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2008 Christian Hergert // Copyright (C) 2011 Giulio Collura // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Gdk; namespace Granite.Widgets { public class ModeButton : Gtk.Box { public signal void mode_added (int index, Gtk.Widget widget); public signal void mode_removed (int index, Gtk.Widget widget); public signal void mode_changed (Gtk.Widget widget); // Style properties. Please note that style class names are for internal // use only. Theme developers should use GraniteWidgetsModeButton instead. internal static CssProvider style_provider; internal static StyleContext widget_style; private const int style_priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION; private const string STYLESHEET = """ .GraniteModeButton .button { -GtkToolbar-button-relief: normal; border-radius: 0 0 0 0; border-style: solid; border-width: 1 0 1 1; -unico-outer-stroke-width: 1 0 1 0; -unico-outer-stroke-radius: 0 0 0 0; } .GraniteModeButton .button:active, .GraniteModeButton .button:insensitive { -unico-outer-stroke-width: 1 0 1 0; } .GraniteModeButton .button:first-child { border-radius: 3 0 0 3; border-width: 1 0 1 1; -unico-outer-stroke-width: 1 0 1 1; } .GraniteModeButton .button:last-child { border-radius: 0 3 3 0; border-width: 1; -unico-outer-stroke-width: 1 1 1 0; } """; private int _selected = -1; public int selected { get { return _selected; } set { set_active(value); } } public uint n_items { get { return get_children ().length (); } } public ModeButton () { if (style_provider == null) { style_provider = new CssProvider (); try { style_provider.load_from_data (STYLESHEET, -1); } catch (Error e) { warning ("GraniteModeButton: %s. The widget will not look as intended", e.message); } } widget_style = get_style_context (); widget_style.add_class ("GraniteModeButton"); homogeneous = true; spacing = 0; app_paintable = true; set_visual (get_screen ().get_rgba_visual ()); can_focus = true; } public int append_pixbuf (Gdk.Pixbuf? pixbuf) { if (pixbuf == null) { warning ("GraniteWidgetsModeButton: Attempt to add null pixbuf failed."); return -1; } var image = new Image.from_pixbuf (pixbuf); return append (image); } public int append_text (string? text) { if (text == null) { warning ("GraniteWidgetsModeButton: Attempt to add null text string failed."); return -1; } return append (new Gtk.Label(text)); } /** * This is the recommended method for adding icons to the ModeButton widget. * If the name of a symbolic icon is passed, it will be properly themed for * each state of the widget. That is, it will match the foreground color * defined by the theme for each state (active, prelight, insensitive, etc.) */ public int append_icon (string icon_name, Gtk.IconSize size) { return append (new Image.from_icon_name (icon_name, size)); } public int append (Gtk.Widget w) { if (w == null) { warning ("GraniteWidgetsModeButton: Attempt to add null widget failed."); return -1; } var button = new ModeButtonItem (); button.add (w); button.button_press_event.connect (() => { int selected = get_children().index (button); set_active (selected); return true; }); add (button); button.show_all (); int item_index = (int)get_children ().length (); mode_added (item_index, w); // Emit the added signal return item_index; } public void set_active (int new_active_index) { if (new_active_index >= get_children ().length () || _selected == new_active_index) return; if (_selected >= 0) ((ToggleButton) get_children ().nth_data (_selected)).set_active (false); _selected = new_active_index; ((ToggleButton) get_children ().nth_data (_selected)).set_active (true); mode_changed (((ToggleButton) get_children ().nth_data (_selected)).get_child ()); } public void set_item_visible (int index, bool val) { var item = get_children ().nth_data (index); if (item == null) return; item.set_no_show_all (!val); item.set_visible (val); } public new void remove (int index) { mode_removed (index, (get_children ().nth_data (index) as Gtk.Bin).get_child ()); get_children ().nth_data (index).destroy (); } public void clear_children () { foreach (weak Widget button in get_children ()) { button.hide (); if (button.get_parent () != null) base.remove (button); } _selected = -1; } protected override bool scroll_event (EventScroll ev) { if (ev.direction == Gdk.ScrollDirection.DOWN) { selected ++; } else if (ev.direction == Gdk.ScrollDirection.UP) { selected --; } return false; } } private class ModeButtonItem : Gtk.ToggleButton { public ModeButtonItem () { can_focus = false; const int style_priority = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION; get_style_context ().add_class ("raised"); get_style_context ().add_provider (ModeButton.style_provider, style_priority); } } } granite-0.1.0/lib/Widgets/AboutDialog.vala000664 001751 001751 00000010334 11715546243 021573 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Adrien Plazas // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // // Authors: // Adrien Plazas // Artists: // Daniel Foré // using Gtk; namespace Granite.Widgets { public class AboutDialog : Granite.GtkPatch.AboutDialog { /** * The URL for the link to the website of the program. */ public string help { set { _help = value; help_button.sensitive = !(_help == null || _help == ""); } get { return _help; } } string _help = ""; /** * The URL for the link to the website of the program. */ public string translate { set { _translate = value; translate_button.sensitive = !(_translate == null || _translate == ""); } get { return _translate; } } string _translate = ""; /** * The URL for the link to the website of the program. */ public string bug { set { _bug = value; bug_button.sensitive = !(_bug == null || _bug == ""); } get { return _bug; } } string _bug = ""; private Button help_button; private Button translate_button; private Button bug_button; private const string HELP_BUTTON_STYLESHEET = """ .help_button { border-radius: 20; padding: 3; } """; /** * Creates a new Granite.Widgets.AboutDialog */ public AboutDialog() { Box action_area = (Box) get_action_area (); /* help button style */ var help_button_style_provider = new CssProvider(); try { help_button_style_provider.load_from_data(HELP_BUTTON_STYLESHEET, -1); } catch (Error e) { warning ("GraniteWidgetsAboutDialog: %s. Some widgets will not look as intended", e.message); } /* help button */ help_button = new Button.with_label("?"); help_button.get_style_context ().add_class ("help_button"); help_button.get_style_context ().add_provider (help_button_style_provider, STYLE_PROVIDER_PRIORITY_APPLICATION); help_button.halign = Gtk.Align.CENTER; help_button.pressed.connect(() => { activate_link(help); }); /* Circular help button */ help_button.set_size_request (29, -1); action_area.pack_end (help_button, false, false, 0); ((Gtk.ButtonBox) action_area).set_child_secondary (help_button, true); ((Gtk.ButtonBox) action_area).set_child_non_homogeneous (help_button, true); /* translate button */ translate_button = new Button.with_label("Translate this app"); translate_button.pressed.connect ( () => { activate_link(translate); }); action_area.pack_start (translate_button, false, false, 0); /* bug button */ bug_button = new Button.with_label ("Report a problem"); bug_button.pressed.connect (() => { activate_link(bug); }); action_area.pack_start (bug_button, false, false, 0); action_area.reorder_child (bug_button, 0); action_area.reorder_child (translate_button, 0); action_area.show_all (); } } public extern void show_about_dialog (Gtk.Window *parent, ...); } granite-0.1.0/lib/Widgets/widgets-utils.c000664 001751 001751 00000006446 11715546243 021515 0ustar00xapantuxapantu000000 000000 /* GTK - The GIMP Toolkit * Copyright (C) 2001 CodeFactory AB * Copyright (C) 2001, 2002 Anders Carlsson * Copyright (C) 2003, 2004 Matthias Clasen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ /* * Author: Anders Carlsson * * Modified by the GTK+ Team and others 1997-2004. See the AUTHORS * file for a list of people on the GTK+ Team. See the ChangeLog * files for a list of changes. These files are distributed with * GTK+ at ftp://ftp.gtk.org/pub/gtk/. */ #include "widgets-utils.h" static void close_cb (GtkWidget *about) { GtkAboutDialogPrivate *priv = about->priv; gtk_widget_hide (about); } /** * gtk_show_about_dialog: * @parent: (allow-none): transient parent, or %NULL for none * @first_property_name: the name of the first property * @Varargs: value of first property, followed by more properties, %NULL-terminated * * This is a convenience function for showing an application's about box. * The constructed dialog is associated with the parent window and * reused for future invocations of this function. * * Since: 2.6 */ void granite_widgets_show_about_dialog (GtkWindow *parent, const gchar *first_property_name, ...) { static GtkWidget *global_about_dialog = NULL; GtkWidget *dialog = NULL; va_list var_args; if (parent) dialog = g_object_get_data (G_OBJECT (parent), "gtk-about-dialog"); else dialog = global_about_dialog; if (!dialog) { //dialog = gtk_about_dialog_new (); dialog = granite_widgets_about_dialog_new (); g_object_ref_sink (dialog); g_signal_connect (dialog, "delete-event", G_CALLBACK (gtk_widget_hide_on_delete), NULL); /* Close dialog on user response */ g_signal_connect (dialog, "response", G_CALLBACK (close_cb), NULL); va_start (var_args, first_property_name); g_object_set_valist (G_OBJECT (dialog), first_property_name, var_args); va_end (var_args); if (parent) { gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); gtk_window_set_transient_for (GTK_WINDOW (dialog), parent); gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); g_object_set_data_full (G_OBJECT (parent), "gtk-about-dialog", dialog, g_object_unref); } else global_about_dialog = dialog; } gtk_window_present (GTK_WINDOW (dialog)); } granite-0.1.0/lib/Widgets/StaticNotebook.vala000664 001751 001751 00000007021 11715546243 022330 0ustar00xapantuxapantu000000 000000 /* * Copyright (c) 2011 Lucas Baudin * * This is a free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ namespace Granite.Widgets { public class StaticNotebook : Gtk.Box { private Gtk.Notebook notebook; private ModeButton switcher; private Gtk.Box switcher_box; /* The page switcher will NEVER be shown if this property is set to true */ private bool switcher_hidden; public int page { set { switcher.selected = value; notebook.page = value; } get { return notebook.page; } } public signal void page_changed (int index); public StaticNotebook () { orientation = Gtk.Orientation.VERTICAL; switcher_hidden = false; notebook = new Gtk.Notebook(); notebook.show_tabs = false; switcher = new ModeButton(); switcher_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0); var left_separator = new Gtk.Separator(Gtk.Orientation.HORIZONTAL); var right_separator = new Gtk.Separator(Gtk.Orientation.HORIZONTAL); switcher_box.pack_start(left_separator, true, true); switcher_box.pack_start(switcher, false, false); switcher_box.pack_end(right_separator, true, true); switcher.set_margin_top(5); switcher.set_margin_bottom(5); pack_start(switcher_box, false, false); pack_start(notebook); switcher.mode_changed.connect(on_mode_changed); } public void set_switcher_visible (bool val) { switcher_box.set_no_show_all(!val); switcher_hidden = !val; update_switcher_visibility(); } public void append_page (Gtk.Widget widget, Gtk.Label label) { notebook.append_page(widget, null); label.set_margin_right(5); label.set_margin_left(5); switcher.append(label); if(switcher.selected == -1) switcher.selected = 0; update_switcher_visibility(); } void on_mode_changed (Gtk.Widget widget) { notebook.page = switcher.selected; page_changed(notebook.page); } public void remove_page (int number) { notebook.remove_page(number); switcher.remove(number); update_switcher_visibility(); } void update_switcher_visibility () { if (switcher_hidden) { switcher_box.hide(); return; } // Don't show tabs if there's only one page bool switcher_visible = notebook.get_n_pages() > 1; switcher_box.set_no_show_all (!switcher_visible); if (switcher_visible) switcher_box.show_all(); else switcher_box.hide(); } } } granite-0.1.0/lib/Widgets/DatePicker.vala000664 001751 001751 00000006611 11715546243 021417 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Maxwell Barvian // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Gdk; namespace Granite.Widgets { public class DatePicker : Gtk.Entry, Gtk.Buildable { public string format { get; construct; default = _("%B %e, %Y"); } protected Gtk.EventBox dropdown; protected Calendar calendar; PopOver popover; private DateTime _date; public DateTime date { get { return _date; } set { _date = value; text = _date.format (format); } } construct { dropdown = new Gtk.EventBox(); popover = new PopOver(); ((Gtk.Box)popover.get_content_area()).add(dropdown); calendar = new Calendar (); date = new DateTime.now_local (); // Entry properties can_focus = false; editable = false; // user can't edit the entry directly secondary_icon_gicon = new ThemedIcon.with_default_fallbacks ("office-calendar-symbolic"); dropdown.add_events (EventMask.FOCUS_CHANGE_MASK); dropdown.add (calendar); // Signals and callbacks icon_release.connect (on_icon_press); calendar.day_selected_double_click.connect (on_calendar_day_selected); } public DatePicker.with_format (string format) { Object (format: format); } private void on_icon_press (EntryIconPosition position) { int x, y; position_dropdown (out x, out y); popover.show_all (); popover.move_to_coords (x, y); popover.present(); calendar.grab_focus (); } protected virtual void position_dropdown (out int x, out int y) { Allocation size; Requisition calendar_size; get_allocation (out size); calendar.get_preferred_size (out calendar_size, null); get_window ().get_origin (out x, out y); x += size.x + size.width - 10; //size.x - (calendar_size.width - size.width); y += size.y + size.height; //x = x.clamp (0, int.max (0, Screen.width () - calendar_size.width)); //y = y.clamp (0, int.max (0, Screen.height () - calendar_size.height)); } private void on_calendar_day_selected () { date = new DateTime.local (calendar.year, calendar.month + 1, calendar.day, 0, 0, 0); hide_dropdown (); } private void hide_dropdown () { popover.hide (); } } } granite-0.1.0/lib/Widgets/CompositedWindow.vala000664 001751 001751 00000003243 11715546243 022700 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Maxwell Barvian // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Gdk; namespace Granite.Widgets { public class CompositedWindow : Gtk.Window, Gtk.Buildable { private CssProvider style_provider; private const string COMPOSITED_WINDOW_STYLESHEET = """ .composited { background-color: rgba (0, 0, 0, 0.0); } """; construct { // Set up css provider style_provider = new CssProvider (); try { style_provider.load_from_data (COMPOSITED_WINDOW_STYLESHEET, -1); } catch (Error e) { warning ("GraniteWidgetsCompositedWindow: %s", e.message); } // Window properties set_visual (get_screen ().get_rgba_visual()); get_style_context().add_class("composited"); get_style_context ().add_provider (style_provider, 600); app_paintable = true; decorated = false; resizable = false; } } } granite-0.1.0/lib/Widgets/Entries.vala000664 001751 001751 00000010627 11715546243 021017 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Avi Romanoff, Allen Lowe, Maxwell Barvian // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Gdk; namespace Granite.Widgets { public class HintedEntry : Gtk.Entry { public string hint_string { get { return placeholder_text; } set { placeholder_text = value; } } public HintedEntry (string hint_string) { this.hint_string = hint_string; } /* * These 4 functions must be removed, they are only kept here * for API compatibility. */ protected void hint () { } protected void unhint () { } public new string get_text () { return text; } public new void set_text (string text) { this.text = text; } } public class SearchBar : HintedEntry { private bool is_searching = true; private uint timeout_id = 0; /** * This value handles how much time (in ms) should pass * after the user stops typing. By default it is set * to 300 ms. **/ public int pause_delay { get; set; default = 300; } /** * text_changed () signal is emitted after a short delay, * which depends on pause_delay. * If you need a synchronous signal without any delay, * use changed () method. **/ public signal void text_changed_pause (string text); public SearchBar (string hint_string) { base (hint_string); set_icon_from_stock (EntryIconPosition.PRIMARY, "gtk-find"); // Signals and callbacks changed.connect (manage_icon); changed.connect_after (on_changed); focus_in_event.connect (on_focus_in); focus_out_event.connect (on_focus_out); icon_press.connect (on_icon_press); } protected new void hint () { is_searching = false; set_icon_from_stock (Gtk.EntryIconPosition.SECONDARY, null); base.hint (); } private bool on_focus_in () { if (!is_searching) { unhint (); is_searching = false; } return false; } private bool on_focus_out () { if (get_text () == "") { hint (); is_searching = false; } return false; } private void manage_icon () { if (text != "") set_icon_from_gicon (EntryIconPosition.SECONDARY, new ThemedIcon.with_default_fallbacks ("edit-clear-symbolic")); else set_icon_from_stock (EntryIconPosition.SECONDARY, null); } private void on_icon_press (EntryIconPosition position) { if (position == EntryIconPosition.SECONDARY) { is_searching = false; text = ""; set_icon_from_stock (position, null); is_searching = true; } else { if (!is_focus) { is_searching = false; hint (); } } } private void on_changed () { if (timeout_id > 0) Source.remove (timeout_id); timeout_id = Timeout.add (pause_delay, emit_text_changed); } private bool emit_text_changed () { var terms = get_text (); text_changed_pause (terms); // Emit signal return Source.remove (timeout_id); } } } granite-0.1.0/lib/Widgets/TimePicker.vala000664 001751 001751 00000004040 11715546243 021432 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Maxwell Barvian // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Gdk; namespace Granite.Widgets { public class TimePicker : SpinButton, Gtk.Buildable { public string format { get; construct; default = _("%l:%M %p"); } public DateTime time { get; protected set; } construct { time = new DateTime.now_local (); int starting_time = time.get_hour () * 60 + 30; // start at this hour : 30 set_minutes (starting_time); // SpinButton properties can_focus = false; editable = false; // user can't edit the entry directly adjustment = new Adjustment (starting_time, 0, 1440, 30, 300, 0); climb_rate = 0; digits = 0; numeric = false; // so the text can be set wrap = true; } public TimePicker.with_format (string format) { Object (format: format); } protected override bool output () { set_minutes ((int) this.value); return true; } protected virtual void set_minutes (int minutes) { time = time.add_full (0, 0, 0, minutes / 60 - time.get_hour (), minutes % 60 - time.get_minute (), 0); text = time.format (format); } } } granite-0.1.0/lib/Widgets/WrapLabel.vala000664 001751 001751 00000002532 11715546243 021253 0ustar00xapantuxapantu000000 000000 using Gtk; /* Label with NORMAL wrapping. Thanks to VMWare team. * TODO: check license, it comes from pino git repository. */ /** * This is a label which is automatically wrapped. * If a line is too long, there will be a line break for instance. **/ public class Granite.Widgets.WrapLabel : Label { public int m_wrap_width = 0; public int m_wrap_height = 0; /** * Create a new WrapLabel. * * @param str the content of the label **/ public WrapLabel(string? str = null) { wrap = true; wrap_mode = Pango.WrapMode.WORD_CHAR; set_alignment(0, 0); set_text(str); set_wrap_width(m_wrap_width); } private void set_wrap_width(int width) { if (width == 0) { return; } get_layout().set_width((int) (width * Pango.SCALE)); int unused = 0; get_layout().get_pixel_size(out unused, out m_wrap_height); if (m_wrap_width != width) { m_wrap_width = width; queue_resize(); } } public override void get_preferred_width (out int minimum_width, out int natural_width) { minimum_width = natural_width = m_wrap_width; } public override void size_allocate(Gtk.Allocation alloc) { base.size_allocate(alloc); set_wrap_width(alloc.width); } } granite-0.1.0/lib/Widgets/CollapsiblePaned.vala000664 001751 001751 00000006345 11715546243 022611 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Mathijs Henquet // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Gdk; namespace Granite { public enum CollapseMode { NONE=0, LEFT=1, TOP=1, FIRST=1, RIGHT=2, BOTTOM=2, LAST=2 } } namespace Granite.Widgets { public class CollapsiblePaned : HPaned { private int saved_state = 10; private uint last_click_time = 0; public CollapseMode collapse_mode = CollapseMode.NONE; //public signal void shrink(); //TODO: Make the default action overwriteable //public new signal void expand(int saved_state); //TODO same public CollapsiblePaned (Orientation o) { //events |= EventMask.BUTTON_PRESS_MASK; set_orientation (o); button_press_event.connect (detect_toggle); } private bool detect_toggle (EventButton event) { if (collapse_mode == CollapseMode.NONE) return false; if (event.time < (last_click_time + Gtk.Settings.get_default ().gtk_double_click_time) && event.type != EventType.2BUTTON_PRESS) return true; if (Gdk.Window.at_pointer (null, null) == this.get_handle_window () && event.type == EventType.2BUTTON_PRESS) { accept_position (); var current_position = get_position (); if (collapse_mode == CollapseMode.LAST) current_position = (max_position - current_position); // change current_position to be relative int requested_position; if (current_position == 0) { debug ("[CollapsablePaned] expand"); requested_position = saved_state; } else { saved_state = current_position; debug ("[CollapsablePaned] shrink"); requested_position = 0; } if (collapse_mode == CollapseMode.LAST) requested_position = max_position - requested_position; // change requeste_position back to be non-relative set_position (requested_position); return true; } last_click_time = event.time; return false; } } public class HCollapsablePaned : CollapsiblePaned { public HCollapsablePaned () { base (Orientation.HORIZONTAL); } } public class VCollapsablePaned : CollapsiblePaned { public VCollapsablePaned () { base (Orientation.VERTICAL); } } } granite-0.1.0/lib/Widgets/AppMenu.vala000664 001751 001751 00000004166 11715546243 020754 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Mathijs Henquet // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Granite.Services; namespace Granite.Widgets { public class AppMenu : ToolButtonWithMenu { public Gtk.MenuItem about_item; public signal void show_about(Gtk.Widget w); public AppMenu (Gtk.Menu menu) { base (new Image.from_stock (Stock.PROPERTIES, IconSize.MENU), _("Menu"), menu); } public AppMenu.with_app (Granite.Application? application, Gtk.Menu menu) { base (new Image.from_stock (Stock.PROPERTIES, IconSize.MENU), _("Menu"), menu); this.add_items (menu); about_item.activate.connect (() => { show_about(get_toplevel()); }); } /** * Create a new AppMenu, parameters are unused now. * * @deprecated 0.1 **/ public AppMenu.with_urls (Gtk.Menu menu, string help_url, string translate_url, string bug_url) { critical("This is a deprecated creation method: AppMenu.with_urls"); base (new Image.from_stock (Stock.PROPERTIES, IconSize.MENU), _("Menu"), menu); } public void add_items (Gtk.Menu menu) { about_item = new Gtk.MenuItem.with_label (_("About")); if (menu.get_children ().length () > 0) menu.append (new SeparatorMenuItem ()); menu.append (about_item); } } } granite-0.1.0/lib/Widgets/Welcome.vala000664 001751 001751 00000014552 11715546243 021002 0ustar00xapantuxapantu000000 000000 /* * Copyright (c) 2012 Victor Eduardo * Copyright (C) 2011 Maxwell Barvian * * This is a free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ using Gtk; public class Granite.Widgets.Welcome : Gtk.EventBox { // Signals public signal void activated (int index); protected new GLib.List children = new GLib.List (); protected Gtk.Box options; public Welcome (string title_text, string subtitle_text) { string _title_text = title_text; string _subtitle_text = subtitle_text; _title_text = _title_text.replace("&", "&"); _subtitle_text = _subtitle_text.replace("&", "&"); Gtk.Box content = new Gtk.Box (Gtk.Orientation.VERTICAL, 0); // Box properties content.homogeneous = false; // Top spacer content.pack_start (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); // Labels var title = new Gtk.Label ("" + _title_text + ""); title.get_style_context().add_class ("title"); title.use_markup = true; title.set_justify (Gtk.Justification.CENTER); content.pack_start (title, false, true, 0); var subtitle = new Gtk.Label ("" + _subtitle_text + ""); subtitle.use_markup = true; subtitle.sensitive = false; subtitle.set_justify (Gtk.Justification.CENTER); content.pack_start (subtitle, false, true, 2); subtitle.get_style_context().add_class("subtitle"); // Options wrapper this.options = new Gtk.Box (Gtk.Orientation.VERTICAL, 8); var options_wrapper = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0); options_wrapper.pack_start (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); // left padding options_wrapper.pack_start (this.options, false, false, 0); // actual options options_wrapper.pack_end (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); // right padding content.pack_start (options_wrapper, false, false, 20); // Bottom spacer content.pack_end (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); add (content); } public void set_item_visible (uint index, bool val) { if(index < children.length () && children.nth_data (index) is Gtk.Widget) { children.nth_data(index).set_no_show_all (!val); children.nth_data(index).set_visible (val); } } public void remove_item (uint index) { if(index < children.length () && children.nth_data (index) is Gtk.Widget) { var item = children.nth_data (index); item.destroy (); children.remove (item); } } public void set_item_sensitivity (uint index, bool val) { if(index < children.length () && children.nth_data (index) is Gtk.Widget) children.nth_data (index).set_sensitive (val); } public int append (string icon_name, string option_text, string description_text) { Gtk.Image? image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.DIALOG); return append_with_image (image, option_text, description_text); } public int append_with_pixbuf (Gdk.Pixbuf? pixbuf, string option_text, string description_text) { var image = new Gtk.Image.from_pixbuf (pixbuf); return append_with_image (image, option_text, description_text); } public int append_with_image (Gtk.Image? image, string option_text, string description_text) { string _option_text = option_text; string _description_text = description_text; _option_text = _option_text.replace ("&", "&"); _description_text = _description_text.replace ("&", "&"); // Option label var label = new Gtk.Label ("" + _option_text + ""); label.use_markup = true; label.halign = Gtk.Align.START; label.valign = Gtk.Align.CENTER; label.get_style_context().add_class ("option-title"); // Description label var description = new Gtk.Label ("" + _description_text + ""); description.use_markup = true; description.halign = Gtk.Align.START; description.valign = Gtk.Align.CENTER; description.sensitive = false; description.get_style_context().add_class ("option-description"); // Button var button = new Gtk.Button (); button.set_relief (Gtk.ReliefStyle.NONE); // Button contents wrapper var button_contents = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 7); // Add left image if (image != null) { image.set_pixel_size (48); button_contents.pack_start (image, false, true, 8); } // Add right text wrapper var text_wrapper = new Gtk.Box (Gtk.Orientation.VERTICAL, 3); // top spacing text_wrapper.pack_start (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); text_wrapper.pack_start (label, false, false, 0); text_wrapper.pack_start (description, false, false, 0); // bottom spacing text_wrapper.pack_end (new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0), true, true, 0); button_contents.pack_start (text_wrapper, false, true, 8); button.add (button_contents); children.append (button); options.pack_start (button, false, false, 0); button.button_release_event.connect ( () => { int index = this.children.index (button); activated (index); // send signal return false; } ); return this.children.index (button); } } granite-0.1.0/lib/Widgets/ToolButtonWithMenu.vala000664 001751 001751 00000025052 11715546243 023176 0ustar00xapantuxapantu000000 000000 /* * Copyright (c) 2011 Mathijs Henquet * * Marlin is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * Marlin is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * Authors: * Mathijs Henquet * ammonkey * */ /* * ToolButtonWithMenu * - support long click / right click with depressed button states * - activate a GtkAction if any or popup a menu. * (used in history navigation buttons next/prev, appmenu) * */ using Gdk; using Gtk; namespace Granite.Widgets { public class ToolButtonWithMenu : Gtk.ToggleToolButton { public signal void right_click (Gdk.EventButton ev); /** * MenuPosition: * CENTER: Center-align the menu relative to the button's position. * LEFT: Left-align the menu relative to the button's position. * RIGHT: Right-align the menu relative to the button's position. * INSIDE_WINDOW: Keep the menu inside the GtkWindow. Center-align when possible. **/ public enum MenuPosition { CENTER, LEFT, RIGHT, INSIDE_WINDOW } public Gtk.Action? myaction; public ulong toggled_sig_id; public MenuPosition menu_position; /* Delegate function used to populate menu */ public delegate Gtk.Menu MenuFetcher (); public MenuFetcher fetcher { set { _fetcher = value; has_fetcher = true; } get { return _fetcher; } } public Gtk.Menu menu { get { return _menu; } set { if (has_fetcher) { warning ("Don't set the menu property on a ToolMenuButton when there is already a menu fetcher"); } else { _menu = value; update_menu_properties (); } } } private int LONG_PRESS_TIME = Gtk.Settings.get_default ().gtk_double_click_time * 2; private int timeout = -1; private uint last_click_time = -1; private bool has_fetcher = false; private unowned MenuFetcher _fetcher; private Gtk.Menu _menu; private Gtk.Button button; public ToolButtonWithMenu.from_action (Gtk.Action action) { this.from_stock (action.stock_id, IconSize.MENU, action.label, new Gtk.Menu ()); use_action_appearance = true; set_related_action (action); action.connect_proxy (this); myaction = action; } public ToolButtonWithMenu.from_stock (string stock_image, IconSize size, string label, Gtk.Menu menu) { Image image = new Image.from_stock (stock_image, size); this (image, label, menu); } private void update_menu_properties () { menu.attach_to_widget (this, null); menu.deactivate.connect ( () => { deactivate_menu (); }); menu.deactivate.connect (popdown_menu); } public ToolButtonWithMenu (Image image, string label, Gtk.Menu _menu, MenuPosition menu_position = MenuPosition.CENTER) { this.menu_position = menu_position; icon_widget = image; label_widget = new Gtk.Label (label); (label_widget as Gtk.Label).use_underline = true; can_focus = true; set_tooltip_text (label); menu = _menu; mnemonic_activate.connect (on_mnemonic_activate); button = get_child () as Gtk.Button; button.events |= EventMask.BUTTON_PRESS_MASK | EventMask.BUTTON_RELEASE_MASK; button.button_press_event.connect (on_button_press_event); button.button_release_event.connect (on_button_release_event); } public override void show_all () { menu.show_all (); base.show_all (); } private void deactivate_menu () { if (myaction != null) myaction.block_activate (); active = false; if (myaction != null) myaction.unblock_activate (); } private void popup_menu_and_depress_button (Gdk.EventButton ev) { if (myaction != null) myaction.block_activate (); active = true; if (myaction != null) myaction.unblock_activate (); popup_menu (ev); } private bool on_button_release_event (Gdk.EventButton ev) { if (ev.time - last_click_time < LONG_PRESS_TIME) { if (myaction != null) { myaction.activate (); } else { active = true; popup_menu (ev); } } if (timeout != -1) { Source.remove ((uint) timeout); timeout = -1; } return true; } private bool on_button_press_event (Gdk.EventButton ev) { // If the button is kept pressed, don't make the user wait when there's no action int max_press_time = (myaction != null)? LONG_PRESS_TIME : 0; if (timeout == -1 && ev.button == 1) { last_click_time = ev.time; timeout = (int) Timeout.add(max_press_time, () => { // long click timeout = -1; popup_menu_and_depress_button (ev); return false; }); } if (ev.button == 3) { // right_click right_click (ev); if (myaction != null) popup_menu_and_depress_button (ev); } return true; } private bool on_mnemonic_activate (bool group_cycling) { // ToggleButton always grabs focus away from the editor, // so reimplement Widget's version, which only grabs the // focus if we are group cycling. if (!group_cycling) { activate (); } else if (can_focus) { grab_focus (); } return true; } protected new void popup_menu (Gdk.EventButton? ev = null) { if (has_fetcher) fetch_menu (); try { menu.popup (null, null, get_menu_position, (ev == null) ? 0 : ev.button, (ev == null) ? get_current_event_time () : ev.time); } finally { // Highlight the parent if (menu.attach_widget != null) menu.attach_widget.set_state_flags (StateFlags.SELECTED, true); menu.select_first (false); } } protected void popdown_menu () { menu.popdown (); // Unhighlight the parent if (menu.attach_widget != null) menu.attach_widget.set_state_flags (StateFlags.NORMAL, true); } private void fetch_menu () { _menu = fetcher (); update_menu_properties (); } private void get_menu_position (Gtk.Menu menu, out int x, out int y, out bool push_in) { Allocation menu_allocation; menu.get_allocation (out menu_allocation); if (menu.attach_widget == null || menu.attach_widget.get_window () == null) { // Prevent null exception in weird cases x = 0; y = 0; push_in = true; return; } menu.attach_widget.get_window ().get_origin (out x, out y); Allocation allocation; menu.attach_widget.get_allocation (out allocation); if (menu_position == MenuPosition.RIGHT) { x += allocation.x; x -= menu_allocation.width; x += allocation.width; } else if (menu_position != MenuPosition.LEFT) { /* Centered menu */ x += allocation.x; x -= menu_allocation.width / 2; x += allocation.width / 2; } int width, height; menu.get_size_request (out width, out height); if (menu_position == MenuPosition.INSIDE_WINDOW) { /* Get window geometry */ Gtk.Widget? parent_widget = get_parent (); Gtk.Widget? next_parent = parent_widget.get_parent (); while (true) { if (parent_widget != null && next_parent != null) { parent_widget = parent_widget.get_parent(); next_parent = parent_widget.get_parent(); } if (parent_widget == null || next_parent == null) break; } Allocation window_allocation; parent_widget.get_allocation (out window_allocation); parent_widget.get_window ().get_origin (out x, out y); int parent_window_x0 = x; int parent_window_xf = parent_window_x0 + window_allocation.width; // Now check if the menu is outside the window and un-center it // if that's the case if (x + menu_allocation.width > parent_window_xf) x = parent_window_xf - menu_allocation.width; // Move to left if (x < parent_window_x0) x = parent_window_x0; // Move to right } y += allocation.y; if (y + height >= menu.attach_widget.get_screen ().get_height ()) y -= height; else y += allocation.height; push_in = true; } } } granite-0.1.0/lib/CMakeLists.txt000664 001751 001751 00000011621 11715546243 017666 0ustar00xapantuxapantu000000 000000 set (PKGNAME granite) set (PKGNAME_ GRANITE) set (${PKGNAME_}_VERSION 0.1.4) # increase when you break the API set (${PKGNAME_}_SOVERSION 0) # Increase when you add functionality # # granite.pc # set (PREFIX ${CMAKE_INSTALL_PREFIX}) set (DOLLAR "$") # You hear that? It's kittens being killed by the gods of cmake configure_file (${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME}.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}.pc) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${PKGNAME}.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig/) # Check for the deps find_package(PkgConfig) find_package(GObjectIntrospection 0.9.12) include(GObjectIntrospectionMacros) set(PKG_DEPS gtk+-3.0 gio-unix-2.0) pkg_check_modules(DEPS REQUIRED gtk+-3.0 gio-unix-2.0 gthread-2.0 gee-1.0) # Link all set(CFLAGS ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER}) add_definitions(${CFLAGS} "-DGETTEXT_PACKAGE=\"GRANITE\"") set(LIBS ${DEPS_LIBRARIES} ) set(LIB_PATHS ${DEPS_LIBRARY_DIRS} ) link_directories(${LIB_PATHS}) #VALA stuff include_directories(${CMAKE_CURRENT_SOURCE_DIR}/Widgets/) find_package(Vala REQUIRED) include(ValaVersion) ensure_vala_version("0.13.0" MINIMUM) include(ValaPrecompile) vala_precompile(VALA_C Application.vala Drawing/Color.vala Drawing/BufferSurface.vala Drawing/Utilities.vala GtkPatch/AboutDialog.vala Services/Settings.vala Services/Logger.vala Services/Paths.vala Services/System.vala Services/Contractor.vala Widgets/WrapLabel.vala Widgets/AboutDialog.vala Widgets/ModeButton.vala Widgets/DatePicker.vala Widgets/Entries.vala Widgets/TimePicker.vala Widgets/CollapsiblePaned.vala Widgets/StaticNotebook.vala Widgets/CompositedWindow.vala Widgets/AppMenu.vala Widgets/Welcome.vala Widgets/ToolButtonWithMenu.vala Widgets/PopOver.vala Widgets/ContractorView.vala Main.vala config.vapi CUSTOM_VAPIS ${CMAKE_CURRENT_SOURCE_DIR}/GtkPatch/gtkpatch-utils.vapi PACKAGES ${PKG_DEPS} posix gee-1.0 OPTIONS --thread GENERATE_VAPI granite GENERATE_HEADER granite ) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/granite.vapi DESTINATION ${CMAKE_INSTALL_PREFIX}/share/vala/vapi/) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/granite.deps DESTINATION ${CMAKE_INSTALL_PREFIX}/share/vala/vapi/) install (FILES ${CMAKE_CURRENT_BINARY_DIR}/granite.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/granite/) install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/Widgets/widgets-utils.h DESTINATION ${CMAKE_INSTALL_PREFIX}/include/granite/) add_library (${PKGNAME} SHARED GtkPatch/gtkpatch-utils.c Widgets/widgets-utils.c ${VALA_C} ) target_link_libraries(${PKGNAME} ${LIBS}) if(BUILD_STATIC MATCHES "Yes") ADD_LIBRARY(${PKGNAME}-static STATIC ${VALA_C}) target_link_libraries(${PKGNAME}-static ${LIBS}) # The library target "foo" already has a default OUTPUT_NAME of "foo", so we don't need to change it. # The library target "foo-static" has a default OUTPUT_NAME of "foo-static", so change it. SET_TARGET_PROPERTIES(${PKGNAME}-static PROPERTIES OUTPUT_NAME ${PKGNAME}) install (TARGETS ${PKGNAME}-static DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/) endif(BUILD_STATIC MATCHES "Yes") set_target_properties (${PKGNAME} PROPERTIES VERSION ${GRANITE_VERSION} SOVERSION ${GRANITE_SOVERSION} ) install (TARGETS ${PKGNAME} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/) macro(_list_prefix _outvar _listvar _prefix) set(${_outvar}) foreach(_item IN LISTS ${_listvar}) list(APPEND ${_outvar} ${_prefix}${_item}) endforeach() endmacro(_list_prefix) # GObject Introspection include(GObjectIntrospectionMacros) add_target_gir(granite Granite granite.h "${DEPS_CFLAGS}" 0.1 Gtk-3.0) add_custom_target(docs) add_custom_command (TARGET docs COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/docs -R -f) add_custom_command (TARGET docs COMMAND valadoc -o docs --doclet-arg=${CMAKE_CURRENT_BINARY_DIR}/granite.h ${CMAKE_CURRENT_SOURCE_DIR}/*/*.vala ${CMAKE_CURRENT_SOURCE_DIR}/*.vapi ${CMAKE_CURRENT_SOURCE_DIR}/*.vala --pkg=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --package-name=granite --package-version=0.1.1 --doclet=gtkdoc) add_custom_target (valadocs) add_custom_command (TARGET valadocs COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/docs_vala -R -f) add_custom_command (TARGET valadocs COMMAND rm ${CMAKE_CURRENT_BINARY_DIR}/images -R -f) add_custom_command (TARGET valadocs COMMAND cp ${CMAKE_SOURCE_DIR}/doc/images/ ${CMAKE_CURRENT_BINARY_DIR}/images -R) add_custom_command (TARGET valadocs COMMAND VALADOC_HEADER=${CMAKE_CURRENT_SOURCE_DIR}/docs/header.html valadoc -o docs_vala ${CMAKE_CURRENT_SOURCE_DIR}/*/*.vala ${CMAKE_CURRENT_SOURCE_DIR}/*.vapi ${CMAKE_CURRENT_SOURCE_DIR}/*.vala --pkg=glib-2.0 --pkg=gio-2.0 --pkg=posix --pkg=gtk+-3.0 --pkg=gio-unix-2.0 --package-name=Granite --package-version=0.1.1 --driver 0.13.x --force --doclet=elementary) add_custom_command (TARGET valadocs COMMAND cp ${CMAKE_SOURCE_DIR}/doc/css/ ${CMAKE_CURRENT_BINARY_DIR}/docs_vala/css -R) granite-0.1.0/lib/Main.vala000664 001751 001751 00000002003 11715546243 016651 0ustar00xapantuxapantu000000 000000 /* * Copyright (c) 2011 Lucas Baudin * * This is a free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ namespace Granite { public void init () { if (!Thread.supported ()) error ("Problem initializing thread support."); //Threading is initialized automatically now //Gdk.threads_init (); } } granite-0.1.0/lib/Services/Settings.vala000664 001751 001751 00000027024 11715546243 021362 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Robert Dyer, Rico Tzschichholz // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // namespace Granite.Services { /** * This interface is used by objects that need to be serialized in a Settings. * The object must have a string representation and provide these methods to * translate between the string and object representations. */ public interface SettingsSerializable : GLib.Object { /** * Serializes the object into a string representation. * * @return the string representation of the object */ public abstract string settings_serialize (); /** * Un-serializes the object from a string representation. * * @param s the string representation of the object */ public abstract void settings_deserialize (string s); } /** * Class for interacting with an internal {@link GLib.Settings} using native Vala properties. * Clients of this class should not connect to the {@link GLib.Object.notify} signal. * Instead, they should connect to the {@link Granite.Services.Settings.changed} signal. * * For example, if a developer wanted to interact with desktop.Wallpaper's (http:/www.launchpad.net/pantheon-wallpaper) schema, * this is what his/her subclass might look like: * * {{{ * public class WallpaperSettings : Granite.Services.Settings { * * public PictureMode picture_mode { get; set; } * * public string picture_path { get; set; } * * public string background_color { get; set; } * * public WallpaperSettings () { * base ("desktop.Wallpaper"); * } * * protected override void verify (string key) { * * switch (key) { * * case "background-color": * Gdk.Color bg; * if (!Gdk.Color.parse (background_color, out bg)) * background_color = "#000000"; * break; * } * } * * } * }}} * * Keep in mind that the developer must define his/her enums to match the schema's. * * The following is a simplified explanation of how this library works: * * 1. Any subclass looks at all properties it contains, and loads their initial values from the keys they represent. * Because Vala properties are stored as GLib properties, the string representation of a property replaces underscores with * hyphens (i.e. property_name becomes "property-name"). This is how this library knows which keys to load from. If the key * does not exist, it will result in a fatal error. * 1. When a property of the subclass changes, the library will first verify the data before emitting a changed signal. If necessary, * the library will change the value of the property while verifying. * This is why developers should only act upon emissions of the changed () signal and never the native {@link GLib.Object.notify} signal. * 1. When the corresponding key of one of the properties of the subclass changes, it will also verify the data and change it, if necessary, * before loading it into as the corresponding property's value. */ public abstract class Settings : GLib.Object { /** * This signal is to be used in place of the standard {@link GLib.Object.notify} signal. * * This signal ''only'' emits after a property's value was verified. * * Note that in the case where a property was set to an invalid value, * (and thus, sanitized to a valid value), the {@link GLib.Object.notify} signal will emit * twice: once with the invalid value and once with the sanitized value. */ [Signal (no_recurse = true, run = "first", action = true, no_hooks = true, detailed = true)] public signal void changed (); public GLib.Settings schema { get; construct; } /** * Creates a new {@link Granite.Services.Settings} object for the supplied schema. * * @param schema the name of the schema to interact with */ public Settings (string schema) { Object (schema: new GLib.Settings (schema)); } /** * Creates a new {@link Granite.Services.Settings} object for the supplied schema and {@link GLib.SettingsBackend}. * * @param schema the name of the schema to interact with * @param backend the desired backend to use */ public Settings.with_backend (string schema, SettingsBackend backend) { Object (schema: new GLib.Settings.with_backend (schema, backend)); } /** * Creates a new {@link Granite.Services.Settings} object for the supplied schema, {@link GLib.SettingsBackend}, and path. * * * @param schema the name of the schema to interact with * @param backend the desired backend to use * @param path the path to use */ public Settings.with_backend_and_path (string schema, SettingsBackend backend, string path) { Object (schema: new GLib.Settings.with_backend_and_path (schema, backend, path)); } /** * Creates a new {@link Granite.Services.Settings} object for the supplied schema, and path. * * You only need to do this if you want to directly create a settings object with a schema that * doesn't have a specified path of its own. That's quite rare. * * It is a programmer error to call this function for a schema that has an explicitly specified path. * * @param schema the name of the schema to interact with * @param path the path to use */ public Settings.with_path (string schema, string path) { Object (schema: new GLib.Settings.with_path (schema, path)); } construct { debug ("Loading settings from schema '%s'", schema.schema); var obj_class = (ObjectClass) get_type ().class_ref (); var properties = obj_class.list_properties (); foreach (var prop in properties) load_key (prop.name); start_monitor (); } ~Settings () { stop_monitor (); } private void stop_monitor () { schema.changed.disconnect (load_key); } private void start_monitor () { schema.changed.connect (load_key); } void handle_notify (Object sender, ParamSpec property) { notify.disconnect (handle_notify); call_verify (property.name); notify.connect (handle_notify); save_key (property.name); } void handle_verify_notify (Object sender, ParamSpec property) { warning ("Key '%s' failed verification in schema '%s', changing value", property.name, schema.schema); save_key (property.name); } private void call_verify (string key) { notify.connect (handle_verify_notify); verify (key); changed[key] (); notify.disconnect (handle_verify_notify); } /** * Verify the given key, changing the property if necessary. Refer to the example given for the class. * * @param key the key in question */ protected virtual void verify (string key) { // do nothing, this isnt abstract because we dont // want to force subclasses to implement this } void load_key (string key) { if (key == "schema") return; notify.disconnect (handle_notify); var obj_class = (ObjectClass) get_type ().class_ref (); var prop = obj_class.find_property (key); var type = prop.value_type; var val = Value (type); if (type == typeof (int)) val.set_int (schema.get_int (key)); else if (type == typeof (double)) val.set_double (schema.get_double (key)); else if (type == typeof (string)) val.set_string (schema.get_string (key)); else if (type == typeof (bool)) val.set_boolean (schema.get_boolean (key)); else if (type.is_enum ()) val.set_enum (schema.get_enum (key)); else if (type.is_a (typeof (SettingsSerializable))) { get_property (key, ref val); (val.get_object () as SettingsSerializable).settings_deserialize (schema.get_string (key)); notify.connect (handle_notify); return; } else { debug ("Unsupported settings type '%s' for key '%s' in schema '%s'", type.name (), key, schema.schema); notify.connect (handle_notify); return; } set_property (prop.name, val); call_verify (key); notify.connect (handle_notify); } void save_key (string key) { if (key == "schema") return; stop_monitor (); var obj_class = (ObjectClass) get_type ().class_ref (); var prop = obj_class.find_property (key); bool success = true; var type = prop.value_type; var val = Value (type); get_property (prop.name, ref val); if (type == typeof (int)) success = schema.set_int (key, val.get_int ()); else if (type == typeof (double)) success = schema.set_double (key, val.get_double ()); else if (type == typeof (string)) success = schema.set_string (key, val.get_string ()); else if (type == typeof (bool)) success = schema.set_boolean (key, val.get_boolean ()); else if (type.is_enum ()) success = schema.set_enum (key, val.get_enum ()); else if (type.is_a (typeof (SettingsSerializable))) success = schema.set_string (key, (val.get_object () as SettingsSerializable).settings_serialize ()); else debug ("Unsupported settings type '%s' for key '%s' in schema '%s'", type.name (), key, schema.schema); if (!success) warning ("Key '%s' could not be written to.", key); start_monitor (); } } } granite-0.1.0/lib/Services/Contractor.vala000664 001751 001751 00000005353 11715546243 021701 0ustar00xapantuxapantu000000 000000 /* * Copyright (C) Lucas Baudin 2011 * * Marlin is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Marlin is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see . */ namespace Granite.Services { [DBus (name = "org.elementary.contractor")] interface ContractorDBus : Object { public abstract GLib.HashTable[] GetServicesByLocation (string strlocation, string? file_mime="") throws IOError; public abstract GLib.HashTable[] GetServicesByLocationsList (GLib.HashTable[] locations) throws IOError; } /** * A way to handle contractor * * /!\ Highly unstable API **/ public class Contractor : Object { internal ContractorDBus contract; internal static Contractor? contractor = null; public Contractor() { try { contract = Bus.get_proxy_sync (BusType.SESSION, "org.elementary.contractor", "/org/elementary/contractor"); } catch (IOError e) { stderr.printf ("%s\n", e.message); } } internal static void ensure () { if(contractor == null) contractor = new Contractor (); } public static GLib.HashTable[] get_contract(string uri, string mime) { ensure (); GLib.HashTable[] contracts = null; try { contracts = contractor.contract.GetServicesByLocation(uri, mime); }catch (IOError e) { stderr.printf ("%s\n", e.message); } return contracts; } public static GLib.HashTable[] get_selection_contracts (GLib.HashTable[] locations) { ensure (); GLib.HashTable[] contracts = null; try { contracts = contractor.contract.GetServicesByLocationsList (locations); }catch (IOError e) { stderr.printf ("%s\n", e.message); } return contracts; } } } granite-0.1.0/lib/Services/Logger.vala000664 001751 001751 00000016035 11715546243 021001 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Robert Dyer // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // namespace Granite.Services { public enum LogLevel { DEBUG, INFO, NOTIFY, WARN, ERROR, FATAL, } enum ConsoleColor { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE, } /** * An enhanced GLib logger which all {@link Granite.Application}s use. */ public class Logger : GLib.Object { class LogMessage : GLib.Object { public LogLevel Level { get; private set; } public string Message { get; private set; } public LogMessage (LogLevel level, string message) { Level = level; Message = message; } } public static LogLevel DisplayLevel { get; set; default = LogLevel.WARN; } static string AppName { get; set; } static Object queue_lock = null; static List log_queue; static bool is_writing; static Regex re; /** * Initializes the logger with the supplied application name. * * @param app_name the name of the app to display in the logs */ public static void initialize (string app_name) { AppName = app_name; is_writing = false; log_queue = new List (); try { re = new Regex ("""(.*)\.vala(:\d+): (.*)"""); } catch { } Log.set_default_handler (glib_log_func); } static string format_message (string msg) { if (re != null && re.match (msg)) { var parts = re.split (msg); return "[%s%s] %s".printf (parts[1], parts[2], parts[3]); } return msg; } /** * Convenience method to write a message with LogLevel.NOTIFY. * * @param msg the message to write to the log */ public static void notification (string msg) { write (LogLevel.NOTIFY, format_message (msg)); } static string get_time () { var now = new DateTime.now_local (); return "%.2d:%.2d:%.2d.%.6d".printf (now.get_hour (), now.get_minute (), now.get_second (), now.get_microsecond ()); } static void write (LogLevel level, string msg) { if (level < DisplayLevel) return; if (is_writing) { lock (queue_lock) log_queue.append (new LogMessage (level, msg)); } else { is_writing = true; if (log_queue.length () > 0) { var logs = log_queue.copy (); lock (queue_lock) log_queue = new List (); foreach (var log in logs) print_log (log); } print_log (new LogMessage (level, msg)); is_writing = false; } } static void print_log (LogMessage log) { set_color_for_level (log.Level); stdout.printf ("[%s %s]", log.Level.to_string ().substring (27), get_time ()); reset_color (); stdout.printf (" %s\n", log.Message); } static void set_color_for_level (LogLevel level) { switch (level) { case LogLevel.DEBUG: set_foreground (ConsoleColor.GREEN); break; case LogLevel.INFO: set_foreground (ConsoleColor.BLUE); break; case LogLevel.NOTIFY: set_foreground (ConsoleColor.MAGENTA); break; case LogLevel.WARN: set_foreground (ConsoleColor.YELLOW); break; case LogLevel.ERROR: set_foreground (ConsoleColor.RED); break; case LogLevel.FATAL: set_background (ConsoleColor.RED); set_foreground (ConsoleColor.WHITE); break; } } static void reset_color () { stdout.printf ("\x001b[0m"); } static void set_foreground (ConsoleColor color) { set_color (color, true); } static void set_background (ConsoleColor color) { set_color (color, false); } static void set_color (ConsoleColor color, bool isForeground) { var color_code = color + 30 + 60; if (!isForeground) color_code += 10; stdout.printf ("\x001b[%dm", color_code); } static void glib_log_func (string? d, LogLevelFlags flags, string msg) { var domain = ""; if (d != null) domain = "[%s] ".printf (d); var message = msg.replace ("\n", "").replace ("\r", ""); message = "%s%s".printf (domain, message); switch (flags) { case LogLevelFlags.LEVEL_CRITICAL: write (LogLevel.FATAL, format_message (message)); write (LogLevel.FATAL, format_message (AppName + " will not function properly.")); break; case LogLevelFlags.LEVEL_ERROR: write (LogLevel.ERROR, format_message (message)); break; case LogLevelFlags.LEVEL_INFO: case LogLevelFlags.LEVEL_MESSAGE: write (LogLevel.INFO, format_message (message)); break; case LogLevelFlags.LEVEL_DEBUG: write (LogLevel.DEBUG, format_message (message)); break; case LogLevelFlags.LEVEL_WARNING: default: write (LogLevel.WARN, format_message (message)); break; } } } } granite-0.1.0/lib/Services/Paths.vala000664 001751 001751 00000013516 11715546243 020642 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Robert Dyer, Rico Tzschichholz // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // namespace Granite.Services { /** * A class for interacting with frequently-used directories, following the * XDG Base Directory specification: [[http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html]] */ public class Paths : GLib.Object { /** * User's home folder - $HOME */ public static File home_folder { get; protected set; } /** * Path passed in to initialize method; should be Build.PKGDATADIR. */ public static File data_folder { get; protected set; } /** * $XDG_CONFIG_HOME - defaults to $HOME/.config */ public static File xdg_config_home_folder { get; protected set; } /** * $XDG_DATA_HOME - defaults to $HOME/.local/share */ public static File xdg_data_home_folder { get; protected set; } /** * $XDG_CACHE_HOME - defaults to $HOME/.cache */ public static File xdg_cache_home_folder { get; protected set; } /** * $XDG_DATA_DIRS - defaults to /usr/local/share/:/usr/share/ */ public static List xdg_data_dir_folders { get; protected owned set; } /** * defaults to xdg_config_home_folder/app_name */ public static File user_config_folder { get; protected set; } /** * defaults to xdg_data_home_folder/app_name */ public static File user_data_folder { get; protected set; } /** * defaults to xdg_cache_home_folder/app_name */ public static File user_cache_folder { get; protected set; } /** * Initialize all the paths using the supplied app name and path to the app's data folder. * * @param app_name the name of the application * @param data_folder_path the path to the application's data folder */ public static void initialize (string app_name, string data_folder_path) { // get environment-based settings home_folder = File.new_for_path (Environment.get_home_dir ()); data_folder = File.new_for_path (data_folder_path); // get XDG Base Directory settings var xdg_config_home = Environment.get_variable ("XDG_CONFIG_HOME"); var xdg_data_home = Environment.get_variable ("XDG_DATA_HOME"); var xdg_cache_home = Environment.get_variable ("XDG_CACHE_HOME"); var xdg_data_dirs = Environment.get_variable ("XDG_DATA_DIRS"); // determine directories based on XDG with fallbacks if (xdg_config_home == null || xdg_config_home.length == 0) xdg_config_home_folder = home_folder.get_child (".config"); else xdg_config_home_folder = File.new_for_path (xdg_config_home); if (xdg_data_home == null || xdg_data_home.length == 0) xdg_data_home_folder = home_folder.get_child (".local").get_child ("share"); else xdg_data_home_folder = File.new_for_path (xdg_data_home); if (xdg_cache_home == null || xdg_cache_home.length == 0) xdg_cache_home_folder = home_folder.get_child (".cache"); else xdg_cache_home_folder = File.new_for_path (xdg_cache_home); var dirs = new List (); if (xdg_data_dirs == null || xdg_data_dirs.length == 0) { dirs.append (File.new_for_path ("/usr/local/share")); dirs.append (File.new_for_path ("/usr/share")); } else { foreach (var path in xdg_data_dirs.split (":")) dirs.append (File.new_for_path (path)); } xdg_data_dir_folders = dirs.copy (); // set the XDG Base Directory specified directories to use user_config_folder = xdg_config_home_folder.get_child (app_name); user_data_folder = xdg_data_home_folder.get_child (app_name); user_cache_folder = xdg_cache_home_folder.get_child (app_name); // ensure all writable directories exist ensure_directory_exists (user_config_folder); ensure_directory_exists (user_data_folder); ensure_directory_exists (user_cache_folder); } /** * Ensure the directory exists, by creating it if it does not. * * @param dir the directory in question * * @return `true` is the directory exists, `false` if it does not */ public static bool ensure_directory_exists (File dir) { if (!dir.query_exists ()) try { dir.make_directory_with_parents (); return true; } catch { error ("Could not access or create the directory '%s'.", dir.get_path ()); } return false; } } } granite-0.1.0/lib/Services/System.vala000664 001751 001751 00000013210 11715546243 021036 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Robert Dyer // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // namespace Granite.Services { /** * Utility class for frequently-used system-related functions, such as opening files, launching * applications, or executing terminal commands. */ public class System : GLib.Object { /** * Opens the specified URI with the default application. This can be used for opening websites * with the default browser, etc. * * @param uri the URI to open */ public static void open_uri (string uri) { open (File.new_for_uri (uri)); } /** * Opens the specified file with the default application. * * @param file the {@link GLib.File} to open */ public static void open (File file) { launch_with_files (null, { file }); } /** * Opens the specified files with the default application. * * @param files an array of {@link GLib.File} to open */ public static void open_files (File[] files) { launch_with_files (null, files); } /** * Launches the specified application. * * @param app the {@link GLib.File} representing the application to launch */ public static void launch (File app) { launch_with_files (app, new File[] {}); } /** * Executes the specified command. * * @param command the command to execute */ public static bool execute_command (string command) { try { var info = AppInfo.create_from_commandline (command, "", 0); if (info.launch (null, null)) return true; } catch (GLib.Error e) { warning ("Failed to execute external '%s' command", command); } return true; } /** * Launches the supplied files with the specified application. * * @param app the {@link GLib.File} representing the application to launch * @param files an array of {@link GLib.File} to open */ public static void launch_with_files (File? app, File[] files) { if (app != null && !app.query_exists ()) { warning ("Application '%s' doesn't exist", app.get_path ()); return; } var mounted_files = new GLib.List (); // make sure all files are mounted foreach (var f in files) { if (f.get_path () != null && f.get_path () != "" && (f.is_native () || path_is_mounted (f.get_path ()))) { mounted_files.append (f); continue; } try { AppInfo.launch_default_for_uri (f.get_uri (), null); } catch { f.mount_enclosing_volume (0, null); mounted_files.append (f); } } if (mounted_files.length () > 0 || files.length == 0) internal_launch (app, mounted_files); } static bool path_is_mounted (string path) { foreach (var m in VolumeMonitor.get ().get_mounts ()) if (m.get_root () != null && m.get_root ().get_path () != null && path.contains (m.get_root ().get_path ())) return true; return false; } static void internal_launch (File? app, GLib.List files) { if (app == null && files.length () == 0) return; AppInfo info; if (app != null) info = new DesktopAppInfo.from_filename (app.get_path ()); else try { info = files.first ().data.query_default_handler (); } catch { return; } try { if (files.length () == 0) { info.launch (null, null); return; } if (info.supports_files ()) { info.launch (files, null); return; } if (info.supports_uris ()) { var uris = new GLib.List (); foreach (var f in files) uris.append (f.get_uri ()); info.launch_uris (uris, new AppLaunchContext ()); return; } error ("Error opening files. The application doesn't support files/URIs or wasn't found."); } catch (Error e) { debug ("Error: " + e.domain.to_string ()); error (e.message); } } } } granite-0.1.0/lib/config.vapi000664 001751 001751 00000000320 11715546243 017246 0ustar00xapantuxapantu000000 000000 [CCode (cname = "GETTEXT_PACKAGE", cheader_filename = "config.h")] internal const string GETTEXT_PACKAGE; [CCode (cname = "RESOURCES_DIR", cheader_filename = "config.h")] internal const string RESOURCES_DIR; granite-0.1.0/lib/config.h.cmake000664 001751 001751 00000000225 11715546243 017621 0ustar00xapantuxapantu000000 000000 #ifndef H_CONFIG #define H_CONFIG #cmakedefine GRANITE_NLS_LOCALEDIR "@GRANITE_NLS_LOCALEDIR@" #cmakedefine RESOURCES_DIR "@RESOURCES_DIR@" #endif granite-0.1.0/lib/granite.deps000664 001751 001751 00000000026 11715546243 017431 0ustar00xapantuxapantu000000 000000 gtk+-3.0 gio-unix-2.0 granite-0.1.0/lib/Application.vala000664 001751 001751 00000012405 11715546243 020237 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Maxwell Barvian // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gtk; using Granite.Services; using Granite.Widgets; namespace Granite { /** * Global deprecated object.. * * @deprecated 0.1 **/ public static Granite.Application app; public abstract class Application : Gtk.Application { public string build_data_dir; public string build_pkg_data_dir; public string build_release_name; public string build_version; public string build_version_info; public string program_name; public string exec_name; public string app_copyright; public string app_years; public string app_icon; public string app_launcher; public string main_url; public string bug_url; public string help_url; public string translate_url; public string[] about_authors; public string[] about_documenters; public string[] about_artists; public string about_comments; public string about_translators; public string about_license; public License about_license_type; public Application () { Granite.init (); // set program name prctl (15, exec_name, 0, 0, 0); Environment.set_prgname (exec_name); Posix.signal (Posix.SIGINT, sig_handler); Posix.signal (Posix.SIGTERM, sig_handler); Logger.initialize (program_name); Logger.DisplayLevel = LogLevel.INFO; message ("%s version: %s", program_name, build_version); var un = Posix.utsname (); message ("Kernel version: %s", (string) un.release); Logger.DisplayLevel = LogLevel.WARN; Intl.bindtextdomain (exec_name, build_data_dir + "/locale"); // Deprecated Granite.app = this; } [CCode (cheader_filename = "sys/prctl.h", cname = "prctl")] protected extern static int prctl (int option, string arg2, ulong arg3, ulong arg4, ulong arg5); public new int run (string[] args) { // parse commandline options var context = new OptionContext (""); context.add_main_entries (options, null); context.add_group (Gtk.get_option_group (false)); try { context.parse (ref args); } catch { } set_options (); return base.run (args); } protected static bool DEBUG = false; protected const OptionEntry[] options = { { "debug", 'd', 0, OptionArg.NONE, out DEBUG, "Enable debug logging", null }, { null } }; protected static void sig_handler (int sig) { warning ("Caught signal (%d), exiting", sig); Granite.app.quit_mainloop (); } protected virtual void set_options () { if (DEBUG) Logger.DisplayLevel = LogLevel.DEBUG; } public AppMenu create_appmenu (Gtk.Menu menu) { AppMenu app_menu = new AppMenu.with_app (this, menu); app_menu.show_about.connect (show_about); return app_menu; } protected Granite.Widgets.AboutDialog about_dlg; public virtual void show_about (Gtk.Widget parent) { assert(parent is Gtk.Window); Granite.Widgets.show_about_dialog ((Gtk.Window) parent, "program_name", program_name, "version", build_version, "logo_icon_name", app_icon, "comments", about_comments, "copyright", "%s %s Developers".printf (app_years, program_name), "website", main_url, "website_label", "Website", "authors", about_authors, "documenters", about_documenters, "artists", about_artists, "translator_credits", about_translators, "license", about_license, "license_type", about_license_type, "help", help_url, "translate", translate_url, "bug", bug_url); } } } granite-0.1.0/lib/Drawing/Color.vala000664 001751 001751 00000033661 11715546243 020454 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Robert Dyer // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Gdk; using Granite.Services; namespace Granite.Drawing { /** * A class containing an RGBA color and methods for more powerful color manipulation. */ public class Color : GLib.Object, SettingsSerializable { /** * The value of the red channel, with 0 being the lowest value and 1.0 being the greatest value. */ public double R; /** * The value of the green channel, with 0 being the lowest value and 1.0 being the greatest value. */ public double G; /** * The value of the blue channel, with 0 being the lowest value and 1.0 being the greatest value. */ public double B; /** * The value of the alpha channel, with 0 being the lowest value and 1.0 being the greatest value. */ public double A; /** * Constructs a new {@link Granite.Drawing.Color} with the supplied values. * * @param R the value of the red channel as a double * @param G the value of the green channel as a double * @param B the value of the blue channel as a double * @param A the value of the alpha channel as a double */ public Color (double R, double G, double B, double A) { this.R = R; this.G = G; this.B = B; this.A = A; } /** * Constructs a new {@link Granite.Drawing.Color} from a {@link Gdk.Color}. * * @param color the {@link Gdk.Color} */ public Color.from_gdk (Gdk.Color color) { R = color.red / (double) uint16.MAX; G = color.green / (double) uint16.MAX; B = color.blue / (double) uint16.MAX; A = 1.0; } /** * Changes the hue of this color to the supplied one. * * @param hue the hue to change this color to * * @return the new {@link Granite.Drawing.Color} */ public Color set_hue (double hue) requires (hue >= 0 && hue <= 360) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); h = hue; hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Changes the saturation of this color to the supplied one. * * @param sat the saturation to change this color to * * @return the new {@link Granite.Drawing.Color} */ public Color set_sat (double sat) requires (sat >= 0 && sat <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); s = sat; hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Changes the value of this color to the supplied one. * * @param val the value to change this color to * * @return the new {@link Granite.Drawing.Color} */ public Color set_val (double val) requires (val >= 0 && val <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); v = val; hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Changes the value of the alpha channel. * * @param alpha the value of the alpha channel * * @return the new {@link Granite.Drawing.Color} */ public Color set_alpha (double alpha) requires (alpha >= 0 && alpha <= 1) { A = alpha; return this; } /** * Get the value. * @return the hue of this color, as a double value */ public double get_hue () { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); return h; } /** * Get the value. * @return the saturation of this color, as a double value */ public double get_sat () { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); return s; } /** * Get the value. * * @return the value of this color, as a double value */ public double get_val () { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); return v; } /** * Adds the supplied hue value to this color's hue value. * * @param hue the hue to add to this color's hue * * @return the new {@link Granite.Drawing.Color} */ public Color add_hue (double val) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); h = (((h + val) % 360) + 360) % 360; hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Changes this color's saturation to the supplied saturation, if it is greater than this color's saturation. * * @param sat the saturation to change this color to * * @return the new {@link Granite.Drawing.Color} */ public Color set_min_sat (double sat) requires (sat >= 0 && sat <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); s = double.max (s, sat); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Changes this color's value to the supplied value, if it is greater than this color's value. * * @param val the value to change this color to * * @return the new {@link Granite.Drawing.Color} */ public Color set_min_value (double val) requires (val >= 0 && val <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); v = double.max (v, val); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Changes this color's saturation to the supplied saturation, if it is smaller than this color's saturation. * * @param sat the hue to change this color to * * @return the new {@link Granite.Drawing.Color} */ public Color set_max_sat (double sat) requires (sat >= 0 && sat <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); s = double.min (s, sat); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Changes this color's value to the supplied value, if it is smaller than this color's value. * * @param val the value to change this color to * * @return the new {@link Granite.Drawing.Color} */ public Color set_max_val (double val) requires (val >= 0 && val <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); v = double.min (v, val); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Multiplies this color's saturation by the supplied amount. * * @param amount the amount to multiply the saturation by * * @return the new {@link Granite.Drawing.Color} */ public Color multiply_sat (double amount) requires (amount >= 0) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); s = double.min (1, s * amount); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Brightens this color's value by the supplied amount. * * @param amount the amount to brighten the value by * * @return the new {@link Granite.Drawing.Color} */ public Color brighten_val (double amount) requires (amount >= 0 && amount <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); v = double.min (1, v + (1 - v) * amount); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Darkens this color's value by the supplied amount. * * @param amount the amount to darken the value by * * @return the new {@link Granite.Drawing.Color} */ public Color darken_val (double amount) requires (amount >= 0 && amount <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); v = double.max (0, v - (1 - v) * amount); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } /** * Darkens this color's value by the supplied amount * color's saturation. * * @param amount the amount to darken the value by * * @return the new {@link Granite.Drawing.Color} */ public Color darken_by_sat (double amount) requires (amount >= 0 && amount <= 1) { double h, s, v; rgb_to_hsv (R, G, B, out h, out s, out v); v = double.max (0, v - amount * s); hsv_to_rgb (h, s, v, out R, out G, out B); return this; } void rgb_to_hsv (double r, double g, double b, out double h, out double s, out double v) requires (r >= 0 && r <= 1) requires (g >= 0 && g <= 1) requires (b >= 0 && b <= 1) { var min = double.min (r, double.min (g, b)); var max = double.max (r, double.max (g, b)); v = max; if (v == 0) { h = 0; s = 0; return; } // normalize value to 1 r /= v; g /= v; b /= v; min = double.min (r, double.min (g, b)); max = double.max (r, double.max (g, b)); var delta = max - min; s = delta; if (s == 0) { h = 0; return; } // normalize saturation to 1 r = (r - min) / delta; g = (g - min) / delta; b = (b - min) / delta; if (max == r) { h = 0 + 60 * (g - b); if (h < 0) h += 360; } else if (max == g) { h = 120 + 60 * (b - r); } else { h = 240 + 60 * (r - g); } } void hsv_to_rgb (double h, double s, double v, out double r, out double g, out double b) requires (h >= 0 && h <= 360) requires (s >= 0 && s <= 1) requires (v >= 0 && v <= 1) { r = 0; g = 0; b = 0; if (s == 0) { r = v; g = v; b = v; } else { var secNum = (int) Math.floor (h / 60); var fracSec = h / 60.0 - secNum; var p = v * (1 - s); var q = v * (1 - s * fracSec); var t = v * (1 - s * (1 - fracSec)); switch (secNum) { case 0: r = v; g = t; b = p; break; case 1: r = q; g = v; b = p; break; case 2: r = p; g = v; b = t; break; case 3: r = p; g = q; b = v; break; case 4: r = t; g = p; b = v; break; case 5: r = v; g = p; b = q; break; } } } /** * {@inheritDoc} */ public string settings_serialize () { return "%d;;%d;;%d;;%d".printf ((int) (R * uint8.MAX), (int) (G * uint8.MAX), (int) (B * uint8.MAX), (int) (A * uint8.MAX)); } /** * {@inheritDoc} */ public void settings_deserialize (string s) { var parts = s.split (";;"); R = double.min (uint8.MAX, double.max (0, int.parse(parts [0]))) / uint8.MAX; G = double.min (uint8.MAX, double.max (0, int.parse(parts [1]))) / uint8.MAX; B = double.min (uint8.MAX, double.max (0, int.parse(parts [2]))) / uint8.MAX; A = double.min (uint8.MAX, double.max (0, int.parse(parts [3]))) / uint8.MAX; } } } granite-0.1.0/lib/Drawing/BufferSurface.vala000664 001751 001751 00000062405 11715546243 022116 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Robert Dyer, Rico Tzschichholz // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Cairo; using Posix; namespace Granite.Drawing { /** * A buffer containing an internal Cairo-usable surface and context, designed * for usage with large, rarely updated draw operations. */ public class BufferSurface : GLib.Object { private Surface _surface; /** * The {@link Cairo.Surface} which will store the results of all drawing operations * made with {@link Granite.Drawing.BufferSurface.context}. */ public Surface surface { get { if (_surface == null) _surface = new ImageSurface (Format.ARGB32, width, height); return _surface; } private set { _surface = value; } } /** * The width of the {@link Granite.Drawing.BufferSurface}, in pixels. */ public int width { get; private set; } /** * The height of the BufferSurface, in pixels. */ public int height { get; private set; } private Context _context; /** * The {@link Cairo.Context} for the internal surface. All drawing operations done on this * {@link Granite.Drawing.BufferSurface} should use this context. */ public Cairo.Context context { get { if (_context == null) _context = new Cairo.Context (surface); return _context; } } /** * Constructs a new, empty {@link Granite.Drawing.BufferSurface} with the supplied dimensions. * * @param width the width of {@link Granite.Drawing.BufferSurface}, in pixels * @param height the height of the {@link Granite.Drawing.BufferSurface}, in pixels */ public BufferSurface (int width, int height) requires (width >= 0 && height >= 0) { this.width = width; this.height = height; } /** * Constructs a new, empty {@link Granite.Drawing.BufferSurface} with the supplied dimensions, using * the supplied {@link Cairo.Surface} as a model. * * @param width the width of the new {@link Granite.Drawing.BufferSurface}, in pixels * @param height the height of the new {@link Granite.Drawing.BufferSurface}, in pixels * @param model the {@link Cairo.Surface} to use as a model for the internal {@link Cairo.Surface} */ public BufferSurface.with_surface (int width, int height, Surface model) requires (model != null) { this (width, height); surface = new Surface.similar (model, Content.COLOR_ALPHA, width, height); } /** * Constructs a new, empty {@link Granite.Drawing.BufferSurface} with the supplied dimensions, using * the supplied {@link Granite.Drawing.BufferSurface} as a model. * * @param width the width of the new {@link Granite.Drawing.BufferSurface}, in pixels * @param height the height of the new {@link Granite.Drawing.BufferSurface}, in pixels * @param model the {@link Granite.Drawing.BufferSurface} to use as a model for the internal {@link Cairo.Surface} */ public BufferSurface.with_buffer_surface (int width, int height, BufferSurface model) requires (model != null) { this (width, height); surface = new Surface.similar (model.surface, Content.COLOR_ALPHA, width, height); } /** * Clears the internal {@link Cairo.Surface}, making all pixels fully transparent. */ public void clear () { context.save (); _context.set_source_rgba (0, 0, 0, 0); _context.set_operator (Operator.SOURCE); _context.paint (); _context.restore (); } /** * Creates a {@link Gdk.Pixbuf} from internal {@link Cairo.Surface}. * * @return the {@link Gdk.Pixbuf} */ public Gdk.Pixbuf load_to_pixbuf () { var image_surface = new ImageSurface (Format.ARGB32, width, height); var cr = new Cairo.Context (image_surface); cr.set_operator (Operator.SOURCE); cr.set_source_surface (surface, 0, 0); cr.paint (); var width = image_surface.get_width (); var height = image_surface.get_height (); var pb = new Gdk.Pixbuf (Gdk.Colorspace.RGB, true, 8, width, height); pb.fill (0x00000000); uint8 *data = image_surface.get_data (); uint8 *pixels = pb.get_pixels (); var length = width * height; if (image_surface.get_format () == Format.ARGB32) { for (var i = 0; i < length; i++) { // if alpha is 0 set nothing if (data[3] > 0) { pixels[0] = (uint8) (data[2] * 255 / data[3]); pixels[1] = (uint8) (data[1] * 255 / data[3]); pixels[2] = (uint8) (data[0] * 255 / data[3]); pixels[3] = data[3]; } pixels += 4; data += 4; } } else if (image_surface.get_format () == Format.RGB24) { for (var i = 0; i < length; i++) { pixels[0] = data[2]; pixels[1] = data[1]; pixels[2] = data[0]; pixels[3] = data[3]; pixels += 4; data += 4; } } return pb; } /** * Averages all the colors in the internal {@link Cairo.Surface}. * * @return the {@link Granite.Drawing.Color} with the averaged color */ public Drawing.Color average_color () { var bTotal = 0.0; var gTotal = 0.0; var rTotal = 0.0; var w = width; var h = height; var original = new ImageSurface (Format.ARGB32, w, h); var cr = new Cairo.Context (original); cr.set_operator (Operator.SOURCE); cr.set_source_surface (surface, 0, 0); cr.paint (); uint8 *data = original.get_data (); var length = w * h; for (var i = 0; i < length; i++) { uint8 b = data [0]; uint8 g = data [1]; uint8 r = data [2]; uint8 max = (uint8) double.max (r, double.max (g, b)); uint8 min = (uint8) double.min (r, double.min (g, b)); double delta = max - min; var sat = delta == 0 ? 0.0 : delta / max; var score = 0.2 + 0.8 * sat; bTotal += b * score; gTotal += g * score; rTotal += r * score; data += 4; } return new Drawing.Color (rTotal / uint8.MAX / length, gTotal / uint8.MAX / length, bTotal / uint8.MAX / length, 1).set_val (0.8).multiply_sat (1.15); } /** * Performs a blur operation on the internal {@link Cairo.Surface}, using the * fast-blur algorithm found here [[http://incubator.quasimondo.com/processing/superfastblur.pde]]. * * @param radius the blur radius * @param process_count the number of times to perform the operation */ public void fast_blur (int radius, int process_count = 1) { if (radius < 1 || process_count < 1) return; var w = width; var h = height; var channels = 4; if (radius > w - 1 || radius > h - 1) return; var original = new ImageSurface (Format.ARGB32, w, h); var cr = new Cairo.Context (original); cr.set_operator (Operator.SOURCE); cr.set_source_surface (surface, 0, 0); cr.paint (); uint8 *pixels = original.get_data (); var buffer = new uint8[w * h * channels]; var vmin = new int[int.max (w, h)]; var vmax = new int[int.max (w, h)]; var div = 2 * radius + 1; var dv = new uint8[256 * div]; for (var i = 0; i < dv.length; i++) dv[i] = (uint8) (i / div); while (process_count-- > 0) { for (var x = 0; x < w; x++) { vmin[x] = int.min (x + radius + 1, w - 1); vmax[x] = int.max (x - radius, 0); } for (var y = 0; y < h; y++) { var asum = 0, rsum = 0, gsum = 0, bsum = 0; uint32 cur_pixel = y * w * channels; asum += radius * pixels[cur_pixel + 0]; rsum += radius * pixels[cur_pixel + 1]; gsum += radius * pixels[cur_pixel + 2]; bsum += radius * pixels[cur_pixel + 3]; for (var i = 0; i <= radius; i++) { asum += pixels[cur_pixel + 0]; rsum += pixels[cur_pixel + 1]; gsum += pixels[cur_pixel + 2]; bsum += pixels[cur_pixel + 3]; cur_pixel += channels; } cur_pixel = y * w * channels; for (var x = 0; x < w; x++) { uint32 p1 = (y * w + vmin[x]) * channels; uint32 p2 = (y * w + vmax[x]) * channels; buffer[cur_pixel + 0] = dv[asum]; buffer[cur_pixel + 1] = dv[rsum]; buffer[cur_pixel + 2] = dv[gsum]; buffer[cur_pixel + 3] = dv[bsum]; asum += pixels[p1 + 0] - pixels[p2 + 0]; rsum += pixels[p1 + 1] - pixels[p2 + 1]; gsum += pixels[p1 + 2] - pixels[p2 + 2]; bsum += pixels[p1 + 3] - pixels[p2 + 3]; cur_pixel += channels; } } for (var y = 0; y < h; y++) { vmin[y] = int.min (y + radius + 1, h - 1) * w; vmax[y] = int.max (y - radius, 0) * w; } for (var x = 0; x < w; x++) { var asum = 0, rsum = 0, gsum = 0, bsum = 0; uint32 cur_pixel = x * channels; asum += radius * buffer[cur_pixel + 0]; rsum += radius * buffer[cur_pixel + 1]; gsum += radius * buffer[cur_pixel + 2]; bsum += radius * buffer[cur_pixel + 3]; for (var i = 0; i <= radius; i++) { asum += buffer[cur_pixel + 0]; rsum += buffer[cur_pixel + 1]; gsum += buffer[cur_pixel + 2]; bsum += buffer[cur_pixel + 3]; cur_pixel += w * channels; } cur_pixel = x * channels; for (var y = 0; y < h; y++) { uint32 p1 = (x + vmin[y]) * channels; uint32 p2 = (x + vmax[y]) * channels; pixels[cur_pixel + 0] = dv[asum]; pixels[cur_pixel + 1] = dv[rsum]; pixels[cur_pixel + 2] = dv[gsum]; pixels[cur_pixel + 3] = dv[bsum]; asum += buffer[p1 + 0] - buffer[p2 + 0]; rsum += buffer[p1 + 1] - buffer[p2 + 1]; gsum += buffer[p1 + 2] - buffer[p2 + 2]; bsum += buffer[p1 + 3] - buffer[p2 + 3]; cur_pixel += w * channels; } } } original.mark_dirty (); context.set_operator (Operator.SOURCE); context.set_source_surface (original, 0, 0); context.paint (); context.set_operator (Operator.OVER); } const int AlphaPrecision = 16; const int ParamPrecision = 7; /** * Performs a blur operation on the internal {@link Cairo.Surface}, using an * exponential blurring algorithm. This method is usually the fastest * and produces good-looking results (though not quite as good as gaussian's). * * @param radius the blur radius */ public void exponential_blur (int radius) { if (radius < 1) return; var alpha = (int) ((1 << AlphaPrecision) * (1.0 - Math.exp (-2.3 / (radius + 1.0)))); var height = this.height; var width = this.width; var original = new ImageSurface (Format.ARGB32, width, height); var cr = new Cairo.Context (original); cr.set_operator (Operator.SOURCE); cr.set_source_surface (surface, 0, 0); cr.paint (); uint8 *pixels = original.get_data (); try { // Process Rows #if VALA_0_12 unowned Thread th = Thread.create (() => { #else unowned Thread th = Thread.create (() => { #endif exponential_blur_rows (pixels, width, height, 0, height / 2, 0, width, alpha); return null; }, true); exponential_blur_rows (pixels, width, height, height / 2, height, 0, width, alpha); th.join (); // Process Columns th = Thread.create (() => { exponential_blur_columns (pixels, width, height, 0, width / 2, 0, height, alpha); return null; }, true); exponential_blur_columns (pixels, width, height, width / 2, width, 0, height, alpha); th.join (); } catch { } original.mark_dirty (); context.set_operator (Operator.SOURCE); context.set_source_surface (original, 0, 0); context.paint (); context.set_operator (Operator.OVER); } void exponential_blur_columns (uint8* pixels, int width, int height, int startCol, int endCol, int startY, int endY, int alpha) { for (var columnIndex = startCol; columnIndex < endCol; columnIndex++) { // blur columns uint8 *column = pixels + columnIndex * 4; var zA = column[0] << ParamPrecision; var zR = column[1] << ParamPrecision; var zG = column[2] << ParamPrecision; var zB = column[3] << ParamPrecision; // Top to Bottom for (var index = width * (startY + 1); index < (endY - 1) * width; index += width) exponential_blur_inner (&column[index * 4], ref zA, ref zR, ref zG, ref zB, alpha); // Bottom to Top for (var index = (endY - 2) * width; index >= startY; index -= width) exponential_blur_inner (&column[index * 4], ref zA, ref zR, ref zG, ref zB, alpha); } } void exponential_blur_rows (uint8* pixels, int width, int height, int startRow, int endRow, int startX, int endX, int alpha) { for (var rowIndex = startRow; rowIndex < endRow; rowIndex++) { // Get a pointer to our current row uint8* row = pixels + rowIndex * width * 4; var zA = row[startX + 0] << ParamPrecision; var zR = row[startX + 1] << ParamPrecision; var zG = row[startX + 2] << ParamPrecision; var zB = row[startX + 3] << ParamPrecision; // Left to Right for (var index = startX + 1; index < endX; index++) exponential_blur_inner (&row[index * 4], ref zA, ref zR, ref zG, ref zB, alpha); // Right to Left for (var index = endX - 2; index >= startX; index--) exponential_blur_inner (&row[index * 4], ref zA, ref zR, ref zG, ref zB, alpha); } } private static inline void exponential_blur_inner (uint8* pixel, ref int zA, ref int zR, ref int zG, ref int zB, int alpha) { zA += (alpha * ((pixel[0] << ParamPrecision) - zA)) >> AlphaPrecision; zR += (alpha * ((pixel[1] << ParamPrecision) - zR)) >> AlphaPrecision; zG += (alpha * ((pixel[2] << ParamPrecision) - zG)) >> AlphaPrecision; zB += (alpha * ((pixel[3] << ParamPrecision) - zB)) >> AlphaPrecision; pixel[0] = (uint8) (zA >> ParamPrecision); pixel[1] = (uint8) (zR >> ParamPrecision); pixel[2] = (uint8) (zG >> ParamPrecision); pixel[3] = (uint8) (zB >> ParamPrecision); } /** * Performs a blur operation on the internal {@link Cairo.Surface}, using a * gaussian blurring algorithm. This method is very slow, albeit producing * debatably the best-looking results, and in most cases developers should * use the exponential blurring algorithm instead. * * @param radius the blur radius */ public void gaussian_blur (int radius) { var gausswidth = radius * 2 + 1; var kernel = build_gaussian_kernel (gausswidth); var width = this.width; var height = this.height; var original = new ImageSurface (Format.ARGB32, width, height); var cr = new Cairo.Context (original); cr.set_operator (Operator.SOURCE); cr.set_source_surface (surface, 0, 0); cr.paint (); uint8 *src = original.get_data (); var size = height * original.get_stride (); var abuffer = new double[size]; var bbuffer = new double[size]; // Copy image to double[] for faster horizontal pass for (var i = 0; i < size; i++) abuffer[i] = (double) src[i]; // Precompute horizontal shifts var shiftar = new int[int.max (width, height), gausswidth]; for (var x = 0; x < width; x++) for (var k = 0; k < gausswidth; k++) { var shift = k - radius; if (x + shift <= 0 || x + shift >= width) shiftar[x, k] = 0; else shiftar[x, k] = shift * 4; } try { // Horizontal Pass #if VALA_0_12 unowned Thread th = Thread.create (() => { #else unowned Thread th = Thread.create (() => { #endif gaussian_blur_horizontal (abuffer, bbuffer, kernel, gausswidth, width, height, 0, height / 2, shiftar); return null; }, true); gaussian_blur_horizontal (abuffer, bbuffer, kernel, gausswidth, width, height, height / 2, height, shiftar); th.join (); // Clear buffer memset (abuffer, 0, sizeof(double) * size); // Precompute vertical shifts shiftar = new int[int.max (width, height), gausswidth]; for (var y = 0; y < height; y++) for (var k = 0; k < gausswidth; k++) { var shift = k - radius; if (y + shift <= 0 || y + shift >= height) shiftar[y, k] = 0; else shiftar[y, k] = shift * width * 4; } // Vertical Pass th = Thread.create (() => { gaussian_blur_vertical (bbuffer, abuffer, kernel, gausswidth, width, height, 0, width / 2, shiftar); return null; }, true); gaussian_blur_vertical (bbuffer, abuffer, kernel, gausswidth, width, height, width / 2, width, shiftar); th.join (); } catch {} // Save blurred image to original uint8[] for (var i = 0; i < size; i++) src[i] = (uint8) abuffer[i]; original.mark_dirty (); context.set_operator (Operator.SOURCE); context.set_source_surface (original, 0, 0); context.paint (); context.set_operator (Operator.OVER); } void gaussian_blur_horizontal (double* src, double* dest, double* kernel, int gausswidth, int width, int height, int startRow, int endRow, int[,] shift) { uint32 cur_pixel = startRow * width * 4; for (var y = startRow; y < endRow; y++) { for (var x = 0; x < width; x++) { for (var k = 0; k < gausswidth; k++) { var source = cur_pixel + shift[x, k]; dest[cur_pixel + 0] += src[source + 0] * kernel[k]; dest[cur_pixel + 1] += src[source + 1] * kernel[k]; dest[cur_pixel + 2] += src[source + 2] * kernel[k]; dest[cur_pixel + 3] += src[source + 3] * kernel[k]; } cur_pixel += 4; } } } void gaussian_blur_vertical (double* src, double* dest, double* kernel, int gausswidth, int width, int height, int startCol, int endCol, int[,] shift) { uint32 cur_pixel = startCol * 4; for (var y = 0; y < height; y++) { for (var x = startCol; x < endCol; x++) { for (var k = 0; k < gausswidth; k++) { var source = cur_pixel + shift[y, k]; dest[cur_pixel + 0] += src[source + 0] * kernel[k]; dest[cur_pixel + 1] += src[source + 1] * kernel[k]; dest[cur_pixel + 2] += src[source + 2] * kernel[k]; dest[cur_pixel + 3] += src[source + 3] * kernel[k]; } cur_pixel += 4; } cur_pixel += (width - endCol + startCol) * 4; } } static double[] build_gaussian_kernel (int gausswidth) requires (gausswidth % 2 == 1) { var kernel = new double[gausswidth]; // Maximum value of curve var sd = 255.0; // width of curve var range = gausswidth; // Average value of curve var mean = range / sd; for (var i = 0; i < gausswidth / 2 + 1; i++) kernel[gausswidth - i - 1] = kernel[i] = Math.pow (Math.sin (((i + 1) * (Math.PI / 2) - mean) / range), 2) * sd; // normalize the values var gaussSum = 0.0; foreach (var d in kernel) gaussSum += d; for (var i = 0; i < kernel.length; i++) kernel[i] = kernel[i] / gaussSum; return kernel; } } } granite-0.1.0/lib/Drawing/Utilities.vala000664 001751 001751 00000007134 11715546243 021345 0ustar00xapantuxapantu000000 000000 // // Copyright (C) 2011 Robert Dyer, Maxwell Barvian // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // using Cairo; using Gdk; using Gtk; using Granite.Services; namespace Granite.Drawing { /** * A utility class for frequently-performed drawing operations. */ public class Utilities : GLib.Object { /** * Adds a closed sub-path rounded rectangle of the given size and border radius to the current path * at position (x, y) in user-space coordinates. * * @param cr a {@link Cairo.Context} * @param x the X coordinate of the top left corner of the rounded rectangle * @param y the Y coordinate to the top left corner of the rounded rectangle * @param width the width of the rounded rectangle * @param height the height of the rounded rectangle * @param radius the border radius of the rounded rectangle */ public static void cairo_rounded_rectangle (Cairo.Context cr, double x, double y, double width, double height, double radius) { cr.move_to (x + radius, y); cr.arc (x + width - radius, y + radius, radius, Math.PI * 1.5, Math.PI * 2); cr.arc (x + width - radius, y + height - radius, radius, 0, Math.PI * 0.5); cr.arc (x + radius, y + height - radius, radius, Math.PI * 0.5, Math.PI); cr.arc (x + radius, y + radius, radius, Math.PI, Math.PI * 1.5); cr.close_path (); } /** * Averages the colors in the {@link Gdk.Pixbuf} and returns it. * * @param source the {@link Gdk.Pixbuf} * * @return the {@link Granite.Drawing.Color} containing the averaged color */ public static Drawing.Color average_color (Pixbuf source) { var rTotal = 0.0; var gTotal = 0.0; var bTotal = 0.0; uint8* dataPtr = source.get_pixels (); double pixels = source.height * source.rowstride / source.n_channels; for (var i = 0; i < pixels; i++) { var r = dataPtr [0]; var g = dataPtr [1]; var b = dataPtr [2]; var max = (uint8) double.max (r, double.max (g, b)); var min = (uint8) double.min (r, double.min (g, b)); double delta = max - min; var sat = delta == 0 ? 0.0 : delta / max; var score = 0.2 + 0.8 * sat; rTotal += r * score; gTotal += g * score; bTotal += b * score; dataPtr += source.n_channels; } return new Drawing.Color (rTotal / uint8.MAX / pixels, gTotal / uint8.MAX / pixels, bTotal / uint8.MAX / pixels, 1).set_val (0.8).multiply_sat (1.15); } } } granite-0.1.0/COPYING000664 001751 001751 00000104513 11715546243 015416 0ustar00xapantuxapantu000000 000000 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The GNU General Public License is a free, copyleft license for software and other kinds of works. The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things. To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others. For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it. For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions. Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users. Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free. The precise terms and conditions for copying, distribution and modification follow. TERMS AND CONDITIONS 0. Definitions. "This License" refers to version 3 of the GNU General Public License. "Copyright" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks. "The Program" refers to any copyrightable work licensed under this License. Each licensee is addressed as "you". "Licensees" and "recipients" may be individuals or organizations. To "modify" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a "modified version" of the earlier work or a work "based on" the earlier work. A "covered work" means either the unmodified Program or a work based on the Program. To "propagate" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well. To "convey" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying. An interactive user interface displays "Appropriate Legal Notices" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion. 1. Source Code. The "source code" for a work means the preferred form of the work for making modifications to it. "Object code" means any non-source form of a work. A "Standard Interface" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language. The "System Libraries" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A "Major Component", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it. The "Corresponding Source" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work. The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source. The Corresponding Source for a work in source code form is that same work. 2. Basic Permissions. All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law. You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you. Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary. 3. Protecting Users' Legal Rights From Anti-Circumvention Law. No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures. When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures. 4. Conveying Verbatim Copies. You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program. You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee. 5. Conveying Modified Source Versions. You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions: a) The work must carry prominent notices stating that you modified it, and giving a relevant date. b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to "keep intact all notices". c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it. d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so. A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an "aggregate" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate. 6. Conveying Non-Source Forms. You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways: a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange. b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge. c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b. d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements. e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d. A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work. A "User Product" is either (1) a "consumer product", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, "normally used" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product. "Installation Information" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made. If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM). The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network. Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying. 7. Additional Terms. "Additional permissions" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions. When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission. Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms: a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or d) Limiting the use for publicity purposes of names of licensors or authors of the material; or e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors. All other non-permissive additional terms are considered "further restrictions" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying. If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms. Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way. 8. Termination. You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11). However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation. Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice. Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10. 9. Acceptance Not Required for Having Copies. You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so. 10. Automatic Licensing of Downstream Recipients. Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License. An "entity transaction" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts. You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it. 11. Patents. A "contributor" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's "contributor version". A contributor's "essential patent claims" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, "control" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License. Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version. In the following three paragraphs, a "patent license" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To "grant" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party. If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. "Knowingly relying" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid. If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it. A patent license is "discriminatory" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007. Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law. 12. No Surrender of Others' Freedom. If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program. 13. Use with the GNU Affero General Public License. Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such. 14. Revised Versions of this License. The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation. If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program. Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version. 15. Disclaimer of Warranty. THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. Limitation of Liability. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. 17. Interpretation of Sections 15 and 16. If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode: Copyright (C) This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see . The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read . granite-0.1.0/cmake/Translations.cmake000664 001751 001751 00000003150 11715546243 021121 0ustar00xapantuxapantu000000 000000 # Translations.cmake, CMake macros written for Marlin, feel free to re-use them macro(add_translations_directory NLS_PACKAGE) add_custom_target (i18n ALL COMMENT “Building i18n messages.”) find_program (MSGFMT_EXECUTABLE msgfmt) file (GLOB PO_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.po) foreach (PO_INPUT ${PO_FILES}) get_filename_component (PO_INPUT_BASE ${PO_INPUT} NAME_WE) set (MO_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${PO_INPUT_BASE}.mo) add_custom_command (TARGET i18n COMMAND ${MSGFMT_EXECUTABLE} -o ${MO_OUTPUT} ${PO_INPUT}) install (FILES ${MO_OUTPUT} DESTINATION share/locale/${PO_INPUT_BASE}/LC_MESSAGES RENAME ${NLS_PACKAGE}.mo) endforeach (PO_INPUT ${PO_FILES}) endmacro(add_translations_directory) macro(add_translations_catalog NLS_PACKAGE) add_custom_target (pot COMMENT “Building translation catalog.”) find_program (XGETTEXT_EXECUTABLE xgettext) set(C_SOURCE "") foreach(FILES_INPUT ${ARGN}) file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.c) foreach(C_FILE ${SOURCE_FILES}) set(C_SOURCE ${C_SOURCE} ${C_FILE}) endforeach() file (GLOB SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/${FILES_INPUT}/*.vala) foreach(C_FILE ${SOURCE_FILES}) set(C_SOURCE ${C_SOURCE} ${C_FILE}) endforeach() endforeach() add_custom_command (TARGET pot COMMAND ${XGETTEXT_EXECUTABLE} -d ${NLS_PACKAGE} -o ${CMAKE_CURRENT_SOURCE_DIR}/${NLS_PACKAGE}.pot ${VALA_SOURCE} ${C_SOURCE} --keyword="_" --from-code=UTF-8 ) endmacro() granite-0.1.0/cmake/COPYING-CMAKE-SCRIPTS000664 001751 001751 00000002457 11715546243 020445 0ustar00xapantuxapantu000000 000000 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. granite-0.1.0/cmake/Makefile000664 001751 001751 00000020613 11715546243 017101 0ustar00xapantuxapantu000000 000000 # CMAKE generated file: DO NOT EDIT! # Generated by "Unix Makefiles" Generator, CMake Version 2.8 # Default target executed when no arguments are given to make. default_target: all .PHONY : default_target #============================================================================= # Special targets provided by cmake. # Disable implicit rules so canoncical targets will work. .SUFFIXES: # Remove some rules from gmake that .SUFFIXES does not remove. SUFFIXES = .SUFFIXES: .hpux_make_needs_suffix_list # Suppress display of executed commands. $(VERBOSE).SILENT: # A target that is always out of date. cmake_force: .PHONY : cmake_force #============================================================================= # Set environment variables for the build. # The shell in which to execute make rules. SHELL = /bin/sh # The CMake executable. CMAKE_COMMAND = /usr/bin/cmake # The command to remove a file. RM = /usr/bin/cmake -E remove -f # The top-level source directory on which CMake was run. CMAKE_SOURCE_DIR = /home/mefrio/Scrivania/cmake # The top-level build directory on which CMake was run. CMAKE_BINARY_DIR = /home/mefrio/Scrivania/cmake/cmake #============================================================================= # Targets provided globally by CMake. # Special rule for the target edit_cache edit_cache: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." /usr/bin/cmake -i . .PHONY : edit_cache # Special rule for the target edit_cache edit_cache/fast: edit_cache .PHONY : edit_cache/fast # Special rule for the target install install: preinstall @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." /usr/bin/cmake -P cmake_install.cmake .PHONY : install # Special rule for the target install install/fast: preinstall/fast @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." /usr/bin/cmake -P cmake_install.cmake .PHONY : install/fast # Special rule for the target install/local install/local: preinstall @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake .PHONY : install/local # Special rule for the target install/local install/local/fast: install/local .PHONY : install/local/fast # Special rule for the target install/strip install/strip: preinstall @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake .PHONY : install/strip # Special rule for the target install/strip install/strip/fast: install/strip .PHONY : install/strip/fast # Special rule for the target list_install_components list_install_components: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" .PHONY : list_install_components # Special rule for the target list_install_components list_install_components/fast: list_install_components .PHONY : list_install_components/fast # Special rule for the target rebuild_cache rebuild_cache: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) .PHONY : rebuild_cache # Special rule for the target rebuild_cache rebuild_cache/fast: rebuild_cache .PHONY : rebuild_cache/fast # The main all target all: cmake_check_build_system $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles /home/mefrio/Scrivania/cmake/cmake/CMakeFiles/progress.marks $(MAKE) -f CMakeFiles/Makefile2 all $(CMAKE_COMMAND) -E cmake_progress_start /home/mefrio/Scrivania/cmake/cmake/CMakeFiles 0 .PHONY : all # The main clean target clean: $(MAKE) -f CMakeFiles/Makefile2 clean .PHONY : clean # The main clean target clean/fast: clean .PHONY : clean/fast # Prepare targets for installation. preinstall: all $(MAKE) -f CMakeFiles/Makefile2 preinstall .PHONY : preinstall # Prepare targets for installation. preinstall/fast: $(MAKE) -f CMakeFiles/Makefile2 preinstall .PHONY : preinstall/fast # clear depends depend: $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 .PHONY : depend #============================================================================= # Target rules for targets named scratch # Build rule for target. scratch: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 scratch .PHONY : scratch # fast build rule for target. scratch/fast: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/build .PHONY : scratch/fast src/entry.o: src/entry.c.o .PHONY : src/entry.o # target to build an object file src/entry.c.o: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.o .PHONY : src/entry.c.o src/entry.i: src/entry.c.i .PHONY : src/entry.i # target to preprocess a source file src/entry.c.i: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.i .PHONY : src/entry.c.i src/entry.s: src/entry.c.s .PHONY : src/entry.s # target to generate assembly for a file src/entry.c.s: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/entry.c.s .PHONY : src/entry.c.s src/main_window.o: src/main_window.c.o .PHONY : src/main_window.o # target to build an object file src/main_window.c.o: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.o .PHONY : src/main_window.c.o src/main_window.i: src/main_window.c.i .PHONY : src/main_window.i # target to preprocess a source file src/main_window.c.i: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.i .PHONY : src/main_window.c.i src/main_window.s: src/main_window.c.s .PHONY : src/main_window.s # target to generate assembly for a file src/main_window.c.s: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/main_window.c.s .PHONY : src/main_window.c.s src/menu.o: src/menu.c.o .PHONY : src/menu.o # target to build an object file src/menu.c.o: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.o .PHONY : src/menu.c.o src/menu.i: src/menu.c.i .PHONY : src/menu.i # target to preprocess a source file src/menu.c.i: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.i .PHONY : src/menu.c.i src/menu.s: src/menu.c.s .PHONY : src/menu.s # target to generate assembly for a file src/menu.c.s: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/menu.c.s .PHONY : src/menu.c.s src/notebook.o: src/notebook.c.o .PHONY : src/notebook.o # target to build an object file src/notebook.c.o: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.o .PHONY : src/notebook.c.o src/notebook.i: src/notebook.c.i .PHONY : src/notebook.i # target to preprocess a source file src/notebook.c.i: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.i .PHONY : src/notebook.c.i src/notebook.s: src/notebook.c.s .PHONY : src/notebook.s # target to generate assembly for a file src/notebook.c.s: $(MAKE) -f CMakeFiles/scratch.dir/build.make CMakeFiles/scratch.dir/src/notebook.c.s .PHONY : src/notebook.c.s # Help Target help: @echo "The following are some of the valid targets for this Makefile:" @echo "... all (the default if no target is provided)" @echo "... clean" @echo "... depend" @echo "... edit_cache" @echo "... install" @echo "... install/local" @echo "... install/strip" @echo "... list_install_components" @echo "... rebuild_cache" @echo "... scratch" @echo "... src/entry.o" @echo "... src/entry.i" @echo "... src/entry.s" @echo "... src/main_window.o" @echo "... src/main_window.i" @echo "... src/main_window.s" @echo "... src/menu.o" @echo "... src/menu.i" @echo "... src/menu.s" @echo "... src/notebook.o" @echo "... src/notebook.i" @echo "... src/notebook.s" .PHONY : help #============================================================================= # Special targets to cleanup operation of make. # Special rule to run CMake to check the build system integrity. # No rule that depends on this can have commands that come from listfiles # because they might be regenerated. cmake_check_build_system: $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 .PHONY : cmake_check_build_system granite-0.1.0/cmake/GObjectIntrospectionMacros.cmake000664 001751 001751 00000002035 11715546243 023704 0ustar00xapantuxapantu000000 000000 macro(add_target_gir TARGET_NAME GIR_NAME HEADER CFLAGS GRANITE_VERSION) set(PACKAGES "") foreach(PKG ${ARGN}) set(PACKAGES ${PACKAGES} --include=${PKG}) endforeach() install(CODE "set(ENV{LD_LIBRARY_PATH} \"${CMAKE_CURRENT_BINARY_DIR}:\$ENV{LD_LIBRARY_PATH}\") execute_process(COMMAND g-ir-scanner ${CFLAGS} -n ${GIR_NAME} --quiet --library ${PKGNAME} ${PACKAGES} -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -L${CMAKE_CURRENT_BINARY_DIR} --nsversion=${GRANITE_VERSION} ${CMAKE_CURRENT_BINARY_DIR}/${HEADER})") install(CODE "execute_process(COMMAND g-ir-compiler ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir -o ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib)") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.gir DESTINATION share/gir-1.0/) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${GIR_NAME}-${GRANITE_VERSION}.typelib DESTINATION lib/girepository-1.0/) endmacro() granite-0.1.0/cmake/ParseArguments.cmake000664 001751 001751 00000002322 11715546243 021400 0ustar00xapantuxapantu000000 000000 ## # This is a helper Macro to parse optional arguments in Macros/Functions # It has been taken from the public CMake wiki. # See http://www.cmake.org/Wiki/CMakeMacroParseArguments for documentation and # licensing. ## macro(parse_arguments prefix arg_names option_names) set(DEFAULT_ARGS) foreach(arg_name ${arg_names}) set(${prefix}_${arg_name}) endforeach(arg_name) foreach(option ${option_names}) set(${prefix}_${option} FALSE) endforeach(option) set(current_arg_name DEFAULT_ARGS) set(current_arg_list) foreach(arg ${ARGN}) set(larg_names ${arg_names}) list(FIND larg_names "${arg}" is_arg_name) if(is_arg_name GREATER -1) set(${prefix}_${current_arg_name} ${current_arg_list}) set(current_arg_name ${arg}) set(current_arg_list) else(is_arg_name GREATER -1) set(loption_names ${option_names}) list(FIND loption_names "${arg}" is_option) if(is_option GREATER -1) set(${prefix}_${arg} TRUE) else(is_option GREATER -1) set(current_arg_list ${current_arg_list} ${arg}) endif(is_option GREATER -1) endif(is_arg_name GREATER -1) endforeach(arg) set(${prefix}_${current_arg_name} ${current_arg_list}) endmacro(parse_arguments) granite-0.1.0/cmake/GSettings.cmake000664 001751 001751 00000003677 11715546243 020365 0ustar00xapantuxapantu000000 000000 # GSettings.cmake, CMake macros written for Marlin, feel free to re-use them. option (GSETTINGS_LOCALINSTALL "Install GSettings Schemas locally instead of to the GLib prefix" ON) option (GSETTINGS_COMPILE "Compile GSettings Schemas after installation" ${GSETTINGS_LOCALINSTALL}) if(GSETTINGS_LOCALINSTALL) message(STATUS "GSettings schemas will be installed locally.") endif() if(GSETTINGS_COMPILE) message(STATUS "GSettings shemas will be compiled.") endif() macro(add_schema SCHEMA_NAME) set(PKG_CONFIG_EXECUTABLE pkg-config) # Have an option to not install the schema into where GLib is if (GSETTINGS_LOCALINSTALL) SET (GSETTINGS_DIR "${CMAKE_INSTALL_PREFIX}/share/glib-2.0/schemas/") else (GSETTINGS_LOCALINSTALL) execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} glib-2.0 --variable prefix OUTPUT_VARIABLE _glib_prefix OUTPUT_STRIP_TRAILING_WHITESPACE) SET (GSETTINGS_DIR "${_glib_prefix}/share/glib-2.0/schemas/") endif (GSETTINGS_LOCALINSTALL) # Run the validator and error if it fails execute_process (COMMAND ${PKG_CONFIG_EXECUTABLE} gio-2.0 --variable glib_compile_schemas OUTPUT_VARIABLE _glib_comple_schemas OUTPUT_STRIP_TRAILING_WHITESPACE) execute_process (COMMAND ${_glib_comple_schemas} --dry-run --schema-file=${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} ERROR_VARIABLE _schemas_invalid OUTPUT_STRIP_TRAILING_WHITESPACE) if (_schemas_invalid) message (SEND_ERROR "Schema validation error: ${_schemas_invalid}") endif (_schemas_invalid) # Actually install and recomple schemas message (STATUS "GSettings schemas will be installed into ${GSETTINGS_DIR}") install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/${SCHEMA_NAME} DESTINATION ${GSETTINGS_DIR} OPTIONAL) if (GSETTINGS_COMPILE) install (CODE "message (STATUS \"Compiling GSettings schemas\")") install (CODE "execute_process (COMMAND ${_glib_comple_schemas} ${GSETTINGS_DIR})") endif () endmacro() granite-0.1.0/cmake/FindVala.cmake000664 001751 001751 00000005331 11715546243 020127 0ustar00xapantuxapantu000000 000000 ## # Copyright 2009-2010 Jakob Westhoff. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # The views and conclusions contained in the software and documentation are those # of the authors and should not be interpreted as representing official policies, # either expressed or implied, of Jakob Westhoff ## ## # Find module for the Vala compiler (valac) # # This module determines wheter a Vala compiler is installed on the current # system and where its executable is. # # Call the module using "find_package(Vala) from within your CMakeLists.txt. # # The following variables will be set after an invocation: # # VALA_FOUND Whether the vala compiler has been found or not # VALA_EXECUTABLE Full path to the valac executable if it has been found # VALA_VERSION Version number of the available valac ## # Search for the valac executable in the usual system paths. find_program(VALA_EXECUTABLE NAMES valac) # Handle the QUIETLY and REQUIRED arguments, which may be given to the find call. # Furthermore set VALA_FOUND to TRUE if Vala has been found (aka. # VALA_EXECUTABLE is set) include(FindPackageHandleStandardArgs) find_package_handle_standard_args(Vala DEFAULT_MSG VALA_EXECUTABLE) mark_as_advanced(VALA_EXECUTABLE) # Determine the valac version if(VALA_FOUND) execute_process(COMMAND ${VALA_EXECUTABLE} "--version" OUTPUT_VARIABLE "VALA_VERSION") string(REPLACE "Vala" "" "VALA_VERSION" ${VALA_VERSION}) string(STRIP ${VALA_VERSION} "VALA_VERSION") endif(VALA_FOUND) granite-0.1.0/cmake/README.Vala.rst000664 001751 001751 00000011661 11715546243 020015 0ustar00xapantuxapantu000000 000000 ========== Vala CMake ========== :Author: Jakob Westhoff :Version: Draft Overview ======== Vala CMake is a collection of macros for the CMake_ build system to allow the creation and management of projects developed using the Vala_ programming language or its "Genie" flavor (less tested). Installation ============ To use the Vala macros in your own project you need to copy the macro files to an arbitrary folder in your projects directory and reference them in your ``CMakeLists.txt`` file. Assuming the macros are stored under ``cmake/vala`` in your projects folder you need to add the following information to your base ``CMakeLists.txt``:: list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/vala ) After the new module path as been added you can simply include the provided modules or use the provided find routines. Finding Vala ============ The find module for vala works like any other Find module in CMake. You can use it by simply calling the usual ``find_package`` function. Default parameters like ``REQUIRED`` and ``QUIETLY`` are supported. :: find_package(Vala REQUIRED) After a successful call to the find_package function the following variables will be set: VALA_FOUND Whether the vala compiler has been found or not VALA_EXECUTABLE Full path to the valac executable if it has been found VALA_VERSION Version number of the available valac Precompiling Vala sources ========================= CMake is mainly supposed to handle c or c++ based projects. Luckily every vala program is translated into plain c code using the vala compiler, followed by normal compilation of the generated c program using gcc. The macro ``vala_precompile`` uses that fact to create c files from your .vala sources for further CMake processing. The first parameter provided is a variable, which will be filled with a list of c files outputted by the vala compiler. This list can than be used in conjunction with functions like ``add_executable`` or others to create the necessary compile rules with CMake. The initial variable is followed by a list of .vala files to be compiled. Please take care to add every vala file belonging to the currently compiled project or library as Vala will otherwise not be able to resolve all dependencies. The following sections may be specified afterwards to provide certain options to the vala compiler: PACKAGES A list of vala packages/libraries to be used during the compile cycle. The package names are exactly the same, as they would be passed to the valac "--pkg=" option. OPTIONS A list of optional options to be passed to the valac executable. This can be used to pass "--thread" for example to enable multi-threading support. DIRECTORY Specify the directory where the output source files will be stored. If ommitted, the source files will be stored in CMAKE_CURRENT_BINARY_DIR. CUSTOM_VAPIS A list of custom vapi files to be included for compilation. This can be useful to include freshly created vala libraries without having to install them in the system. GENERATE_VAPI Pass all the needed flags to the compiler to create an internal vapi for the compiled library. The provided name will be used for this and a .vapi file will be created. GENERATE_HEADER Let the compiler generate a header file for the compiled code. There will be a header file as well as an internal header file being generated called .h and _internal.h The following call is a simple example to the vala_precompile macro showing an example to every of the optional sections:: vala_precompile(VALA_C source1.vala source2.vala source3.vala PACKAGES gtk+-2.0 gio-1.0 posix OPTIONS --thread CUSTOM_VAPIS some_vapi.vapi GENERATE_VAPI myvapi GENERATE_HEADER myheader ) Most important is the variable VALA_C which will contain all the generated c file names after the call. The easiest way to use this information is to tell CMake to create an executable out of it. :: add_executable(myexecutable ${VALA_C}) Further reading =============== The `Pdf Presenter Console`__ , which is a vala based project of mine, makes heavy usage of the here described macros. To look at a real world example of these macros the mentioned project is the right place to take a look. The svn trunk of it can be found at:: svn://pureenergy.cc/pdf_presenter_console/trunk __ http://westhoffswelt.de/projects/pdf_presenter_console.html Acknowledgments =============== Thanks go out to Florian Sowade, a fellow local PHP-Usergroupie, who helped me a lot with the initial version of this macros and always answered my mostly dumb CMake questions. .. _CMake: http://cmake.org .. _Vala: http://live.gnome.org/Vala .. _Genie: http://live.gnome.org/Genie .. Local Variables: mode: rst fill-column: 79 End: vim: et syn=rst tw=79 granite-0.1.0/cmake/ValaVersion.cmake000664 001751 001751 00000007102 11715546243 020672 0ustar00xapantuxapantu000000 000000 ## # Copyright 2009-2010 Jakob Westhoff. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # The views and conclusions contained in the software and documentation are those # of the authors and should not be interpreted as representing official policies, # either expressed or implied, of Jakob Westhoff ## include(ParseArguments) find_package(Vala REQUIRED) ## # Ensure a certain valac version is available # # The initial argument is the version to check for # # It may be followed by a optional parameter to specifiy a version range. The # following options are valid: # # EXACT # Vala needs to be available in the exact version given # # MINIMUM # The provided version is the minimum version. Therefore Vala needs to be # available in the given version or any higher version # # MAXIMUM # The provided version is the maximum. Therefore Vala needs to be available # in the given version or any version older than this # # If no option is specified the version will be treated as a minimal version. ## macro(ensure_vala_version version) parse_arguments(ARGS "" "MINIMUM;MAXIMUM;EXACT" ${ARGN}) set(compare_message "") set(error_message "") if(ARGS_MINIMUM) set(compare_message "a minimum ") set(error_message "or greater ") elseif(ARGS_MAXIMUM) set(compare_message "a maximum ") set(error_message "or less ") endif(ARGS_MINIMUM) message(STATUS "checking for ${compare_message}Vala version of ${version}" ) unset(version_accepted) # MINIMUM is the default if no option is specified if(ARGS_EXACT) if(${VALA_VERSION} VERSION_EQUAL ${version} ) set(version_accepted TRUE) endif(${VALA_VERSION} VERSION_EQUAL ${version}) elseif(ARGS_MAXIMUM) if(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) set(version_accepted TRUE) endif(${VALA_VERSION} VERSION_LESS ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) else(ARGS_MAXIMUM) if(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) set(version_accepted TRUE) endif(${VALA_VERSION} VERSION_GREATER ${version} OR ${VALA_VERSION} VERSION_EQUAL ${version}) endif(ARGS_EXACT) if (NOT version_accepted) message(FATAL_ERROR "Vala version ${version} ${error_message}is required." ) endif(NOT version_accepted) message(STATUS " found Vala, version ${VALA_VERSION}" ) endmacro(ensure_vala_version) granite-0.1.0/cmake/FindGObjectIntrospection.cmake000664 001751 001751 00000003765 11715546243 023353 0ustar00xapantuxapantu000000 000000 # - try to find gobject-introspection # # Once done this will define # # INTROSPECTION_FOUND - system has gobject-introspection # INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner # INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler # INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate # INTROSPECTION_GIRDIR # INTROSPECTION_TYPELIBDIR # INTROSPECTION_CFLAGS # INTROSPECTION_LIBS # # Copyright (C) 2010, Pino Toscano, # # Redistribution and use is allowed according to the terms of the BSD license. # For details see the accompanying COPYING-CMAKE-SCRIPTS file. macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname) execute_process( COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0 OUTPUT_VARIABLE _result RESULT_VARIABLE _null ) if (_null) else() string(REGEX REPLACE "[\r\n]" " " _result "${_result}") string(REGEX REPLACE " +$" "" _result "${_result}") separate_arguments(_result) set(${_outvar} ${_result} CACHE INTERNAL "") endif() endmacro(_GIR_GET_PKGCONFIG_VAR) find_package(PkgConfig) if(PKG_CONFIG_FOUND) if(PACKAGE_FIND_VERSION_COUNT GREATER 0) set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}") endif() pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) if(_pc_gir_FOUND) set(INTROSPECTION_FOUND TRUE) _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner") _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler") _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate") _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir") _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir") set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}") set(INTROSPECTION_LIBS "${_pc_gir_LIBS}") endif() endif() mark_as_advanced( INTROSPECTION_SCANNER INTROSPECTION_COMPILER INTROSPECTION_GENERATE INTROSPECTION_GIRDIR INTROSPECTION_TYPELIBDIR INTROSPECTION_CFLAGS INTROSPECTION_LIBS ) granite-0.1.0/cmake/ValaPrecompile.cmake000664 001751 001751 00000015430 11715546243 021347 0ustar00xapantuxapantu000000 000000 ## # Copyright 2009-2010 Jakob Westhoff. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions and the following disclaimer. # # 2. Redistributions in binary form must reproduce the above copyright notice, # this list of conditions and the following disclaimer in the documentation # and/or other materials provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY JAKOB WESTHOFF ``AS IS'' AND ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO # EVENT SHALL JAKOB WESTHOFF OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE # OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # # The views and conclusions contained in the software and documentation are those # of the authors and should not be interpreted as representing official policies, # either expressed or implied, of Jakob Westhoff ## include(ParseArguments) find_package(Vala REQUIRED) ## # Compile vala files to their c equivalents for further processing. # # The "vala_precompile" macro takes care of calling the valac executable on the # given source to produce c files which can then be processed further using # default cmake functions. # # The first parameter provided is a variable, which will be filled with a list # of c files outputted by the vala compiler. This list can than be used in # conjuction with functions like "add_executable" or others to create the # neccessary compile rules with CMake. # # The initial variable is followed by a list of .vala files to be compiled. # Please take care to add every vala file belonging to the currently compiled # project or library as Vala will otherwise not be able to resolve all # dependencies. # # The following sections may be specified afterwards to provide certain options # to the vala compiler: # # PACKAGES # A list of vala packages/libraries to be used during the compile cycle. The # package names are exactly the same, as they would be passed to the valac # "--pkg=" option. # # OPTIONS # A list of optional options to be passed to the valac executable. This can be # used to pass "--thread" for example to enable multi-threading support. # # CUSTOM_VAPIS # A list of custom vapi files to be included for compilation. This can be # useful to include freshly created vala libraries without having to install # them in the system. # # GENERATE_VAPI # Pass all the needed flags to the compiler to create an internal vapi for # the compiled library. The provided name will be used for this and a # .vapi file will be created. # # GENERATE_HEADER # Let the compiler generate a header file for the compiled code. There will # be a header file as well as an internal header file being generated called # .h and _internal.h # # The following call is a simple example to the vala_precompile macro showing # an example to every of the optional sections: # # vala_precompile(VALA_C # source1.vala # source2.vala # source3.vala # PACKAGES # gtk+-2.0 # gio-1.0 # posix # DIRECTORY # gen # OPTIONS # --thread # CUSTOM_VAPIS # some_vapi.vapi # GENERATE_VAPI # myvapi # GENERATE_HEADER # myheader # ) # # Most important is the variable VALA_C which will contain all the generated c # file names after the call. ## macro(vala_precompile output) parse_arguments(ARGS "PACKAGES;OPTIONS;DIRECTORY;GENERATE_HEADER;GENERATE_VAPI;CUSTOM_VAPIS" "" ${ARGN}) if(ARGS_DIRECTORY) set(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${ARGS_DIRECTORY}) else(ARGS_DIRECTORY) set(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) endif(ARGS_DIRECTORY) include_directories(${DIRECTORY}) set(vala_pkg_opts "") foreach(pkg ${ARGS_PACKAGES}) list(APPEND vala_pkg_opts "--pkg=${pkg}") endforeach(pkg ${ARGS_PACKAGES}) set(in_files "") set(out_files "") set(${output} "") foreach(src ${ARGS_DEFAULT_ARGS}) list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}") string(REPLACE ".vala" ".c" src ${src}) string(REPLACE ".gs" ".c" src ${src}) set(out_file "${DIRECTORY}/${src}") list(APPEND out_files "${DIRECTORY}/${src}") list(APPEND ${output} ${out_file}) endforeach(src ${ARGS_DEFAULT_ARGS}) set(custom_vapi_arguments "") if(ARGS_CUSTOM_VAPIS) foreach(vapi ${ARGS_CUSTOM_VAPIS}) if(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) list(APPEND custom_vapi_arguments ${vapi}) else (${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) list(APPEND custom_vapi_arguments ${CMAKE_CURRENT_SOURCE_DIR}/${vapi}) endif(${vapi} MATCHES ${CMAKE_SOURCE_DIR} OR ${vapi} MATCHES ${CMAKE_BINARY_DIR}) endforeach(vapi ${ARGS_CUSTOM_VAPIS}) endif(ARGS_CUSTOM_VAPIS) set(vapi_arguments "") if(ARGS_GENERATE_VAPI) list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_VAPI}.vapi") set(vapi_arguments "--internal-vapi=${ARGS_GENERATE_VAPI}.vapi") # Header and internal header is needed to generate internal vapi if (NOT ARGS_GENERATE_HEADER) set(ARGS_GENERATE_HEADER ${ARGS_GENERATE_VAPI}) endif(NOT ARGS_GENERATE_HEADER) endif(ARGS_GENERATE_VAPI) set(header_arguments "") if(ARGS_GENERATE_HEADER) list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") list(APPEND out_files "${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") list(APPEND header_arguments "--header=${DIRECTORY}/${ARGS_GENERATE_HEADER}.h") list(APPEND header_arguments "--internal-header=${DIRECTORY}/${ARGS_GENERATE_HEADER}_internal.h") endif(ARGS_GENERATE_HEADER) add_custom_command(OUTPUT ${out_files} COMMAND ${VALA_EXECUTABLE} ARGS "-C" ${header_arguments} ${vapi_arguments} "-b" ${CMAKE_CURRENT_SOURCE_DIR} "-d" ${DIRECTORY} ${vala_pkg_opts} ${ARGS_OPTIONS} ${in_files} ${custom_vapi_arguments} DEPENDS ${in_files} ${ARGS_CUSTOM_VAPIS} ) endmacro(vala_precompile) granite-0.1.0/cmake/README000664 001751 001751 00000000411 11715546243 016313 0ustar00xapantuxapantu000000 000000 Elementary CMake modules This is a set of CMake modules: Translations, GSettings, and Vala modules. For all the Vala related modules see README.Vala.rst: - ParseArguments.cmake - ValaPrecompile.cmake - ValaVersion.cmake - FindVala.cmake granite-0.1.0/po/tr.po000664 001751 001751 00000003030 11715546243 015756 0ustar00xapantuxapantu000000 000000 # Turkish translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2012-01-03 17:50+0000\n" "Last-Translator: Muhammet Kara \n" "Language-Team: Turkish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%e %B, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menü" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Çevrimiçi Yardım Alın..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Bu Uygulamayı Tercüme Edin..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Bir Sorun Bildirin..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Hakkında" granite-0.1.0/po/nl.po000664 001751 001751 00000003027 11715546243 015750 0ustar00xapantuxapantu000000 000000 # Dutch translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-31 19:01+0000\n" "Last-Translator: RobinJ \n" "Language-Team: Dutch \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Online hulp verkrijgen..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Deze toepassing vertalen…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Een probleem melden…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Informatie" granite-0.1.0/po/de.po000664 001751 001751 00000003011 11715546243 015720 0ustar00xapantuxapantu000000 000000 # German translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-24 18:53+0000\n" "Last-Translator: haeckle \n" "Language-Team: German \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menü" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Online Hilfe erhalten..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Diese Anwendung übersetzen …" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Ein Problem melden …" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Über" granite-0.1.0/po/ru.po000664 001751 001751 00000003125 11715546243 015764 0ustar00xapantuxapantu000000 000000 # Russian translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-12-30 09:02+0000\n" "Last-Translator: Nikita Putko \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Меню" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Справка в интернете..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Перевести это приложение..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Сообщить о проблеме..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "О программе" granite-0.1.0/po/ca.po000664 001751 001751 00000003034 11715546243 015720 0ustar00xapantuxapantu000000 000000 # Catalan translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-16 20:07+0000\n" "Last-Translator: Alfredo Hernández \n" "Language-Team: Catalan \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%H:%M" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%e %B del %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menú" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Obteniu ajuda en línia..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Traduïu aquesta aplicació..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Informeu d'un problema..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Quant a" granite-0.1.0/po/en_GB.po000664 001751 001751 00000003054 11715546243 016311 0ustar00xapantuxapantu000000 000000 # English (United Kingdom) translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-16 20:05+0000\n" "Last-Translator: Alfredo Hernández \n" "Language-Team: English (United Kingdom) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%H:%M" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Get Help Online..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Translate This Application..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Report a Problem..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "About" granite-0.1.0/po/ro.po000664 001751 001751 00000003022 11715546243 015752 0ustar00xapantuxapantu000000 000000 # Romanian translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-12-06 23:14+0000\n" "Last-Translator: Cristian Turcu \n" "Language-Team: Romanian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%e %B %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Meniu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Obține ajutor online..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Tradu această aplicaţie" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Raportează o problemă..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Despre" granite-0.1.0/po/zh_TW.po000664 001751 001751 00000003061 11715546243 016370 0ustar00xapantuxapantu000000 000000 # Chinese (Traditional) translation for granite # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2012-01-07 13:38+0000\n" "Last-Translator: Cheng-Chia Tseng \n" "Language-Team: Chinese (Traditional) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%p %l:%M" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%Y年%b%e日" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "選單" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "取得線上幫助...." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "翻譯這個程式..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "回報問題..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "關於" granite-0.1.0/po/hi.po000664 001751 001751 00000003177 11715546243 015745 0ustar00xapantuxapantu000000 000000 # Hindi translation for granite # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2012-02-07 17:40+0000\n" "Last-Translator: Satchit Bhogle \n" "Language-Team: Hindi \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-02-08 07:51+0000\n" "X-Generator: Launchpad (build 14747)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "सूची" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "ऑनलाईन मदद पाँए" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "इस अनुप्रयोग का अनुवाद करें" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "समस्या रिपोर्ट करें" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "जानकारी" granite-0.1.0/po/CMakeLists.txt000664 001751 001751 00000000231 11715546243 017531 0ustar00xapantuxapantu000000 000000 include(Translations) add_translations_directory("granite") add_translations_catalog("granite" ../lib/ ../lib/Widgets/ ../lib/Services/ ../lib/Drawing/) granite-0.1.0/po/sk.po000664 001751 001751 00000003004 11715546243 015747 0ustar00xapantuxapantu000000 000000 # Slovak translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-24 19:14+0000\n" "Last-Translator: Martin Maričák \n" "Language-Team: Slovak \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Získať pomoc z internetu..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Preložiť túto aplikáciu..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Nahlásiť problém..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "O ..." granite-0.1.0/po/fr.po000664 001751 001751 00000003017 11715546243 015745 0ustar00xapantuxapantu000000 000000 # French translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-24 18:44+0000\n" "Last-Translator: Devil505 \n" "Language-Team: French \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Obtenir de l'aide en ligne…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Traduire cette application…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Signaler un bogue..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "À propos." granite-0.1.0/po/eo.po000664 001751 001751 00000003024 11715546243 015737 0ustar00xapantuxapantu000000 000000 # Esperanto translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-11-06 17:38+0000\n" "Last-Translator: Michael Moroni \n" "Language-Team: Esperanto \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%H:%M" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menuo" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Akiri retan helpon..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Traduki ĉi tiun aplikaĵon…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Raporti problemon…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Pri" granite-0.1.0/po/pl.po000664 001751 001751 00000003035 11715546243 015751 0ustar00xapantuxapantu000000 000000 # Polish translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2012-02-04 15:20+0000\n" "Last-Translator: Piotr Sokół \n" "Language-Team: Polish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-02-05 05:09+0000\n" "X-Generator: Launchpad (build 14738)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Rozwija menu poleceń" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Znajdź pomoc w sieci..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Przetłumacz ten program..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Zgłoś problem..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "O programie" granite-0.1.0/po/en_CA.po000664 001751 001751 00000003027 11715546243 016304 0ustar00xapantuxapantu000000 000000 # English (Canada) translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-22 23:49+0000\n" "Last-Translator: Jeremy Rea \n" "Language-Team: English (Canada) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Get Help Online..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Translate This Application..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Report a Problem..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "About" granite-0.1.0/po/es.po000664 001751 001751 00000003042 11715546243 015743 0ustar00xapantuxapantu000000 000000 # Spanish translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2012-01-13 19:58+0000\n" "Last-Translator: Fitoschido \n" "Language-Team: Spanish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%e %B, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menú" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Obtener ayuda en línea…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Traducir esta aplicación…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Informar de un problema…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Acerca de" granite-0.1.0/po/eu.po000664 001751 001751 00000003016 11715546243 015746 0ustar00xapantuxapantu000000 000000 # Basque translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-23 18:00+0000\n" "Last-Translator: Eneko Sarasola \n" "Language-Team: Basque \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%Y %B %e" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menua" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Laguntza sarean lortu..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Itzuli Programa Hau..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Akats baten berri eman..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Honi buruz" granite-0.1.0/po/en_AU.po000664 001751 001751 00000003017 11715546243 016325 0ustar00xapantuxapantu000000 000000 # English (Australia) translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-30 01:41+0000\n" "Last-Translator: Adam Brenecki \n" "Language-Team: English (Australia) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Get Help Online..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Translate This Application..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Report a Problem..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "About" granite-0.1.0/po/he.po000664 001751 001751 00000003072 11715546243 015733 0ustar00xapantuxapantu000000 000000 # Hebrew translation for granite # Copyright (c) 2012 Rosetta Contributors and Canonical Ltd 2012 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2012. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2012-01-11 09:17+0000\n" "Last-Translator: Yaron \n" "Language-Team: Hebrew \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%H:%M" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%e ב%B,‏ %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "תפריט" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "קבלת עזרה דרך האינטרנט..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "תרגום יישום זה..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "דיווח על בעיה..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "על אודות" granite-0.1.0/po/sv.po000664 001751 001751 00000002775 11715546243 016000 0ustar00xapantuxapantu000000 000000 # Swedish translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-11-01 10:36+0000\n" "Last-Translator: Emaspounder \n" "Language-Team: Swedish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Meny" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Få hjälp på internet..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Översätt det här programmet..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Rapportera problem..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Om" granite-0.1.0/po/pt.po000664 001751 001751 00000003035 11715546243 015761 0ustar00xapantuxapantu000000 000000 # Portuguese translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-12-01 16:37+0000\n" "Last-Translator: David Gomes \n" "Language-Team: Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Obter Ajuda Online" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Traduzir Esta Aplicação..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Reportar um problema..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Sobre" granite-0.1.0/po/cs.po000664 001751 001751 00000003020 11715546243 015735 0ustar00xapantuxapantu000000 000000 # Czech translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-11-06 18:30+0000\n" "Last-Translator: Radim Hvizdák \n" "Language-Team: Czech \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Nabídka" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Získat pomoc online..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Přeložit tuto aplikaci..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Nahlásit problém..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "O programu" granite-0.1.0/po/pt_BR.po000664 001751 001751 00000003037 11715546243 016346 0ustar00xapantuxapantu000000 000000 # Brazilian Portuguese translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2012-01-19 17:33+0000\n" "Last-Translator: DavyS \n" "Language-Team: Brazilian Portuguese \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menu" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Obter Ajuda Online..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Traduzir Este Aplicativo..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Reportar um Problema..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Sobre" granite-0.1.0/po/fi.po000664 001751 001751 00000003020 11715546243 015726 0ustar00xapantuxapantu000000 000000 # Finnish translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-26 08:46+0000\n" "Last-Translator: Erkka Juhaninmäki \n" "Language-Team: Finnish \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%H:%M" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%e. %Bta %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Valikko" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Hae apua verkosta..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Käännä tämä ohjelma..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Ilmoita ongelmasta..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Tietoja" granite-0.1.0/po/bs.po000664 001751 001751 00000003021 11715546243 015735 0ustar00xapantuxapantu000000 000000 # Bosnian translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-28 21:53+0000\n" "Last-Translator: Daniel4x \n" "Language-Team: Bosnian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Meni" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Potražite pomoć na Internetu..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Prevedite ovu Aplikaciju..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Prijavite problem..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "O" granite-0.1.0/po/granite.pot000664 001751 001751 00000002504 11715546243 017153 0ustar00xapantuxapantu000000 000000 # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "" granite-0.1.0/po/lv.po000664 001751 001751 00000003031 11715546243 015753 0ustar00xapantuxapantu000000 000000 # Latvian translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-22 16:59+0000\n" "Last-Translator: Kārlis Lukstiņš \n" "Language-Team: Latvian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Izvēle" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Meklēt palīdzību tiešsaitē..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Tulkot šo programmu..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Ziņot par problēmu..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Par" granite-0.1.0/po/it.po000664 001751 001751 00000003044 11715546243 015752 0ustar00xapantuxapantu000000 000000 # Italian translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-12 18:25+0000\n" "Last-Translator: Giulio Collura \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menù" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Ottieni Aiuto Online..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Traduci Questa Applicazione..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Segnala un Problema..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Informazioni" granite-0.1.0/po/zh_CN.po000664 001751 001751 00000003046 11715546243 016341 0ustar00xapantuxapantu000000 000000 # Chinese (Simplified) translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-12-02 08:36+0000\n" "Last-Translator: 英华 \n" "Language-Team: Chinese (Simplified) \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%p%l:%M" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e,%Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "菜单" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "获得在线帮助..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "翻译此应用程序..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "报告问题..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "关于" granite-0.1.0/po/hu.po000664 001751 001751 00000003022 11715546243 015746 0ustar00xapantuxapantu000000 000000 # Hungarian translation for granite # Copyright (c) 2011 Rosetta Contributors and Canonical Ltd 2011 # This file is distributed under the same license as the granite package. # FIRST AUTHOR , 2011. # msgid "" msgstr "" "Project-Id-Version: granite\n" "Report-Msgid-Bugs-To: FULL NAME \n" "POT-Creation-Date: 2011-08-30 14:55+0200\n" "PO-Revision-Date: 2011-10-24 18:44+0000\n" "Last-Translator: András Bognár \n" "Language-Team: Hungarian \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Launchpad-Export-Date: 2012-01-29 05:30+0000\n" "X-Generator: Launchpad (build 14727)\n" #: /home/xapantu/granite-cmake/po/../lib/Widgets//TimePicker.vala:25 msgid "%l:%M %p" msgstr "%l:%M %p" #: /home/xapantu/granite-cmake/po/../lib/Widgets//DatePicker.vala:25 msgid "%B %e, %Y" msgstr "%B %e, %Y" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:38 #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:52 msgid "Menu" msgstr "Menü" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:64 msgid "Get Help Online..." msgstr "Online segítség..." #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:65 msgid "Translate This Application..." msgstr "Ezen alkalmazás fordítása…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:66 msgid "Report a Problem..." msgstr "Hiba jelentése…" #: /home/xapantu/granite-cmake/po/../lib/Widgets//AppMenu.vala:67 msgid "About" msgstr "Névjegy" granite-0.1.0/CMakeLists.txt000664 001751 001751 00000001436 11715546243 017123 0ustar00xapantuxapantu000000 000000 # Check http://webdev.elementaryos.org/docs/developer-guide/cmake for documentation cmake_minimum_required (VERSION 2.6) cmake_policy(VERSION 2.6) project(granite) list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/ ) set(RESOURCES_DIR ${CMAKE_INSTALL_PREFIX}/share/granite/) set(GETTEXT_PACKAGE GRANITE) configure_file (${CMAKE_SOURCE_DIR}/lib/config.h.cmake ${CMAKE_BINARY_DIR}/lib/config.h) set(CPACK_PACKAGE_VERSION "0.1.0") set(CPACK_SOURCE_GENERATOR "TGZ") set(CPACK_SOURCE_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION}") set(CPACK_SOURCE_IGNORE_FILES "/build/;/.bzr/;/.bzrignore;~$;${CPACK_SOURCE_IGNORE_FILES}") include(CPack) add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source) add_subdirectory (lib) add_subdirectory (po) add_subdirectory(demo) granite-0.1.0/demo/CMakeLists.txt000664 001751 001751 00000001526 11715546243 020047 0ustar00xapantuxapantu000000 000000 find_package(Vala REQUIRED) include(ValaVersion) ensure_vala_version("0.11.3" MINIMUM) include(ValaPrecompile) include_directories(${CMAKE_CURRENT_BINARY_DIR}/../lib/) # pkgconfig, real C code set(CMAKE_INCLUDE_CURRENT_DIR ON) # TODO: configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) find_package(PkgConfig) pkg_check_modules(DEPS REQUIRED gtk+-3.0) set(CFLAGS ${DEPS_CFLAGS} ${DEPS_CFLAGS_OTHER} ) set(LIB_PATHS ${DEPS_LIBRARY_DIRS}) link_directories(${LIB_PATHS} ${CMAKE_CURRENT_BINARY_DIR}/../lib/) add_definitions(${CFLAGS}) vala_precompile(VALA_C main.vala CUSTOM_VAPIS ${CMAKE_CURRENT_BINARY_DIR}/../lib/granite.vapi PACKAGES gtk+-3.0 OPTIONS --thread ) add_executable(granite-demo ${VALA_C}) target_link_libraries(granite-demo granite ${DEPS_LIBRARIES}) install (TARGETS granite-demo RUNTIME DESTINATION bin) granite-0.1.0/demo/main.vala000664 001751 001751 00000020760 11715546243 017101 0ustar00xapantuxapantu000000 000000 /* * Copyright (c) 2011-2012 Lucas Baudin , Jaap Broekhuizen * * This is a free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of the * License, or (at your option) any later version. * * This is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * General Public License for more details. * * You should have received a copy of the GNU General Public * License along with this program; see the file COPYING. If not, * write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * */ using Granite.Widgets; using Granite.Services; public class Granite.Demo : Granite.Application { construct { application_id = "demo.granite.org"; program_name = "Granite Demo"; app_years = "2011"; build_version = "1.0"; app_icon = "text-editor"; main_url = "https://launchpad.net/granite"; bug_url = "https://bugs.launchpad.net/granite"; help_url = "https://answers.launchpad.net/granite"; translate_url = "https://translations.launchpad.net/granite"; about_authors = {"Kekun", null }; about_documenters = {"Valadoc", null }; about_artists = {"Daniel P. Fore", null }; about_authors = {"Maxwell Barvian ", "Daniel Foré ", "Avi Romanoff ", null }; about_comments = "A demo of the Granite toolkit"; about_translators = "Launchpad Translators"; about_license_type = Gtk.License.GPL_3_0; } public Demo() { } public override void activate() { var win = new Gtk.Window(); win.delete_event.connect( () => { Gtk.main_quit(); return false; }); var notebook = new Gtk.Notebook(); win.add(notebook); /* welcome */ // These strings will be automatically corrected by the widget var welcome = new Welcome("Granite's Welcome Screen", "This is Granite's Welcome widget."); notebook.append_page(welcome, new Gtk.Label("Welcome")); Gdk.Pixbuf? pixbuf = null; try { pixbuf = Gtk.IconTheme.get_default().load_icon ("document-new", 48, Gtk.IconLookupFlags.GENERIC_FALLBACK); } catch(Error e) { warning("Could not load icon, %s", e.message); } Gtk.Image? image = new Gtk.Image.from_icon_name("document-open", Gtk.IconSize.DIALOG); // Adding elements. Use the most convenient function to add an icon welcome.append_with_pixbuf(pixbuf, "Create", "Write a new document."); welcome.append_with_image(image, "Open", "select a file."); welcome.append("document-save", "Save", "With a much longer description."); welcome.append("help-info", "Discover", "Learn more about this application."); /* modebutton */ var mode_button = new ModeButton(); mode_button.valign = Gtk.Align.CENTER; mode_button.halign = Gtk.Align.CENTER; mode_button.append(new Gtk.Label("Hardware")); mode_button.append(new Gtk.Label("Input")); mode_button.append(new Gtk.Label("Output")); mode_button.append(new Gtk.Label("Quite long")); mode_button.append(new Gtk.Label("Very very long \n with a line break")); var vbox = new Gtk.VBox(false, 0); var toolbar = new Gtk.Toolbar(); toolbar.get_style_context().add_class("primary-toolbar"); var toolbutton = new Gtk.ToolItem(); var tool_mode = new ModeButton(); tool_mode.append_icon ("view-list-column-symbolic", Gtk.IconSize.MENU); tool_mode.append_icon ("view-list-details-symbolic", Gtk.IconSize.MENU); tool_mode.append_icon ("view-list-icons-symbolic", Gtk.IconSize.MENU); tool_mode.append_icon ("view-list-video-symbolic", Gtk.IconSize.MENU); toolbutton.add(tool_mode); toolbar.insert(toolbutton, -1); toolbar.insert(create_appmenu(new Gtk.Menu()), -1); vbox.pack_start(toolbar, false, false);toolbar = new Gtk.Toolbar(); toolbar.get_style_context().add_class("inline-toolbar"); toolbutton = new Gtk.ToolItem(); tool_mode = new ModeButton(); tool_mode.append(new Gtk.Label("1")); tool_mode.append(new Gtk.Label("2")); tool_mode.append(new Gtk.Label("3")); tool_mode.append(new Gtk.Label("4")); toolbutton.add(tool_mode); toolbar.insert(toolbutton, -1); vbox.pack_start(toolbar, false, false); vbox.pack_start(mode_button); mode_button = new ModeButton(); mode_button.valign = Gtk.Align.CENTER; mode_button.halign = Gtk.Align.CENTER; mode_button.append(new Gtk.Label("Small")); mode_button.append(new Gtk.Label("a")); vbox.pack_start(mode_button); notebook.append_page(vbox, new Gtk.Label("ModeButton")); /* static notebook */ var staticbox = new Gtk.VBox (false, 5); var staticnotebook = new StaticNotebook (); var pageone = new Gtk.Label("Page 1"); staticnotebook.append_page (new Gtk.Label("Page 1"), pageone); staticnotebook.append_page (new Gtk.Label("Page 2"), new Gtk.Label("Page 2")); staticnotebook.append_page (new Gtk.Label("Page 3"), new Gtk.Label("Page 3")); staticnotebook.page_changed.connect(() => pageone.set_text("Page changed")); staticbox.add (staticnotebook); notebook.append_page (staticbox, new Gtk.Label ("Static Notebook")); var button_about = new Gtk.Button.with_label("show_about"); notebook.append_page (button_about, new Gtk.Label ("About Dialog")); button_about.clicked.connect(() => { show_about(win); } ); var popover_buttons = new Gtk.VBox(false, 0); var hbox3 = new Gtk.HBox(false, 0); hbox3.halign = Gtk.Align.END; var popover1 = new Gtk.Button.with_label("PopOver 1"); popover1.halign = Gtk.Align.END; hbox3.add(popover1); popover1.clicked.connect( () => { var pop = new PopOver(); var pop_hbox = (Gtk.Box)pop.get_content_area(); pop_hbox.add(new HintedEntry("This is an HIntedEntry")); pop_hbox.add(new Gtk.Label("Another label")); var mode_pop = new ModeButton(); mode_pop.append(new Gtk.Label("ele")); mode_pop.append(new Gtk.Label("ment")); mode_pop.append(new Gtk.Label("tary")); pop_hbox.add(mode_pop); pop_hbox.add(new DatePicker()); pop.set_parent_pop (win); pop.move_to_widget(popover1); pop.show_all(); pop.present(); pop.run (); pop.destroy (); }); popover_buttons.pack_start(new Gtk.Label("Let's try the PopOvers!"), false, false); popover_buttons.pack_start(hbox3, false, false); notebook.append_page (popover_buttons, new Gtk.Label ("PopOvers")); var calendar_button = new Gtk.HBox(false, 0); var date_button = new Granite.Widgets.DatePicker.with_format("%d-%m-%y"); date_button.valign = date_button.halign = Gtk.Align.CENTER; calendar_button.add(date_button); notebook.append_page (calendar_button, new Gtk.Label ("Calendar")); /* Contractor */ var contractor_tab = new Gtk.VBox (false, 0); notebook.append_page (contractor_tab, new Gtk.Label ("Contractor")); var text_view = new Gtk.TextView (); GLib.HashTable[] hash_ = Contractor.get_contract("/.zip", "application/zip"); foreach(var hash in hash_) { text_view.buffer.text += hash.lookup("Name") + ": " + hash.lookup("Description") + " icon: " + hash.lookup("Exec") + "\n"; } contractor_tab.add(text_view); contractor_tab.add(new ContractorView("file:///home/user/file.txt", "text/plain")); /* window properties */ win.show_all(); win.resize(800, 600); } public static int main(string[] args) { new Granite.Demo().run(args); Gtk.main(); return 0; } } granite-0.1.0/doc/images/popover.png000664 001751 001751 00000034237 11715546243 020602 0ustar00xapantuxapantu000000 000000 PNG  IHDRzTXtRaw profile type exifxU 0ߙF/&SZGVQ,L:3V p[ce&td::h3< ;vt=LLjT5r|ixL,^ iTXtXML:com.adobe.xmp Ƥ2sBIT|d IDATxy\y:K/3ӳ2 $ ٌ!`c7ر$78q{Nl0XUЎhc;眺tLϨg R3:[W_U}G\~DIIid: JJS BA4L14Ր)ʔRڥAI0PIY)# om&D vPT!u q.d6o_YG>')ؔ.__¶KÙܻVn^eϱ}*UtyBX|=4S£tqqj^ݿwg/`S ۰a a`% l,n o7OYJ_҇p8eو(TRi9X.RS2-q&5j(ؔ>ܐA$<Уddd!BL>@dca)vZ eKmC j MCѣ)**frjkkٴiRJn݊l6%eۻA&CXVbԲ wzESC;mҰ]˖ a$XjIBr*Ҍe٤cYRJ233#4 sc & NY$l[#V=~8 <&퍭tK6a_ gLB|hhhTDir͝;+W ,`0ӧB`\.armYˮoN] d1zD=Y|j^CG]/U>l9a%w M8D4 sy_؄Z@4ihƙ3g#x<,X隣 &A6M(|M30OaG~zκ=1aw>*+`~9-dgep*G0PLӤٳilG A"&DzCX.hB'dE˲uLfO//zN)iedd`Ymž}{C (*.kގmdffq_|~" [*ު*Um&dX`?O'!Y)y JMMZvBnʹBY)% ZX,dt$<K&A28|N$p's;i7|^iZ$&%Equ!p)%L-!pZ&׳>-?Kʀ)%={zjdeeQPXn , 4MvMgg'=dQY(J0T #3?~$p* ǝT˥t koo'xuvvuO{{;%jɆX2]b>j[{8x=zOdt{2ӥt) ӴѦiCJƶW@cCݤ~4.j.4u>AW{bK,b6Ooo/v$/A IkE tunMr .Ȫ?  E998@[{aɅ 8^ut%p=Sttۄfc5ku*ʨIkZho mk䑙Mu)۞nں,B8H[na QC*ؔc[>Uߘzؾ};/R:4$~M4ץ`]B;5V{R4f]]{9eE4nK&8$x!Lkc΍Mi]K_$wEщ'Q`RVMi ]nӽS}~>1D@ITR\?9d,+O4HS?!\W)]Vм;s MM![1$Ȓ18DAv !dhrؤMi0d|4\'5&coE_+H^$PLXD%GΖa=q !$ԗ LF!3MMngw8y#E$A( ;=uTJܩvuvLdt&;a\Kiz#ySq)F 7 .([M ̝3I_a&ϟ#)ܔ} ᬙ`0%:b*ilP 35Tnҋsdtiru(+iȪvtvp;cF q$u,"Q6,~\dLL"z4/9HD?$a'%t-Ys-)"wwud`F"3&]0@8+%X̪ ]B9DȆ|VY!Hno4*%U()M%,ޞjjΩ?CeV" 4\nw9ϩmܐUE(XۣҴ) r}51D]Fwp?`55;g. +54qyJpkSKM5K<܁PeY46S>ܤЕb4Q[SKQIIܦ@'Ȋ -.J! S/@Ӡ ʍeaD!WXcc*+4c%`QbG]41Q ȫ,ikmq+4xhokXhۍN%uHIߣ҇BXH.%uR³wf}>3s2]AcdYIC6t9TNmea3 _D?MLw7$No{_•%&&ْ 2+)qJeaNlf9~ۿ>Kp&\ '@w9R@N{j FN.LmDdLUeGA8ķغ@`1b5Uн䔔PEK< ?MzfdWF8lTҢnpnO{mok g0e~-ZDl|aaH4MGbq%DMh–:1pK]i[XR`EKyeK@&?qA}\4r Ųa{࠰h"JlF C=dɶ`ScU9%/ ȅ,k??ʼnvz߳g_`[?fMtvai^f-և9h2D-'IB^/޹l_8OKGȍ^L2_߳}Qϡo-i,)8v4ϾYEm'dZM{[~-q'|;_o*@jw ;8/y9އ--۶ ^')#(}eiLe0#V!zO۵9ױ(SO8&;qK4J{,dTlIw[{_<3xlEؽT?;Ȯ^RsSn[@Z/?'@I95A6c* _A$ۘB[T%spJg7qﲿ6Ģr%(?BxEfKXx+f^B,9sŝY@qqA kwϖu>u{ .$KlrRF= _Ա]aKyU k>{Wi<nJJVK.<#=0ʗ'Ll6|ӕxvW<\>ifN tE}y': j^>0z- mq:[(gb>:7eghQ87ڀYҶhG:k۱h1cf^Nm :ѥoc93mAdc9*7.泼ٴ㲊F^9ڋl븯KJ,9k3 7cSԋ"\=0_{^97Pt̻uܳu;\wq= ip]>F0sjm [m ptd9zӱiK|G*kGJ.^6 _^C^tܾL £ʺyDPfQW05x#H;O?+b~allM ʢ~Ω2"t?7Wlُ {rYE_Ĭ~?>/%Ot@<ؕsXs&زk ?>J[?}|jȚ>m"@/s  ϽoZ+h躁?jcM?0\f@vÿ!*I[?7DR]gY{=nMc d=fHc飹 jd« .r*n3Y.(dpjJS()))ȔQ`mOFDBBS}BxqB*&)+&L㮗i;.}uWy%dUp21 s6{%iupm-;gvi:?`Ţln6ne !jOrofe.!) -w;OʒX8D\xYDv"Hwɘ]Bi^.o䮺ØI.A+P!I) pƵ\MniFxI8-uR}Zz߼9#μR lmC spF "c+9xrXZZd_j2ifd(,-#U8]kG?xMdp|6..n'͗Caq ^fGfoɯެl\d{E!X_Ri)}(D&.]l KWkkUdZ>G.,ȁ- N7*-B?LXX#=A,,\MKEK/b-эF+1 J32۲:MirV5Y:(q~J7=28{K~/-D6_'HCPC FI&jtæ+~3~y8[?(T $v/暻bӻzn|Ez%h?ONjXwLC[gLƂo\*(͔1$Hڢ2B9Y2ĥ-ܾlVO'[wzk nsw.n$Vk;[N\ 1/H?҄# ~F+"w]6ޮyaa@}(oEHE>Ďg2ֽ͎spɹdo_-du,vKrmXs =M4cd VǶBI1|N uT(q`́4´7'5R:z;p8z /X0g؋5RiA/{FA Ip3(Hs $*(ȄՍ0qTqtM]MTbzA7Ɠ[8!# bcIl ꇔyY/n@Ý{+(I%؏@bpU4]}M3 "Ra` 'VAi@:Y;uE븹r. 9qTqS5 :d/[Yiۨ>Lp~1[:`RTd6)Ja!w hD"xfm]q,<h|*F5wrW`p-2nqV}?nX;pPl`4ez'P-mUiSg_(bXD['``GJW0ޯ_];zqܙ]ukHw7w|~s|=-bUq #MTwM4hqUP˚ }}~L^vE;l6hb#{n(AXt=:4]_9ד:=p+&bކ'=sTA䑟酮 7*_t@s1slz[q~R4LE3i9w/g#<.ݷeĔhb@jFt?g,X]\Ү)PRR)))ȔdJJ 2%%LIIA SRRR)))ȔdJJPӶ@ز,,CBI)Ѝi8mL`eS}u AeuWJ*]MI,/4imZ~ձmq{ܬL5l7%1&@~~!\QII[k+bܘ9-JJ#IJ디D1 1Y0`JSfLӌ Ok]5(T)M)h3a2)XdM66uǶm2;:RSEXqpkz,0{raW ^Fiũ7_D][OF3 P-nZi 8;?F"ӤDw7IMC퀦kZ6ТwR&E]eŹ{;_^@hw$L]F mc1Lav٦iL&dF{ϧb"FdD@@Č IDATAj: }5wn^/Ι#q֖BF%W΍3~_Ը:8( v> #?EMc!WodmC_ {$ME:%Kob|H!i\f50PG S<@^>BpVr TOWL~L&L:]M{X\$hjhr`wR <=[ufx5T. A6c.G9Y'Yz& >6Gu2gj/w}z'E{H@>~p*V~jD^vy(si9Eaٝ{mRrd͝'ľm6z.΍6wB6v4zs)WqGE&&#δ`FvZͼB|pG_Ys5n\$ܼ>R:hj --P:ds݈2gx 7%VJ'k#=T=BoMuRCL;,R&.6#oEYJN4̥(']%OqY)b -upA Mv7 -!RH"߱ګ8њJBBKQ}Mfb"!HSHaLI(`+ $խn>ɮT歘9T-AyipTR),y&;stA'Ġ6wX7ɴ9=m#/#qc4ml7DCIvqzRlo".$3v(a:j;dj f6nY=LI?fvAII_K}fyP}!ɗ~)Gulj1ZGc aO))`f1?; -[ ٿpdHS.oȢTӴKӻ8;]Cn;ut,*\ѳ& v􁙂K-LZy^a&-"p]噸Id!Ȩ-,BA VɆۯ"BR^TG)4u甑 l;A?(B~lth 0e=kā1Γ;x`=iLξt.,sQy@XK@;}3-H/ŔvqDRnj@z%YFm]k%XJOq6.Ə4K6eLJWZxKQ[褕_Ϛ*T2S~ЄN}5)%ql}LӅ8o3 TV ˧LPB)Pr4=UI&ļlMM |pmVtIFF:cMhFcl0 JJ).)Sa OlvRעE6Z;Me(4p[ϾURRRfĖQAK^ZR+v W0׿N{G㨓2E)i#?n,A˯oN@6UCT*6!?)& BmX.9dE^&ޔTu,۶dtMx<>ϐ@RR" )Ҿ;I%U,Qusr z=*&Ie:+VW^[oq]Xx de:Nɴjxޗִ傂"NVUwkI%MܯY[~z{{չciڰ'yM]4 )AuvaK@iied cv_=>,?nu )%55ф7cьL!.y "RRXTg5¢"5nH%16nȓO># W,0 azΡo dcN?0ԟ{Lq,%AjF#%q.пJX qnw4MVXAuuϦϏ?ҥKJ (6wb ?P|c$8d,?H""XE]uVvɧ>)>~_Z2M|>avW0QkbJ%E<$R:Ðـ~?˖Ӵ}N>RRR(++_|3))TviGͮ :1S ؄--Zt=.b"dokjjxYx1-|_xᅭvddd\QQ Hq`5@KZ'cbцA%Zn,\Daa!Vw}@__W9}41{l^р}b+yQĩؼi$`hbL_]w?;TVVrXd1?+VXv͚+flLdhC]©,i#EPû_?[nfΜ9ddd _ϰc;nK_ɡVk$i*K8Vq) /۶hl}}}&;AŢ ֮[Yx`lJ 4gD:RJB~!)))&T6e]8%6mИKQ4S-ۇxІ;(.*]J.%\ 8X%hoj`FItY.eɔdJJ 2%%<&>dJJ 2%%%LIIA4adW^IENDB`granite-0.1.0/doc/css/main.css000664 001751 001751 00000144346 11715546243 017366 0ustar00xapantuxapantu000000 000000 /* Authors: elementary web team (khampal, cassidyjames, and more!) Year: 2011 Notice: You may not use this stylesheet without the elementary web team's permission, except for your personal use only. */ /* Import Fonts */ @import url(http://fonts.googleapis.com/css?family=Droid+Sans); @import url(http://fonts.googleapis.com/css?family=Vollkorn); @media screen { @font-face { font-family: 'URW Gothic'; font-style: normal; font-weight: normal; src: local('URW Gothic'), url('../fonts/urw_gothic_l_book.ttf') format('truetype'); } } /* Fun with animations (Not :P) */ /* @-webkit-keyframes Notify-OSD { 100%{ opacity:0; } } */ /* Lets reset it all! */ /* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 License: none (public domain) */ html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, embed, figure, figcaption, footer, header, hgroup, menu, nav, output, ruby, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; } /* HTML5 display-role reset for older browsers */ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display:block; } body { line-height:1; } ol, ul { list-style:none; } blockquote, q { quotes:none; padding-left:2em; font-family:"Vollkorn",sans-serif; } blockquote p, q p { font-size:14px!important; } blockquote:before, blockquote:after, q:before, q:after { content:''; content:none; } table { border-collapse:collapse; border-spacing:0; } /* Main */ body{ background:#E1E1E1 url("http://elementaryos.org/sites/all/themes/elementary/img/noise.png"); color:#666; font-size:14px; font-family:'Droid Sans',arial,sans-serif; overflow-y:scroll; } a{ text-decoration:none; color:#08c; } a:hover{ color:#333; } h1, h1 a{ color:#4d4d4d; font-size:32px; font-weight:bold; padding: 0 0 5px; line-height: 32px; } h2, h2 a{ font-size:22px; font-weight:bold; color:#999; margin-bottom:10px; } h3, h3 a{ color:#999; font-size:16px; font-weight:bold; padding: 5px 0; } h4, h4 a{ color: #4D4D4D; font-weight: normal; font-size: 16px; line-height: 20px; margin-bottom: 5px; } em, i{ font-style:italic; } strong, b{ font-weight:bold; } pre{ background:#F2F2F2; color: #000; border:dashed 1px #CCC; padding:10px; font-family:Lucida Console, "Courier New", monospace; } table{ width:100%; font-size: 9pt; } thead th{ border-bottom:1px solid #E4E4E4; } hr{ height: 1px; width: 100%; border: 0; border-bottom: 1px solid #CCC; clear: both; } /* Pseudos */ :focus{ outline:0; } /* Containers */ #container{ width:940px; margin:0 auto; padding-top:30px; position:relative; } /* For our dear IE users */ .ie-alert { width:100%; padding:10px 0; background:#FAA; border:solid 1px #FF5656; text-align:center; } /* Global */ ul.links li { display:inline; list-style-type:none; padding:0; } /* Generic Node Styles */ .node-unpublished { background-color:#fff4f4; outline:dashed 2px #fcc; } /* Header */ #logo{ font-size:22px; line-height:40px; height:40px; padding-left:42px; background:url("http://elementaryos.org/sites/all/themes/elementary/img/logo.png") no-repeat 0 4px; float:left; display:inline-block; margin-left: 5px; } #logo span{ color:#999; text-shadow:1px 1px 0 #FDFDFD; } #user-box{ float:right; text-align:right; height:40px; line-height:40px; padding-right:10px; } /* New Navigation/Breadcrumbs */ #ncont { width: 944px; height: 68px; clear: both; margin: 0 0 4px -2px; } #ncont-l, #ncont-r { width: 11px; height: 68px; background: url("http://elementaryos.org/sites/all/themes/elementary/img/navbreadsprite.png"); float: left; } #ncont-r { background-position: 0 -68px; } #ncont-c { width: 922px; height: 68px; float: left; background: url("http://elementaryos.org/sites/all/themes/elementary/img/navbreadsprite.png") 0 -136px; } #nav-sect { height: 38px; overflow: hidden; } #bc-sect { height: 30px; } #nav-sect li{ float:left; line-height:42px; padding:0 10px; } #nav-sect li.first{ padding: 0 10px 0 0; } #nav-sect #nav-search{ padding: 2px 0 0 0; float:right; /*width: 190px; commented for granite docs*/ } #nav-sect a{ color:#5E5E5E; text-shadow:#F0F0F0 0 1px 0; } #nav-sect a:hover{ color:#333; } #nav-sect a.active, #nav-c .active-trail a{ color:#0088cc; } #bc-sect { height: 30px; } .breadcrumb li, .breadcrumb li a{ float:left; font-size:12px; line-height:23px; color: #5E5E5E; text-shadow: 0 1px #D2D2D2; } .breadcrumb li a img{ vertical-align:top; } .breadcrumb li{ padding:0 15px 0 5px; max-width: 250px; overflow: hidden; max-height: 24px; text-overflow: ellipsis; white-space: nowrap; background: url("http://elementaryos.org/sites/all/themes/elementary/img/navbarsep.png") right no-repeat; } .breadcrumb li.last{ background: none; } .breadcrumb li#breadcrumbs_home{ padding: 0 10px 0 0; } .breadcrumb li#breadcrumbs_home img{ padding:3px; } /* Search */ #nav-search .search-left{ float:left; height:26px; width:4px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/search/entry-left-right.png); margin-top:6px; } #nav-search .search-right{ float:right; height:26px; padding-right:4px; margin-top:6px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/search/entry-left-right.png) right no-repeat; } #nav-search #edit-search-theme-form-1-wrapper{ background:url(http://elementaryos.org/sites/all/themes/elementary/img//search/entry-center.png) 0 -1px; height:17px; padding:4px 0 5px; display:inline-block; margin-top:1px; float: left; } #nav-search #edit-search-theme-form-1-wrapper input[name="search_theme_form"]{ height:17px; width:160px; padding:0 0 0 22px; border:0; margin:0; background:none; display:block; background:url(http://elementaryos.org/sites/all/themes/elementary/img//search/icon-search.png) no-repeat scroll 4px 0 transparent; } #nav-search #edit-search-theme-form-1-wrapper input[name="search_theme_form"].default-search{ font-style:italic; color:#A1A1A1; } #nav-search{ line-height:1; } #nav-search label{ display: none; } /* Searchpage */ .page-search .content-wrap .search-form #edit-submit{ background: none; } .page-search .content-wrap .search-form #edit-submit input{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/support-page/submit-ask.png") 0 0; width: 105px; height: 26px; line-height: 26px; margin: 0; text-shadow: 0 -1px 0 #276B9E; } .page-search .content-wrap .search-form #edit-submit input:active{ background-position: 0 -26px; } .page-search .content-wrap .search-form #edit-submit .rightbutton{ display: none; } .page-search .content-wrap .search-form #edit-keys-wrapper input{ background: url(http://elementaryos.org/sites/all/themes/elementary/img/search/entry-center.png) repeat-x; height: 26px; float: left; line-height: 26px; display: inline-block; padding: 0; margin: 0; border: 0; font-style: italic; color: #A1A1A1; padding-left: 5px; width: 280px; } .page-search .content-wrap .search-form #edit-keys-wrapper { background: url(http://elementaryos.org/sites/all/themes/elementary/img/search/entry-left-right.png) no-repeat; height: 26px; display: inline-block; padding: 0 0 0 4px; margin: 0; border: 0; } .page-search .content-wrap .search-form .form-item { margin: 0; } .page-search .content-wrap .search-form .search-advanced .form-item { margin: 1em 0; } .page-search .content-wrap .search-form { float: right; } /* Sidebar */ .content-sidebar{ width:200px; float:left; position:relative; margin:-3px 7px 0 -3px; } .content-sidebar.s-right{ float:right; position:relative; margin:-3px -3px 0 7px; width:250px; clear: right; } .content-sidebar ul, .content-sidebar li{ padding:0; margin:0; list-style:none; } .content-sidebar ul.menu li{ margin-left:-4px; position:relative; z-index:2; } .content-sidebar ul ul li{ margin-left:0!important; padding-left:0!important; } .content-sidebar li a.active, .content-sidebar li a:hover, .content-sidebar li a.active:hover { color:#fff; text-shadow:#107088 1px 0 0; background:url(http://elementaryos.org/sites/all/themes/elementary/img/sidebar-selector.png) repeat-x;; } .content-sidebar.s-right li a { margin-left: -17px; position: relative; z-index: 4; padding: 0 4px 0 17px !important; } .content-sidebar.s-right li a:hover .blog-comment-count { color: #FFF; } .content-sidebar.s-right li a.active { color: #FFF; } .content-sidebar.s-right li { padding-left: 13px; } .content-sidebar li a { height: 21px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden } .content-sidebar a{ color:#fff; font-size:12px; font-weight:bold; line-height:21px; min-height:21px; display:inline-block; } .content-sidebar.s-right a{ font-weight: normal; } .content-sidebar ul a{ padding-left:13px; width:168px; } .content-sidebar ul ul a{ color:#fff; text-shadow:none; display:inline-block; padding-left:13px; } .content-sidebar ul ul ul a{ padding-left:26px; width:155px; font-weight:normal; } .content-sidebar ul ul ul ul a{ padding-left:39px; width:142px; } .content-sidebar ul ul ul ul ul a{ padding-left:52px; width:129px; } div.content-sidebar div.content-sidebar_center{ background:#303030; width:174px; margin:13px; } .content-sidebar.s-right div.content-sidebar_center{ width:224px; padding: 2px 0; } div.content-sidebar div.content-sidebar_top_end, div.content-sidebar div.content-sidebar_bottom_end, div.content-sidebar div.content-sidebar_bottom_start, div.content-sidebar div.content-sidebar_top_start { background-image:url(http://elementaryos.org/sites/all/themes/elementary/img/content-sidebar/corners.png); position:absolute; height:13px; width:13px; } div.content-sidebar div.content-sidebar_bottom_middle, div.content-sidebar div.content-sidebar_top_middle { background-image:url(http://elementaryos.org/sites/all/themes/elementary/img/content-sidebar/topbot.png); position:absolute; height:13px; } div.content-sidebar div.content-sidebar_right, div.content-sidebar div.content-sidebar_left { background-image:url(http://elementaryos.org/sites/all/themes/elementary/img/content-sidebar/leftright.png); position:absolute; width:13px; } div.content-sidebar div.content-sidebar_top_start{ top:0; left:0; } div.content-sidebar div.content-sidebar_top_middle{ top:0; left:13px; right:13px; } div.content-sidebar div.content-sidebar_top_end{ top:0; right:0; background-position:13px 0; } div.content-sidebar div.content-sidebar_left{ top:13px; bottom:13px; left:0; } div.content-sidebar div.content-sidebar_right{ top:13px; bottom:13px; right:0; z-index:1; background-position:13px 0; } div.content-sidebar div.content-sidebar_bottom_start{ bottom:0; left:0; background-position:0 13px; } div.content-sidebar div.content-sidebar_bottom_middle{ bottom:0; left:13px; right:13px; background-position:0 13px; } div.content-sidebar div.content-sidebar_bottom_end{ bottom:0; right:0; background-position:13px 13px; } #content_moderation .info{ background: none; color: #FFF; margin: 10px 5px; font-size: 10pt; padding: 0; } #content_moderation h4{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/sidebar-blog-heading.png"); height: 21px; line-height: 21px; color: white; text-shadow: #107088 1px 0 0; font-weight: bold; font-size: 12px; text-decoration: none; margin-left: -4px; padding-left: 13px; width: 168px; position: relative; z-index: 9; } #content_moderation .info .details { color: #FFF; font-size: .8em; line-height: .9em; margin: 0 0 0 3px; } #content_moderation .info a { color: #FFF; height: auto; min-height: 0 } .t_viewicon { background-image: url("http://elementaryos.org/sites/all/themes/elementary/img/rev-view.png"); } .t_changestateicon { background-image: url("http://elementaryos.org/sites/all/themes/elementary/img/rev-next.png"); } /* Content */ .content-wrap{ width:940px; position:relative; padding:5px 0; } .content-wrap.content-small{ width:733px; float:right; } .content-wrap.content-small-l{ width:683px; float:left; } .content-wrap p, .content-wrap li{ padding:5px 0; line-height:19px; font-size:13px; } .content-wrap li{ padding:2px 0; } .content-wrap.content-small .content_center{ width:633px; } .content-wrap.content-small-l .content_center{ width:583px; } .content_center{ width:840px; padding:40px; background:#fafafa; margin:0 10px; display:inline-block; font-size:13px; line-height:17px; } .content_center ul, .content_center ol { padding-left:30px; } .content_center ul li, .content_center ul{ list-style:disc; } .content_center ol li, .content_center oll{ list-style:decimal; } .content_center table li{ list-style-type:none; } div#content{ margin:10px 0; } div.content-wrap div.content_top_end, div.content-wrap div.content_bottom_end, div.content-wrap div.content_bottom_start, div.content-wrap div.content_top_start { background-image:url(http://elementaryos.org/sites/all/themes/elementary/img/content/corners.png); position:absolute; height:10px; width:10px; } div.content-wrap div.content_bottom_middle, div.content-wrap div.content_top_middle { background-image:url(http://elementaryos.org/sites/all/themes/elementary/img/content/topbot.png); position:absolute; height:10px; } div.content-wrap div.content_right, div.content-wrap div.content_left { background-image:url(http://elementaryos.org/sites/all/themes/elementary/img/content/leftright.png); position:absolute; width:10px; } div.content-wrap{ position:relative; margin-bottom:10px; } div.content-wrap div.content_top_start{ top:0; left:0; } div.content-wrap div.content_top_middle{ top:0; left:10px; right:10px; } div.content-wrap div.content_top_end{ top:0; right:0; background-position:10px 0; } div.content-wrap div.content_left{ top:10px; bottom:10px; left:0; } div.content-wrap div.content_center div.content_container{ margin:0; padding-top:40px; padding-bottom:40px; background-color:#fafafa; } div.content-wrap div.content_center div.content_container.app{ text-align: center; } #discover-content-start { text-align: left; } div.content-wrap div.content_right{ top:10px; bottom:10px; right:0; z-index:1; background-position:10px 0; } div.content-wrap div.content_bottom_start{ bottom:0; left:0; background-position:0 10px; } div.content-wrap div.content_bottom_middle{ bottom:0; left:10px; right:10px; background-position:0 10px; } div.content-wrap div.content_bottom_end{ bottom:0; right:0; background-position:10px 10px; } /* View Tables */ table.views-table{ width:100%; } /* Journal */ .node-type-journal #comments .box h2 { clear: both; display: none; } .view-blog p{ text-align:justify; } .content_center .view-blog .view-content .views-row{ margin-bottom:36px; } .view-blog h2{ font-size:20px; margin:.2em 0; display: inline-block; } .view-blog img{ max-width:583px; } .content-sidebar.s-right li a{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:210px; } .content-sidebar.s-right iframe{ background: #FAFAFA; } span.submitted { color: #999; display: inline-block; } span.submitted a{ color: #777; } span.submitted a:hover{ text-decoration: underline; } /* Reset each ul a from previous */ .content-sidebar.s-right .view-blog ul a, .content-sidebar.s-right .view-blog ul ul a, .content-sidebar.s-right .view-blog ul ul ul a{ padding:0; } .content-sidebar.s-right .content { margin-bottom:10px; } .content-sidebar.s-right .view-blog .views-field-comment-count{ float:none; margin-right:0; } .content-sidebar.s-right .view-blog li{ margin:0; list-style:none; } .content-sidebar.s-right h2{ font-size:13px; font-weight:bold; padding-left:13px; line-height:21px; /*width:218px; height:21px; background-image:url(../img/sidebar-blog-heading.png); text-shadow:#107088 1px 0 0; margin-left:-4px; position:relative; z-index:2; margin-left: -4px;*/ color:#FFF; margin:0; } .blog .view-blog .views-row{ margin-bottom: 30px; } .view-blog .item-list .views-row{ margin-bottom:0!important; padding-left:13px; } #block-views-blog-block_1 .view-blog .item-list .views-row{ padding-left:0; } .view-blog .views-field-comment-count{ float:left; margin-right:10px; font-style: italic; } .views-field-view-node{ float: right; } .blog-comment-count{ font-size:12px; color:#72ccff; font-weight:bold; display:block; float:left; width:20px; text-align:right; margin-right:6px; } body.node-type-journal.sidebar-right div.content img, body.node-type-book.sidebar-left div.content img, body.node-type-internal.sidebar-left div.content img{ max-width:575px; margin:2em auto; text-align:justify; display:block; } body.node-type-journal.sidebar-right pre, body.node-type-book.sidebar-left pre, body.node-type-internal.sidebar-left pre { overflow-x:auto; width:613px; } body.node-type-journal.sidebar-right div.content p img { border:4px solid #fff; box-shadow:0 0 8px rgba(0,0,0,.75); } body.node-type-journal.sidebar-right div.content p img.borderless, body.node-type-book.sidebar-left div.content img.borderless, body.node-type-internal.sidebar-left div.content img.borderless{ border:none; box-shadow:none; max-width:583px; } body.node-type-journal .terms a { background:#3298da; height:23px; display:block; color:#fff; font-weight:bold; width:auto; line-height:23px; opacity:0.75; -webkit-transition:opacity; -webkit-transition-timing-function:ease-out; -webkit-transition-duration:500ms; -moz-transition:opacity; -moz-transition-timing-function:ease-out; -moz-transition-duration:500ms; } body.node-type-journal .terms a:hover { opacity:1; } body.node-type-journal .terms a:before { background:url("http://elementaryos.org/sites/all/themes/elementary/img/tag.png"); width:13px; height:23px; left:-13px; position:relative; display:block; content:" "; float:left; } body.node-type-journal .terms a:after { background:url("http://elementaryos.org/sites/all/themes/elementary/img/tag.png") -13px 0; width:4px; height:23px; right:-4px; position:relative; display:block; content:" "; float:right; } body.node-type-journal .links .comment_add a{ display:block; margin-top:5px; background:#999; opacity:.75; color:#fff; height:23px; line-height:23px; border-radius:3px; -moz-border-radius:5px; padding:0 5px; -webkit-transition:opacity; -webkit-transition-timing-function:ease-out; -webkit-transition-duration:500ms; -moz-transition:opacity; -moz-transition-timing-function:ease-out; -moz-transition-duration:500ms; } body.node-type-journal .links .comment_add a:hover{ opacity: 1; } body.node-type-journal .terms li { float: left; margin: 5px 10px; } body.node-type-journal .content p { text-align:justify; } div#addthis_1{ float:left; } div#addthis_2{ padding-bottom: 10px; float:left; width:242px; margin:10px 0; } /* Footer */ #footer-message, #footer-message a{ text-align:center; color:#999; font-size:10px; height:10px; width:940px; line-height:10px; margin:0 auto 10px; clear:both; } #footer-message span{ display:inline-block; } /* System Tabs Overrides */ ul.tabs.primary li a{ background:none; font-size:7pt; border-left:solid 1px #DDD; color:#001D33; display:inline-block; margin:0; border:0; padding:9px 10px 7px; } ul.tabs.primary li{ display: inline; padding: 0; line-height: 1; } ul.tabs.primary { position:absolute; right:5px; top:4px; padding:0 10px; margin:0; background:#eee; background:-webkit-gradient( linear, left bottom, left top, color-stop(0, #DEDEDE), color-stop(1, #FEFEFE) ); background:-moz-linear-gradient( center bottom, #DEDEDE 0%, #FEFEFE 100% ); border-radius:0 3px; -moz-border-radius:0 3px; border-bottom:solid 1px #CCC; z-index:2; text-shadow:#fff 0 1px 0px; border-left:solid 1px #ccc; font-weight:bold; text-transform:uppercase; } ul.tabs.primary li a:hover{ color: #08C; } ul.tabs.primary li.active a:hover{ color: #666; } ul.primary li.active a{ background: none !important; border: 0; color: #666; } /* books (Overrides) */ .book-navigation .page-links{ border-top:solid 1px #d5d5d5; border-bottom:0!important; width:690px; margin-left:-28px; padding:15px 0 5px; margin-top:20px; } .book-navigation ul.menu{ display:none; } .book-navigation .page-links a{ font-size:12px; font-weight:bold; color:#999; } .book-navigation .page-links a:hover{ color:#555; } .node-type-internal ul.links.inline, .node-type-book ul.links.inline{ position:absolute; top:45px; right:40px; text-align:right; } .node-type-book h4, .node-type-internal h4 { padding-top: 10px; } .node-type-internal .content_center .clear-block, .node-type-book .content_center .clear-block { float: left; clear: both; } .clear-block::after { display: none; } .page-admin .clear-block::after { display: block; } .node-type-internal ul.links.inline .book_printer a, .node-type-book ul.links.inline .book_printer a{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/book-print.png) no-repeat; height:16px; width:0; overflow:hidden; padding-left:16px; display:inline-block; } .node-type-internal ul.links.inline li.book_add_child a, .node-type-book ul.links.inline li.book_add_child a{ color:#999; vertical-align:top; font-size:8pt; } .node-type-internal .content-wrap .content ul, .node-type-book .content-wrap .content ul, .node-type-internal .content-wrap .content ol, .node-type-book .content-wrap .content ol{ padding: 0 15px; } .node-type-internal .content-wrap .content ul li, .node-type-book .content-wrap .content ul li{ list-style: disc; } .node-type-internal .content-wrap .content ol li, .node-type-book .content-wrap .content ol li{ list-style: decimal; padding: 0 0 10px 0; } .node-type-internal .content_center, .node-type-book .content_center{ padding-bottom: 45px; } .node-type-book .content_center .page-links, .node-type-internal .content_center .page-links { position: absolute; bottom: 15px; } /* Add Table */ .node-type-list dt{ margin-top:10px; } .node-type-list dt a{ font-size:15px; } .node-type-list dd{ font-size:13px; padding:5px 0; } /* Answers & Think Tank */ .support-comment{ font-style:italic; float:left; height:26px; line-height:26px; color:#999; margin: 10px 0 0; width:200px; } body .action-button.saindq{ margin: 5px 0 0 0; } .support-answer .support-answer-mid .support-answer-mid-arrow{ width:24px; height:24px; float:left; margin:1px 3px 1px 0; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/arrow.png); } .block-width-half{ float:left; width:573px; height:auto; display:none; } .view-id-Questions .views-row{ display:inline-block; margin-bottom:10px; margin-left:0; } .node-type-journal .view-id-Questions .views-row, .journal .view-id-Questions .views-row{ margin:0; } .support-vote{ float:left; width:60px; height:80px; } .support-q-info{ float:left; width: 493px; margin-left:20px; position:relative; } .node-type-question #comment-form-content{ display: none; } .support-q-info ul.links.inline { position: absolute; bottom: 0; right: 0; } #comments .support-q-info{ clear: both; margin: 5px 0 5px 94px; } #comments .support-q-info .vud-widget-elementupdown{ position: relative; left: -94px; margin-right: -73px; } .support-q-info h2{ font-size:16px; } .support-corners{ position:absolute; height:9px; width:9px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/question-corners.png); } .support-topbot{ position:absolute; height:9px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/question-topbot.png); left:9px; right:9px; } .support-leftright{ position:absolute; width:9px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/question-leftright.png); top:9px; bottom:9px; } .support-top-left{ top:0; left:0; } .support-top-right{ top:0; right:0; background-position:9px 0; } .support-bot-left{ bottom:0; left:0; background-position:0 9px; } .support-bot-right{ bottom:0; right:0; background-position:9px 9px; } .support-center{ margin:9px; background:#F8F8F8; padding:0 5px; display:inline-block; width: 465px; overflow: hidden; } .support-top{ top:0; } .support-left{ right:0; background-position:9px 0; } .support-bot{ bottom:0; background-position:0 9px; } .support-right{ left:0; } .s-button-container{ width:298px; height:26px; margin:0 auto 15px; padding:0 271px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/divider.png) repeat-x 0 12px; margin-top:20px; } .think-tank .s-button-container{ width: 396px; padding: 0 222px; } .s-button{ width:100px; height:26px; float:left; text-align:center; cursor:pointer; color:#333; text-shadow:0 1px 0 #fff; } .s-negmargin{ margin:0 -1px; } .s-question-block{ position:absolute; right:50px; top:47px; } .s-center, .s-straight-left, .s-straight-right, .s-curved-left, .s-curved-right{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/s-button-sprite.png); } .s-center{ background-position:0 52px; width:92px; height:26px; line-height:26px; float:left; } .pressed .s-center,.s-button:active .s-center{ background-position:0 26px; } .s-straight-left{ background-position:12px 0; width:4px; height:26px; float:left; } .pressed .s-straight-left,.s-button:active .s-straight-left{ background-position:12px 78px; } .s-straight-right{ background-position:8px 0; width:4px; height:26px; float:left; } .pressed .s-straight-right,.s-button:active .s-straight-right{ background-position:8px 78px; } .s-curved-left{ width:4px; height:26px; float:left; } .pressed .s-curved-left,.s-button:active .s-curved-left{ background-position:0 78px; } .s-curved-right{ background-position:4px 0; width:4px; height:26px; float:left; } .pressed .s-curved-right,.s-button:active .s-curved-right{ background-position:4px 78px; } .support-date{ position:absolute; top:7px; right:15px; color:#319ED5; font-size:10px; } .support-date em{ font-style:normal; } .s-question-block form{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/search/entry-left-right.png) no-repeat; height:26px; display:inline-block; padding:0 0 0 4px; margin:0; border:0; clear: both; float: right; } .s-question-block input[type=text]{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/search/entry-center.png) repeat-x; height:26px; float:left; line-height:26px; display:inline-block; padding:0; margin:0; border:0; font-style:italic; color:#A1A1A1; padding-left:5px; width:280px; } .s-question-block input[type=submit]{ height:26px; line-height:26px; display:inline-block; padding:0; margin:0; border:0; color:#fff; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/submit-ask.png) no-repeat; width:105px; cursor:pointer; text-shadow:0 -1px 0 #276B9E; } .s-question-block input[type=submit]:active{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/submit-ask.png) 0 -26px no-repeat; } .support-body, .support-body p{ display:inline-block; width:465px!important; } .support-body img{ max-width:362px; } .unitalic{ font-style:normal!important; color:#666!important; } .question hr { margin: 10px 0; clear: both; } .question .support-date{ float: right; color:#319ED5; font-size:10px; right: 50px; top: 150px; } .question .support-asked-by{ font-style:italic; font-size:12px; color:#808080; clear:both; float:left; margin-top: 10px; } .question .support-asked-by a{ color:#808080; } .question h4{ width: 89%; } .support-q-info h4, .support-q-info h4 a { width: 370px; margin-bottom: 0; } .question .vud-widget-elementupdown{ float:left; margin-bottom:10px; } .question .non-vote-cont { float:left; margin-left:20px; width:756px; } .question .field-field-status{ float:right; border:solid 1px #ccc; border-radius:3px; padding:5px; } .s-question-block .stat-box { font-size: 16px; float: right; clear: both; padding: 0 0 10px; color: #999; } .node-type-question #comments .box h2, .node-type-question #comments .box h2 a { /*font-weight: normal; font-size: 10pt; color: #666; margin-top: 10px;*/ display: none; } .comment-info { margin-top: 10px; font-style: italic; clear: both; } .answer-empty { margin-bottom: 10px; } .question-title-block hr{ margin: 20px 0; } .answer-ad { margin: 0 auto; text-align: center; width: 728px; height: 90px; } /* Misc */ .bltabs ul.tabs.primary { position: fixed; bottom: 0; right: 10px; top: auto; border-radius: 5px 5px 0 0; background: rgba(0, 0, 0, 0.8); border: solid 1px #FFF; border-bottom: 0; } .bltabs ul.tabs.primary li a { color: white; text-shadow: none; } .item-list ul { padding:0; } /* .clear-block ul{ padding:0; } .clear-block ul, .clear-block li{ list-style:none; }*/ .clear-block .meta{ width:341px; float:left; padding-bottom:10px; } .node-type-journal .clear-block .meta{ margin:10px 0; } .clear-block .links{ float:right; } .clear-block ul.links, .clear-block .meta .meta{ float:left; } .clear-block ul li.comment_add{ float:right; } span.down-arrow{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/down-arrow.png) right no-repeat; padding-right:10px; cursor:pointer; display:inline-block; float:left; } ul.down-arrow{ position:absolute; z-index:999; background:url(http://elementaryos.org/sites/all/themes/elementary/img/usermenu-topbot.png) no-repeat 0 -15px; width:122px; display:none; color:#fff; border-radius:5px; -moz-border-radius:5px; font-size:12px; font-weight:bold; text-align:left; padding-top:22px; right:0; top:60px; float:right; } ul.down-arrow.dalogin{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/loginmenu-topbot.png) no-repeat 0 -15px; width:142px; } ul.down-arrow .form-item label{ padding: 0; } ul.down-arrow li{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/usermenu.png) repeat-y; padding:0 8px; width:116px; height:21px; line-height:1; } ul.down-arrow.dalogin li{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/loginmenu.png) repeat-y; padding:0 20px; height:auto; line-height:200%; width: 156px; overflow: hidden; } ul.down-arrow.dalogin li .form-item{ margin: 0 0 10px 0; width: 102px; text-align: center; } ul.down-arrow.dalogin li .form-item .description{ display:none; } ul.down-arrow .down-arrow-bottom{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/usermenu-topbot.png); width:122px; height:13px; } ul.down-arrow.dalogin .down-arrow-bottom{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/loginmenu-topbot.png); width:102px; height:13px; } ul.down-arrow.dalogin input{ width:94px; border:0; margin: 0 auto; } ul.down-arrow a{ color:#fff; display:inline-block; height:21px; width:94px; padding-left:12px; line-height:21px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } ul.down-arrow a:hover{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/sidebar-selector.png) repeat-x; text-shadow:#107088 1px 0 0; } .stretch-down{ float:left; } html.js fieldset.collapsible{ margin:10px 0; } /* Tables */ tr.even, tr.odd{ border-bottom:1px solid #E4E4E4; color:#888; } tr.even.selected td, tr.odd.selected td{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/table-select-grad.png) repeat-x #D3D3D3; text-shadow:0 1px 0 #fff; border-bottom: #CCC solid 1px; } tr.odd{ background:#FAFAFA; } tr.even{ background:#F0F0F0; } tr.even td, tr.odd td{ padding: 20px 10px; } .page-admin tr.even td, .page-admin tr.odd td{ padding:20px; } .page-admin td.description { max-width: 300px; } tr.even a, tr.odd a{ color:#585858; } tr.even a, tr.odd .privatemsg-list-subject a{ } td.active{ background:none; } /* Webdev */ .webdev{ width:100%; position:fixed; background:#000; opacity:0.9; color:#fff; right:0; left:0; bottom:0; text-align:center; padding:5px 0; font-size:16px; z-index:99; } .webdev a.close{ position:absolute; left:6px; font-weight:bold; } /* Advert Test */ .supportadvert{ float:right; clear: none; } /* Private Messaging */ .pmsg .pmsg-q-info{ float:left; width:390px; margin:0 10px 10px; position:relative; } .pmsg .pmsg-corners{ position:absolute; height:9px; width:9px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/question-corners.png); } .pmsg .pmsg-topbot{ position:absolute; height:9px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/question-topbot.png); left:9px; right:9px; } .pmsg .pmsg-leftright{ position:absolute; width:9px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/support-page/question-leftright.png); top:9px; bottom:9px; } .pmsg .pmsg-top-left{ top:0; left:0; } .pmsg .pmsg-top-right{ top:0; right:0; background-position:9px 0; } .pmsg .pmsg-bot-left{ bottom:0; left:0; background-position:0 9px; } .pmsg .pmsg-bot-right{ bottom:0; right:0; background-position:9px 9px; } .pmsg .pmsg-center{ margin:9px; background:#F8F8F8; padding:0 5px; display:inline-block; } .pmsg .pmsg-top{ top:0; } .pmsg .pmsg-left{ right:0; background-position:9px 0; } .pmsg .pmsg-bot{ bottom:0; background-position:0 9px; } .pmsg .pmsg-right{ left:0; } .pmsg .pmsg-date{ position:absolute; top:7px; right:15px; color:#319ED5; font-size:10px; } .pmsg .pmsg-date em{ font-style:normal; } .pmsg-body, .pmsg-body p{ display:inline-block; width:362px!important; } .privatemsg-box-fb .avatar-fb{ float:left; } .privatemsg-box-fb{ margin: 0 auto; width: /*566px*/ 600px; } .privatemsg-box-fb.pmsg-self .avatar-fb, .privatemsg-box-fb.pmsg-self .pmsg-q-info{ float:right; } .message-participants{ border-bottom:0!important; margin:0 0 10px!important; } .privatemsg-view-pager{ margin:20px 0; padding-left:0; width:300px; } /* table.privatemsg-list { width: 325px; } */ .avatar-fb{ width:68px; float:left; text-align:right; } .privatemsg-box-fb .picture{ float:right; padding:0 0 0 0; clear:both; } .privatemsg-box-fb.pmsg-self .picture{ float:left; } .pmsg ul.message-actions, .pmsg ul.message-actions li{ list-style-type:none; padding:0; margin:0; } .pmsg .pmsg-name a, .support-name a{ color:#999; font-size:14px; font-weight:bold; } .pmsg ul.message-actions{ position:absolute; bottom:8px; right:7px; } .pmsg ul.message-actions a, .action-button { color: #4D4D4D; font-size: 12px; display: inline-block; height: 26px; width: 80px; background: url(http://elementaryos.org/sites/all/themes/elementary/img//buttons-flat.png) no-repeat; line-height: 26px; text-align: center; } .action-button img { float: left; position: relative; left: 5px; } .pmsg ul.message-actions a:active, a.action-button:active { background-position: 0 -26px; } .action-button{ float: right; position: relative; right: -5px; margin: 10px 0 0 3px; } .message-body{ width:360px; padding-bottom:20px; } .message-indicator{ width:24px; height:23px; background:url(http://elementaryos.org/sites/all/themes/elementary/img/messages.png); float:left; margin-top:9px; margin-right:3px; padding-top:1px; /* line height fix */ } .message-indicator.message-new{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/messages-new.png); color:#fff; font-size:8pt; line-height:21px; text-align:center; font-weight:bold; } .message-padding-expand{ width:1px; height:20px; clear:both; } .pmsg-newnew, .s-newnew{ background:url(http://elementaryos.org/sites/all/themes/elementary/img/new.png); width:40px; height:40px; z-index:9; bottom:5px; left:4px; position:absolute; } .page-messages form .leftbutton { float:right; } /* Text Area / Form */ .resizable-textarea{ width:100%; } .resizable-textarea span#cke_edit-body{ width:auto!important; } .form-item label{ padding-bottom:10px; font-weight: normal; } /* Forms */ .button.leftbutton:active { background-position: 0 -26px; } .button:active .rightbutton { background-position: -196px -26px; } #edit-submit.leftbutton:active { background-position: 0 -78px; } #edit-submit:active .rightbutton { background-position: -196px -78px; } .button input.form-submit{ height: 26px; line-height: 26px; font-size: 12px; text-shadow: 0px 1px 0px #FFF; min-width: 80px; cursor: pointer; border: 0; padding: 0 10px 4px; background: none; float: left; margin: 0 -4px 0 0 !important; } .button.leftbutton { background: url(http://elementaryos.org/sites/all/themes/elementary/img/basic-sprite-button.png); display: inline-block; } .button div.rightbutton { background: #FAFAFA url(http://elementaryos.org/sites/all/themes/elementary/img/basic-sprite-button.png) -196px 0; display: inline-block; float: right; width: 4px; height: 26px; cursor: pointer; } /**/ #nav-search .leftbutton { display: none; } /**/ #edit-submit.leftbutton { background-position: 0 -52px; } #edit-submit .rightbutton { background-position: -196px -52px; } .form-submit#edit-submit{ color: #FFF; text-shadow: 0 -1px 0 #276B9E; } .form-submit:active{ background-position: 0 -26px; } .form-submit#edit-submit:active{ background-position: -100px -26px; } input[type="text"], input[type="password"], select{ height: 26px; border: 1px #CCC solid; background: #FFF; border-radius: 3px; -moz-border-radius: 3px; } input[type="text"], input[type="password"] { padding: 0 0 0 10px; } html.js fieldset.collapsible legend a{ color: #999; font-style: italic; } .marker, .form-required{ color: #08C; } dl.multiselect .form-item{ height: 26px; } #user-admin-buttons{ clear: both; } .container-inline{ margin: 5px 0; } .search-right .container-inline{ margin: 0; } html.js input.form-autocomplete{ background-position: 100% 6px; } /* Title */ .title-icon-block{ padding-left:75px; height:64px; background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/help-info.png") no-repeat 0 -5px; } .answers .title-icon-block{ background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/help-contents.png") no-repeat 0 -5px; } .developers .title-icon-block{ background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/applications-development.png") no-repeat; } .support .title-icon-block{ background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/application-community.png") no-repeat; } .get-involved .title-icon-block{ background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/applications-other.png") no-repeat; } .live-support .title-icon-block{ background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/applications-internet.png") no-repeat; } .journal .title-icon-block{ padding-bottom:20px; background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/text.png") no-repeat; } .the-team .title-icon-block{ background:url("http://elementaryos.org/sites/all/themes/elementary/img/e-icon/user-info.png") no-repeat; } /* Content */ .content h2{ margin-top:30px; } .content ol{ padding:0 15px; } .content ol li{ list-style:decimal; } /* Indent Tricks */ .margin10 { margin-bottom:10px; display:inline-block; } /* The Team */ ul.teamlist h2 span.role { font-size:12pt; padding:0 5px; color:#aaa; font-weight: normal; } ul.teamlist li, ul.teamlist { padding:0; list-style: none; } ul.teamlist h2 a { color:#666; } /* Searchpage */ body.search .form-item#edit-keys-wrapper{ float:left; display:block; margin:0; } /* Secondary Rules */ ul.secondary a.active { border:0; color:#333; } ul.secondary a { color:#999; } ul.secondary li { border:0; padding:0 1em 0 0; } ul.secondary { border:0; margin:0 0 20px; padding:0; } /* Profile */ .profile { margin:0; } .profile h2 { padding-top:5px; margin:0 0 5px 0; } .profile .picture { float:left; } .profile ul.profile-roles li{ list-style:none; font-style:italic; padding: 0; } .profile dl { margin:0; clear:both; } .avatar-picture { width:60px; height:60px; padding:4px; background:#fafafa url("http://elementaryos.org/sites/all/themes/elementary/img/avatar.png"); } .profile .avatar-picture { float:left; margin:0px 10px 5px 0; } .page-user .user-titles { float: left; padding: 5px 0 5px 10px; } .page-user .user-badges-col { float: left; width: 68px; text-align: center; } .page-user .user-badges-col .user_badges { margin: 0 auto; clear: both; } .page-user .user-right-menu { float: right; text-align: right; color: #000; } .page-user .user-right-menu a{ color: #000; } .page-user .user-right-menu ul li{ padding: 0 0 0 38px; margin: 7px 0; width: 60px; text-align: left; list-style: none; height: 24px; line-height: 25px; overflow: hidden; font-size: 12px; } .page-user .user-right-menu ul li#votinglist{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/profile/vote-profile-24.png") no-repeat; } .page-user .user-right-menu ul li#answerlist{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/profile/answer-profile-24.png") no-repeat; } .page-user .user-right-menu ul li#pointlist{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/profile/star-profile-24.png") no-repeat; } .page-user .user-right-menu ul li#editlist{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/profile/edit-profile-24.png") no-repeat; } .page-user .user-right-menu ul li#filelist{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/profile/file-profile-24.png") no-repeat; } .page-user .user-right-menu ul li#advancedlist{ background: url("http://elementaryos.org/sites/all/themes/elementary/img/profile/advanced-profile-24.png") no-repeat; } .page-user .user-right-menu .user-button-a-child a{ display: block; width: 100px; height: 26px; line-height: 26px; text-align: center; background: url("http://elementaryos.org/sites/all/themes/elementary/img/fixed-width-sprite.png"); text-shadow: 0px 1px 0px white; cursor: pointer; } .page-user .user-right-menu .user-button-a-child a:active{ background-position: 0 -26px; } .page-user .user-content-info { text-align: center; margin: 0 auto; } /* Adverts */ .ad-468x60 { width:468px; height:60px; margin:10px auto; display:block; color:#fff; clear:both; background:#EEE; line-height:60px; text-align:center; font-size:16px; } .ad-160x600 { width:160px; height:600px; line-height:250px; text-align:center; font-size:16px; background:#eee; } .ad-200x200 { width:200px; height:200px; line-height:200px; text-align:center; font-size:16px; background:#eee; color:#fff; margin:5px auto; } /* Post-launch fixes by cassidyjames */ div.messages{ display:block; padding:8px; background-color:rgba(0, 0, 0, .75); color:#fff; text-align:center; position:fixed; width:100%; z-index:888; opacity:1; /*-webkit-transition:all; -webkit-transition-timing-function:ease-out; -webkit-transition-duration:500ms; -moz-transition:all; -moz-transition-timing-function:ease-out; -moz-transition-duration:500ms; -webkit-animation-name:Notify-OSD; -webkit-animation-duration:1s; -webkit-animation-iteration-count:1; -webkit-animation-timing-function:ease-in-out; -webkit-animation-fill-mode:forwards; -webkit-animation-delay:4s;*/ } .view-question-answers{ float:left; } .node-type-journal #container div div div.node div.content ul{ padding:5px 0; } .node-type-journal #container div div div.node div.content ul li{ list-style-type:disc; padding:0; margin-left:2em; } /* Post-launch fixes by khampal */ .node-type-question .views-row{ clear:both; } div.messages.error{ background: #F5A3A3; } /* Form Specific */ .form-item#edit-field-notify-p-value-wrapper label, .form-item#edit-field-resolved-question-value-wrapper label{ padding: 5px 10px 5px 5px; background: #EEE -webkit-gradient( linear,left bottom,left top,color-stop(0,#DEDEDE),color-stop(1,#FEFEFE) ); background: #EEE -moz-linear-gradient( center bottom,#DEDEDE 0%,#FEFEFE 100% ); border-radius: 3px; -moz-border-radius: 3px; border: solid 1px #CCC; cursor: pointer; margin: 5px 0; display: inline-block; text-shadow: 0 1px 0 #FFF; height: 21px; line-height: 21px; } .form-item#edit-field-notify-p-value-wrapper label input[type=checkbox], .form-item#edit-field-resolved-question-value-wrapper label input[type=checkbox] { float: left; margin: 4px 10px 0 3px; } /* Report */ .node-type-report .field, .node-type-report .content_center p { padding: 10px; background: #EFEFEF; margin: 5px 0; } .node-type-report .content_center p { background: #CEF; } /* New Login Box */ .content-wrap .login-box { width: 408px; margin: 0 auto; } .content-wrap .login-header { width: 408px; height: 88px; background: url("http://elementaryos.org/sites/all/themes/elementary/img/login/login-header-main.png") no-repeat; } .content-wrap .login-body { width: 408px; background: url("http://elementaryos.org/sites/all/themes/elementary/img/login/login-body.png") repeat-y; padding: 20px 0 10px; } .content-wrap .login-warning { width: 61px; height: 59px; float: left; background: url("http://elementaryos.org/sites/all/themes/elementary/img/login/login-warning.png") no-repeat; margin: 26px 0 0 26px; } .content-wrap .login-body input[type=text],.content-wrap .login-body input[type=password]{ margin: 0 10px; padding: 0; width: 325px; border: 0; background: none !important; font-style: italic; color: #A1A1A1; } .content-wrap .login-body input[type=text].edit-name,.content-wrap .login-body input[type=password].edit-pass{ font-style: normal; color: #000; } .content-wrap .login-messages { width: 300px; float: right; } .content-wrap .login-header h1 { font-size: 16px; color: #666; font-weight: bold; padding: 24px 0 0 0; margin: 0; text-shadow: 0 1px 0 #FFF; } .content-wrap .login-header h2 { font-size: 12px; color: #666; font-weight: normal; text-shadow: 0 1px 0 #FFF; padding: 0; margin: 0; } .content-wrap .login-box .form-item, .content-wrap .login-footer .form-item { margin: 0; } .content-wrap .login-footer { width: 690px; margin: 0 auto; min-height: 87px; background: url("http://elementaryos.org/sites/all/themes/elementary/img/login/horizon.png") no-repeat; } .content-wrap .login-footer .login-foot-cont { width: 408px; margin: 0 auto; background: url("http://elementaryos.org/sites/all/themes/elementary/img/login/login-footer.png") no-repeat; height: 55px; } .content-wrap .login-footer .login-foot-cont #edit-remember-me-wrapper{ float: left; padding: 13px 0 0 0; margin: 0 0 0 25px; } .content-wrap .login-footer .login-foot-cont .leftbutton{ float: right; margin: 13px 29px 0 0; } .content-wrap .login-footer .login-foot-cont .rightbutton{ background-color: #CCC; } .content-wrap .login-footer .login-foot-register{ clear: both; padding: 10px 0 0 0; text-align: center; color: #999; } .nofloat { float: none !important; } .login-input-left{ margin: 0 auto 10px auto; height: 26px; width: 347px; padding-left: 4px; background: url("http://elementaryos.org/sites/all/themes/elementary/img/search/entry-left-right.png") no-repeat; } .login-input-center{ margin: 0; height: 26px; width: 343px; background: url("http://elementaryos.org/sites/all/themes/elementary/img/search/entry-center.png") repeat-x; float: left; } input[type=text].edit-name, input[type=password].edit-pass{ font-style: normal; color: #000; } .login-input-right{ margin:0; height:26px; width:4px; float:right; background:url("http://elementaryos.org/sites/all/themes/elementary/img/search/entry-left-right.png") -4px 0; } .user-account ul.tabs.primary { display: none; } a.forgot-password-text { color: #BBB; font-size: 9pt; position: absolute; top: 15px; right: 20px; } a.forgot-password-text:hover { color: #666; } /* Grid & Special Pages */ body .small-box { float: left; width: 235px; margin-bottom: 10px; } body .small-box.smallermargin, body .content-wrap.smallermargin { margin-bottom: 5px; } body .small-box img { float: left; } body .small-box span { display: block; clear:both; padding: 5px 0 0 0; } body .small-box h1 { font-size: 21px; font-weight: bold; display: inline-block; padding: 10px 0 0 5px; } body .small-box .content_center { width: 195px; padding: 10px; height: 155px; } h1.gothic { text-shadow: 0 0 1px #FAFAFA; font-weight: normal; font-size: 44px; width: 840px; margin: -20px 0 10px 0; height: 50px; line-height: 50px; overflow: hidden; } h1.gothic span.bold { font-weight: 900; } .content_center.medtext { font-size: 14px; } .site_footer { clear:both; text-align:center; } hr.navi_hr { border-color:#444; } li.package_index, li.package { display:none; } .main_keyword { color:#a00; font-weight:bold; } .main_basic_type { color:#080; } .leaf_code_definition { font-weight:bold; } .content-sidebar span.abstract_class, .content-sidebar span.class, .content-sidebar span.struct, .content-sidebar span.enum, .content-sidebar span.namespace, .content-sidebar span.delegate, .content-sidebar span.property, .content-sidebar span.virtual_method, .content-sidebar span.creation_method, .content-sidebar span.static_method, .content-sidebar span.signal, .content-sidebar span.field, .content-sidebar span.method, .content-sidebar span.constant { margin-left: -10px; padding-left:20px; min-height:16px; display:block; } .content-sidebar span.abstract_class { background:url(../img/abstractclass.png) center left no-repeat; } .content-sidebar span.class { background:url(../img/class.png) center left no-repeat; } .content-sidebar span.enum { background:url(../img/enum.png) center left no-repeat; } .content-sidebar span.struct { background:url(../img/struct.png) center left no-repeat; } .content-sidebar span.delegate { background:url(../img/delegate.png) center left no-repeat; } .content-sidebar span.namespace { background:url(../img/namespace.png) center left no-repeat; } .content-sidebar span.property { background:url(../img/property.png) center left no-repeat; } .content-sidebar span.virtual_method { background:url(../img/virtualmethod.png) center left no-repeat; } .content-sidebar span.creation_method { background:url(../img/constructor.png) center left no-repeat; } .content-sidebar span.static_method { background:url(../img/staticmethod.png) center left no-repeat; } .content-sidebar span.signal { background:url(../img/signal.png) center left no-repeat; } .content-sidebar span.field { background:url(../img/field.png) center left no-repeat; } .content-sidebar span.method { background:url(../img/method.png) center left no-repeat; } .content-sidebar span.constant { background:url(../img/constant.png) center left no-repeat; } granite-0.1.0/INSTALL000664 001751 001751 00000000705 11715546243 015412 0ustar00xapantuxapantu000000 000000 Install -------------------------------------------------------------------------------- • Build Granite bzr branch lp:granite cd granite mkdir build; cd build cmake .. -DCMAKE_INSTALL_PREFIX=/usr make sudo make install • Bugs If you find bugs in this installation guide or in Granite itself, please report them at https://launchpad.net/granite/+filebug granite-0.1.0/NEWS000664 001751 001751 00000000000 11715546243 015044 0ustar00xapantuxapantu000000 000000 granite-0.1.0/AUTHORS000664 001751 001751 00000000451 11715546243 015427 0ustar00xapantuxapantu000000 000000 Granite. For a complete list of all contributors, see the COPYRIGHT file. Primary Contact: ---------------- Maxwell Barvian Current Developers: ------------------- Maxwell Barvian Daniel Foré Avi Romanoff granite-0.1.0/README000664 001751 001751 00000000000 11715546243 015225 0ustar00xapantuxapantu000000 000000