diff --git a/data/assets.gresource.xml b/data/assets.gresource.xml
index ddba008d8..458965c26 100644
--- a/data/assets.gresource.xml
+++ b/data/assets.gresource.xml
@@ -5,6 +5,7 @@
css/layout.css
css/artboard.css
css/layer.css
+ css/headerbar.css
stylesheet.css
diff --git a/data/css/headerbar.css b/data/css/headerbar.css
new file mode 100644
index 000000000..024bbe87f
--- /dev/null
+++ b/data/css/headerbar.css
@@ -0,0 +1,15 @@
+.headerbar-label {
+ font-size: 8pt;
+}
+
+/* headerbar separator {
+ margin-left: 0px;
+} */
+
+.button-zoom {
+ padding: 0 6px;
+}
+
+.linked-flat button {
+ background-color: shade (@bg_color, 1);
+}
\ No newline at end of file
diff --git a/data/css/layout.css b/data/css/layout.css
index d0b24aaaa..202d62a15 100644
--- a/data/css/layout.css
+++ b/data/css/layout.css
@@ -14,16 +14,6 @@
border-left: 1px solid shade (@bg_color, 0.9);
}
-/* .headerbar-button {
- padding-left: 12px;
- padding-right: 12px;
- background-image: linear-gradient(to top, alpha (@bg_color, 0.3), alpha (@bg_color, 0.9));
-} */
-
-.headerbar-label {
- font-size: 8pt;
-}
-
.border-bottom {
border-bottom: 1px solid shade (@bg_color, 0.8);
}
\ No newline at end of file
diff --git a/data/schemas/com.github.akiraux.akira.gschema.xml b/data/schemas/com.github.akiraux.akira.gschema.xml
index 706155968..0df807cb1 100644
--- a/data/schemas/com.github.akiraux.akira.gschema.xml
+++ b/data/schemas/com.github.akiraux.akira.gschema.xml
@@ -49,17 +49,11 @@
- true
+ false
Use Symbolic Icons
Allow user to choose between normal and symbolic icons in HeaderBar.
-
- "filled"
- HeaderBar Icon Style
- Allow user to change the style/theme of icons in HeaderBar.
-
-
false
Auto Reopen latest file
diff --git a/data/stylesheet.css b/data/stylesheet.css
index 8a44ccbd8..1e1171cbd 100644
--- a/data/stylesheet.css
+++ b/data/stylesheet.css
@@ -2,4 +2,5 @@
@import url("css/variables.css");
@import url("css/layout.css");
@import url("css/artboard.css");
+@import url("css/headerbar.css");
@import url("css/layer.css");
\ No newline at end of file
diff --git a/meson.build b/meson.build
index f6369b222..16edc7edc 100644
--- a/meson.build
+++ b/meson.build
@@ -25,6 +25,9 @@ asresources = gnome.compile_resources(
c_name: 'as'
)
+cc = meson.get_compiler('c')
+m_dep = cc.find_library('m', required: true)
+
# Set our translation domain
add_global_arguments('-DGETTEXT_PACKAGE="@0@"'.format (meson.project_name()), language:'c')
diff --git a/src/Application.vala b/src/Application.vala
index 64f023822..08bd28fe4 100644
--- a/src/Application.vala
+++ b/src/Application.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
diff --git a/src/Layouts/HeaderBar.vala b/src/Layouts/HeaderBar.vala
index d9aba8e4c..05e4710b9 100644
--- a/src/Layouts/HeaderBar.vala
+++ b/src/Layouts/HeaderBar.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
@@ -28,10 +28,20 @@ public class Akira.Layouts.HeaderBar : Gtk.HeaderBar {
public Akira.Partials.MenuButton menu;
public Akira.Partials.MenuButton toolset;
+ public Akira.Partials.ZoomButton zoom;
+ public Akira.Partials.HeaderBarButton group;
+ public Akira.Partials.HeaderBarButton ungroup;
+ public Akira.Partials.HeaderBarButton move_up;
+ public Akira.Partials.HeaderBarButton move_down;
+ public Akira.Partials.HeaderBarButton move_top;
+ public Akira.Partials.HeaderBarButton move_bottom;
public Akira.Partials.HeaderBarButton preferences;
+ public Akira.Partials.HeaderBarButton export;
public Akira.Partials.HeaderBarButton layout;
- public Akira.Partials.HeaderBarButton grid;
- public Akira.Partials.HeaderBarButton pixel_grid;
+ public Akira.Partials.HeaderBarButton path_difference;
+ public Akira.Partials.HeaderBarButton path_exclusion;
+ public Akira.Partials.HeaderBarButton path_intersect;
+ public Akira.Partials.HeaderBarButton path_union;
public bool toggled {
get {
@@ -50,9 +60,8 @@ public class Akira.Layouts.HeaderBar : Gtk.HeaderBar {
}
construct {
- set_title (APP_NAME);
+ // set_title (APP_NAME);
set_show_close_button (true);
- get_style_context ().add_class ("default-decoration");
var menu_items = new Gtk.Menu ();
@@ -81,8 +90,8 @@ public class Akira.Layouts.HeaderBar : Gtk.HeaderBar {
menu_items.show_all ();
- menu = new Akira.Partials.MenuButton ("document-open", _("Menu"), _("Open Menu"));
- menu.popup = menu_items;
+ menu = new Akira.Partials.MenuButton ("document-open", _("Menu"), null);
+ menu.button.popup = menu_items;
var tools = new Gtk.Menu ();
tools.add (new Gtk.MenuItem.with_label(_("Artboard")));
@@ -95,48 +104,52 @@ public class Akira.Layouts.HeaderBar : Gtk.HeaderBar {
tools.add (new Gtk.MenuItem.with_label(_("Image")));
tools.show_all ();
- toolset = new Akira.Partials.MenuButton ("insert-object", _("Insert"), _("Insert a New Object"));
- toolset.popup = tools;
+ toolset = new Akira.Partials.MenuButton ("insert-object", _("Insert"), null);
+ toolset.button.popup = tools;
- var application_instance = (Gtk.Application) GLib.Application.get_default ();
+ zoom = new Akira.Partials.ZoomButton (window);
- preferences = new Akira.Partials.HeaderBarButton ("system-settings-%s".printf (settings.icon_style), _("Settings"));
- preferences.button.action_name = Akira.Services.ActionManager.ACTION_PREFIX + Akira.Services.ActionManager.ACTION_PREFERENCES;
- preferences.tooltip_markup = Granite.markup_accel_tooltip (
- application_instance.get_accels_for_action (preferences.button.action_name),
- _("Open Settings")
- );
+ group = new Akira.Partials.HeaderBarButton ("object-group", _("Group"), {"g"});
+ ungroup = new Akira.Partials.HeaderBarButton ("object-ungroup", _("Ungroup"), {"g"});
- layout = new Akira.Partials.HeaderBarButton ("layout-panels-%s".printf (settings.icon_style), _("Layout"));
- layout.button.action_name = Akira.Services.ActionManager.ACTION_PREFIX + Akira.Services.ActionManager.ACTION_PRESENTATION;
- layout.tooltip_markup = Granite.markup_accel_tooltip (
- application_instance.get_accels_for_action (layout.button.action_name),
- _("Toggle Layout")
- );
+ move_up = new Akira.Partials.HeaderBarButton ("selection-raise", _("Up"), {"Up"});
+ move_down = new Akira.Partials.HeaderBarButton ("selection-lower", _("Down"), {"Down"});
+ move_top = new Akira.Partials.HeaderBarButton ("selection-top", _("Top"), {"Up"});
+ move_bottom = new Akira.Partials.HeaderBarButton ("selection-bottom", _("Bottom"), {"Down"});
- grid = new Akira.Partials.HeaderBarButton ("layout-grid-%s".printf (settings.icon_style), _("UI Grid"));
- grid.button.action_name = Akira.Services.ActionManager.ACTION_PREFIX + Akira.Services.ActionManager.ACTION_SHOW_UI_GRID;
- grid.tooltip_markup = Granite.markup_accel_tooltip (
- application_instance.get_accels_for_action (grid.button.action_name),
- _("UI Grid")
- );
+ preferences = new Akira.Partials.HeaderBarButton ("open-menu", _("Settings"), {"comma"});
+ preferences.button.action_name = Akira.Services.ActionManager.ACTION_PREFIX + Akira.Services.ActionManager.ACTION_PREFERENCES;
- pixel_grid = new Akira.Partials.HeaderBarButton ("layout-pixels-%s".printf (settings.icon_style), _("Pixel Grid"));
- pixel_grid.button.action_name = Akira.Services.ActionManager.ACTION_PREFIX + Akira.Services.ActionManager.ACTION_SHOW_PIXEL_GRID;
- pixel_grid.tooltip_markup = Granite.markup_accel_tooltip (
- application_instance.get_accels_for_action (pixel_grid.button.action_name),
- _("Pixel Grid")
- );
+ export = new Akira.Partials.HeaderBarButton ("document-export", _("Export"), {"E"});
+ export.button.action_name = Akira.Services.ActionManager.ACTION_PREFIX + Akira.Services.ActionManager.ACTION_EXPORT;
+
+ path_difference = new Akira.Partials.HeaderBarButton ("path-difference", _("Difference"), null);
+ path_exclusion = new Akira.Partials.HeaderBarButton ("path-exclusion", _("Exclusion"), null);
+ path_intersect = new Akira.Partials.HeaderBarButton ("path-intersection", _("Intersect"), null);
+ path_union = new Akira.Partials.HeaderBarButton ("path-union", _("Union"), null);
+
+ pack_start (menu);
+ pack_start (toolset);
+ pack_start (new Gtk.Separator (Gtk.Orientation.VERTICAL));
+ pack_start (zoom);
+ pack_start (new Gtk.Separator (Gtk.Orientation.VERTICAL));
+ pack_start (group);
+ pack_start (ungroup);
+ pack_start (new Gtk.Separator (Gtk.Orientation.VERTICAL));
+ pack_start (move_up);
+ pack_start (move_down);
+ pack_start (move_top);
+ pack_start (move_bottom);
+ pack_start (new Gtk.Separator (Gtk.Orientation.VERTICAL));
- add (menu);
- add (new Gtk.Separator (Gtk.Orientation.VERTICAL));
- add (toolset);
- add (new Gtk.Separator (Gtk.Orientation.VERTICAL));
pack_end (preferences);
+ pack_end (export);
+ pack_end (new Gtk.Separator (Gtk.Orientation.VERTICAL));
+ pack_end (path_difference);
+ pack_end (path_exclusion);
+ pack_end (path_intersect);
+ pack_end (path_union);
pack_end (new Gtk.Separator (Gtk.Orientation.VERTICAL));
- pack_end (layout);
- pack_end (grid);
- pack_end (pixel_grid);
build_signals ();
}
@@ -150,10 +163,20 @@ public class Akira.Layouts.HeaderBar : Gtk.HeaderBar {
}
public void update_icons_style () {
- layout.update_image ("layout-panels-%s".printf (settings.icon_style));
- grid.update_image ("layout-grid-%s".printf (settings.icon_style));
- pixel_grid.update_image ("layout-pixels-%s".printf (settings.icon_style));
- preferences.update_image ("system-settings-%s".printf (settings.icon_style));
+ menu.update_image ();
+ toolset.update_image ();
+ export.update_image ();
+ preferences.update_image ();
+ group.update_image ();
+ ungroup.update_image ();
+ move_up.update_image ();
+ move_down.update_image ();
+ move_top.update_image ();
+ move_bottom.update_image ();
+ path_difference.update_image ();
+ path_exclusion.update_image ();
+ path_intersect.update_image ();
+ path_union.update_image ();
}
public void toggle () {
diff --git a/src/Layouts/LeftSideBar.vala b/src/Layouts/LeftSideBar.vala
index 259907525..e63f5150b 100644
--- a/src/Layouts/LeftSideBar.vala
+++ b/src/Layouts/LeftSideBar.vala
@@ -1,23 +1,24 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
+
public class Akira.Layouts.LeftSideBar : Gtk.Grid {
public bool toggled {
get {
diff --git a/src/Layouts/MainCanvas.vala b/src/Layouts/MainCanvas.vala
index 4488d8a7d..389d09458 100644
--- a/src/Layouts/MainCanvas.vala
+++ b/src/Layouts/MainCanvas.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
@@ -33,20 +33,37 @@ public class Akira.Layouts.MainCanvas : Gtk.Grid {
main_scroll.expand = true;
canvas = new Akira.Lib.Canvas ();
- canvas.set_size_request (main_window_size.width, main_window_size.height);
+ canvas.set_size_request (main_window_size.width, main_window_size.height);
canvas.set_bounds (0, 0, 10000, 10000);
canvas.set_scale (1.0);
- var root = canvas.get_root_item ();
- var text = Goo.CanvasText.create (root, "Add text here", 20, 20, 200, Goo.CanvasAnchorType.NW, "font", "Open Sans 18");
+ var root = canvas.get_root_item ();
+ var rect = new Goo.CanvasRect (null, 100.0, 100.0, 400.0, 400.0,
+ "line-width", 5.0,
+ "radius-x", 100.0,
+ "radius-y", 100.0,
+ "stroke-color", "#f37329",
+ "fill-color", "#ffa154", null);
+ rect.set ("parent", root);
+
+ var rect2 = new Goo.CanvasRect (null, 50, 100, 200, 100,
+ "line-width", 5.0,
+ "stroke-color", "#64baff",
+ "fill-color", "#3689e6");
+
+ rect2.set ("parent", root);
+
+ var rect3 = new Goo.CanvasRect (null, 0, 0, 64, 64,
+ "radius-x", 32.0,
+ "radius-y", 32.0,
+ "line-width", 5.0,
+ "stroke-color", "#9bdb4d",
+ "fill-color", "#68b723");
+
+ rect3.set ("parent", root);
- var rect_item = Goo.CanvasRect.create (root, 100, 100, 400, 400,
- "line-width", 5.0,
- "radius-x", 100.0,
- "radius-y", 100.0,
- "stroke-color", "yellow",
- "fill-color", "#a8eb12"
- );
+ var text = new Goo.CanvasText (null, "Add text here", 20, 20, 200, Goo.CanvasAnchorType.NW, "font", "Open Sans 18");
+ text.set ("parent", root);
main_scroll.add (canvas);
diff --git a/src/Layouts/MainWindow.vala b/src/Layouts/MainWindow.vala
index 2aed3a38b..268345e87 100644
--- a/src/Layouts/MainWindow.vala
+++ b/src/Layouts/MainWindow.vala
@@ -1,23 +1,24 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
+
public class Akira.Layouts.MainWindow : Gtk.Grid {
public weak Akira.Window window { get; construct; }
diff --git a/src/Layouts/Partials/Artboard.vala b/src/Layouts/Partials/Artboard.vala
index 2a8a97d12..586e3b918 100644
--- a/src/Layouts/Partials/Artboard.vala
+++ b/src/Layouts/Partials/Artboard.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
diff --git a/src/Layouts/Partials/Layer.vala b/src/Layouts/Partials/Layer.vala
index 0f2cf5f1f..07f1711f5 100644
--- a/src/Layouts/Partials/Layer.vala
+++ b/src/Layouts/Partials/Layer.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
diff --git a/src/Layouts/Partials/LayersPanel.vala b/src/Layouts/Partials/LayersPanel.vala
index 8668ce672..4feb4004d 100644
--- a/src/Layouts/Partials/LayersPanel.vala
+++ b/src/Layouts/Partials/LayersPanel.vala
@@ -1,23 +1,24 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
+
public class Akira.Layouts.Partials.LayersPanel : Gtk.ListBox {
public weak Akira.Window window { get; construct; }
diff --git a/src/Layouts/Partials/Pages.vala b/src/Layouts/Partials/Pages.vala
deleted file mode 100644
index e69de29bb..000000000
diff --git a/src/Layouts/Partials/PagesPanel.vala b/src/Layouts/Partials/PagesPanel.vala
index fe5f70150..6eeab3f7d 100644
--- a/src/Layouts/Partials/PagesPanel.vala
+++ b/src/Layouts/Partials/PagesPanel.vala
@@ -1,23 +1,24 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
+
public class Akira.Layouts.Partials.PagesPanel : Gtk.ListBox {
public weak Akira.Window window { get; construct; }
diff --git a/src/Layouts/RightSideBar.vala b/src/Layouts/RightSideBar.vala
index 2faeaa37f..052d7227c 100644
--- a/src/Layouts/RightSideBar.vala
+++ b/src/Layouts/RightSideBar.vala
@@ -1,23 +1,24 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
+
public class Akira.Layouts.RightSideBar : Gtk.Grid {
public weak Akira.Window window { get; construct; }
diff --git a/src/Layouts/StatusBar.vala b/src/Layouts/StatusBar.vala
index 2705bd69e..1a5d1463b 100644
--- a/src/Layouts/StatusBar.vala
+++ b/src/Layouts/StatusBar.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
diff --git a/src/Lib/Canvas.vala b/src/Lib/Canvas.vala
index e8185ad42..b048e4990 100644
--- a/src/Lib/Canvas.vala
+++ b/src/Lib/Canvas.vala
@@ -1,27 +1,28 @@
/*
-* Copyright (c) 2018 Felipe Escoto (https://github.com/Philip-Scott)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-* Boston, MA 02111-1307, USA.
+* 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 Akira. If not, see .
*
* Authored by: Felipe Escoto
-* Edited by: Alessandro Castellani
+* Authored by: Alberto Fanjul
*/
public class Akira.Lib.Canvas : Goo.Canvas {
- private const int MIN_SIZE = 40;
+ private const int MIN_SIZE = 1;
+ private const int MIN_POS = 10;
/**
* Signal triggered when item was clicked by the user
@@ -34,61 +35,92 @@ public class Akira.Lib.Canvas : Goo.Canvas {
*/
public signal void item_moved (Goo.CanvasItem? item);
- public weak Goo.CanvasItem? selected_item;
- public weak Goo.CanvasItem? select_effect;
+ public Goo.CanvasItem? selected_item;
+ public Goo.CanvasRect select_effect;
+
+ /*
+ Grabber Pos: 8
+ 0 1 2
+ 7 3
+ 6 5 4
+
+ // -1 if no nub is grabbed
+ */
+ enum Nob {
+ NONE=-1,
+ TOP_LEFT,
+ TOP_CENTER,
+ TOP_RIGHT,
+ RIGHT_CENTER,
+ BOTTOM_RIGHT,
+ BOTTOM_CENTER,
+ BOTTOM_LEFT,
+ LEFT_CENTER,
+ ROTATE
+ }
- public Goo.CanvasItem[] nobs;
- private Goo.CanvasItem? nob_tl;
- private weak Goo.CanvasItem? nob_tc;
- private weak Goo.CanvasItem? nob_tr;
- private weak Goo.CanvasItem? nob_rc;
- private weak Goo.CanvasItem? nob_bl;
- private weak Goo.CanvasItem? nob_bc;
- private weak Goo.CanvasItem? nob_br;
- private weak Goo.CanvasItem? nob_lc;
+ private Goo.CanvasItemSimple[] nobs = new Goo.CanvasItemSimple[9];
- public weak Goo.CanvasItem? hovered_item;
- public weak Goo.CanvasRect? hover_effect;
+ private weak Goo.CanvasItem? hovered_item;
+ private Goo.CanvasRect? hover_effect;
private bool holding;
private double event_x_root;
private double event_y_root;
private double start_x;
private double start_y;
+ private double start_w;
+ private double start_h;
private double delta_x;
private double delta_y;
private double hover_x;
private double hover_y;
private double nob_size;
private double current_scale;
- private int holding_id = 0;
+ private int holding_id = Nob.NONE;
+ private double bounds_x;
+ private double bounds_y;
+ private double bounds_w;
+ private double bounds_h;
construct {
events |= Gdk.EventMask.BUTTON_PRESS_MASK;
events |= Gdk.EventMask.BUTTON_RELEASE_MASK;
events |= Gdk.EventMask.POINTER_MOTION_MASK;
+ get_bounds(out bounds_x, out bounds_y, out bounds_w, out bounds_h);
}
public override bool button_press_event (Gdk.EventButton event) {
remove_hover_effect ();
- remove_select_effect ();
current_scale = get_scale ();
event_x_root = event.x;
event_y_root = event.y;
- selected_item = get_item_at (event.x / current_scale, event.y / current_scale, true);
-
- if (selected_item != null) {
- if (selected_item is Goo.CanvasItemSimple) {
- start_x = (selected_item as Goo.CanvasItemSimple).x;
- start_y = (selected_item as Goo.CanvasItemSimple).y;
- }
+ var clicked_item = get_item_at (event.x / current_scale, event.y / current_scale, true);
+ if (clicked_item != null) {
+ var clicked_id = get_grabbed_id (clicked_item);
holding = true;
- add_select_effect (selected_item);
- grab_focus (selected_item);
+
+ if (clicked_id == Nob.NONE) { // Non-nub was clicked
+ remove_select_effect ();
+ if (clicked_item is Goo.CanvasItemSimple) {
+ clicked_item.get ("x", out start_x, "y", out start_y, "width", out start_w, "height", out start_h);
+ print("start event: start_x %f, start_y %f, start_w %f, start_h %f\n", start_x, start_y, start_w, start_h);
+ }
+
+ add_select_effect (clicked_item);
+ grab_focus (clicked_item);
+
+ selected_item = clicked_item;
+ holding_id = Nob.NONE;
+ } else { // nub was clicked
+ selected_item.get ("x", out start_x, "y", out start_y);
+ holding_id = clicked_id;
+ }
} else {
+ remove_select_effect ();
grab_focus (get_root_item ());
}
@@ -104,107 +136,85 @@ public class Akira.Lib.Canvas : Goo.Canvas {
return false;
}
+ selected_item.get ("x", out start_x, "y", out start_y, "width", out start_w, "height", out start_h);
+ print("release event: start_x %f, start_y %f, start_w %f, start_h %f\n", start_x, start_y, start_w, start_h);
item_moved (selected_item);
add_hover_effect (selected_item);
delta_x = 0;
delta_y = 0;
+
return false;
}
public override bool motion_notify_event (Gdk.EventMotion event) {
if (!holding) {
motion_hover_event (event);
-
return false;
}
delta_x = (event.x - event_x_root) / current_scale;
delta_y = (event.y - event_y_root) / current_scale;
- var item = ((Goo.CanvasItemSimple) selected_item);
- var stroke = item.line_width;
- var width = item.bounds.x2 - item.bounds.x1 + stroke;
- var height = item.bounds.y2 - item.bounds.y1 + stroke;
- switch (holding_id) {
- case 0: // Moving
- ((Goo.CanvasItemSimple) selected_item).x = delta_x + start_x;
- ((Goo.CanvasItemSimple) selected_item).y = delta_y + start_y;
-
- // Bounding box
- ((Goo.CanvasItemSimple) select_effect).x = delta_x + start_x - ((Goo.CanvasItemSimple) selected_item).line_width;
- ((Goo.CanvasItemSimple) select_effect).y = delta_y + start_y - ((Goo.CanvasItemSimple) selected_item).line_width;
+ print("delta_x: %f\n", delta_x);
+ print("delta_y: %f\n", delta_y);
- // TOP LEFT nob
- ((Goo.CanvasItemSimple) nob_tl).x = delta_x + start_x - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_tl).y = delta_y + start_y - (nob_size / 2) - stroke;
+ var new_x = start_x;
+ var new_y = start_y;
+ var new_width = start_w;
+ var new_height = start_h;
- // TOP RIGHT nob
- ((Goo.CanvasItemSimple) nob_tr).x = delta_x + start_x + width - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_tr).y = delta_y + start_y - (nob_size / 2) - stroke;
-
- // BOTTOM RIGHT nob
- ((Goo.CanvasItemSimple) nob_br).x = delta_x + start_x + width - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_br).y = delta_y + start_y + height - (nob_size / 2) - stroke;
-
- // BOTTOM LEFT nob
- ((Goo.CanvasItemSimple) nob_bl).x = delta_x + start_x - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_bl).y = delta_y + start_y + height - (nob_size / 2) - stroke;
-
- // TOP CENTER nob
- ((Goo.CanvasItemSimple) nob_tc).x = delta_x + start_x + (width / 2) - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_tc).y = delta_y + start_y - (nob_size / 2) - stroke;
-
- // RIGHT CENTER nob
- ((Goo.CanvasItemSimple) nob_rc).x = delta_x + start_x + width - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_rc).y = delta_y + start_y + (height / 2) - (nob_size / 2) - stroke;
-
- // BOTTOM CENTER nob
- ((Goo.CanvasItemSimple) nob_bc).x = delta_x + start_x + (width / 2) - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_bc).y = delta_y + start_y + height - (nob_size / 2) - stroke;
-
- // LEFT CENTER nob
- ((Goo.CanvasItemSimple) nob_lc).x = delta_x + start_x - (nob_size / 2) - stroke;
- ((Goo.CanvasItemSimple) nob_lc).y = delta_y + start_y + (height / 2) - (nob_size / 2) - stroke;
-
- debug ("X:%f - Y:%f\n", ((Goo.CanvasItemSimple) selected_item).x, ((Goo.CanvasItemSimple) selected_item).y);
+ switch (holding_id) {
+ case Nob.NONE: // Moving
+ new_x = fix_x_position ((delta_x + start_x), start_w);
+ new_y = fix_y_position ((delta_y + start_y), start_h);
+ break;
+ case Nob.TOP_LEFT:
+ new_x = fix_size (delta_x + start_x);
+ new_y = fix_size (delta_y + start_y);
+ new_width = fix_size (start_w - delta_x);
+ new_height = fix_size (start_h - delta_y);
+ break;
+ case Nob.TOP_CENTER:
+ new_y = delta_y + start_y;
+ new_height = start_h - delta_y;
+ break;
+ case Nob.TOP_RIGHT:
+ new_x = start_x;
+ new_y = fix_size (delta_y + start_y);
+ new_width = fix_size (start_w + delta_x);
+ new_height = fix_size (start_h - delta_y);
+ break;
+ case Nob.RIGHT_CENTER:
+ new_width = start_w + delta_x;
+ break;
+ case Nob.BOTTOM_RIGHT:
+ new_width = fix_size (start_w + delta_x);
+ new_height = fix_size (start_h + delta_y);
+ break;
+ case Nob.BOTTOM_CENTER:
+ new_height = fix_size (start_h + delta_y);
+ break;
+ case Nob.BOTTOM_LEFT:
+ new_x = fix_size(delta_x + start_x);
+ new_width = fix_size (start_w - delta_x);
+ new_height = fix_size (start_h + delta_y);
+ break;
+ case Nob.LEFT_CENTER:
+ new_x = delta_x + start_x;
+ new_width = start_w - delta_x;
+ break;
+ case Nob.ROTATE:
+ break;
+ default:
+ print("grab rotate");
break;
- // case 1: // Top left
- // delta_x = fix_position (x, real_width, start_w);
- // delta_y = fix_position (y, real_height, start_h);
- // real_height = fix_size ((int) (start_h - 1 / current_scale * y));
- // real_width = fix_size ((int) (start_w - 1 / current_scale * x));
- // break;
- // case 2: // Top
- // delta_y = fix_position (y, real_height, start_h);
- // real_height = fix_size ((int)(start_h - 1 / current_scale * y));
- // break;
- // case 3: // Top right
- // delta_y = fix_position (y, real_height, start_h);
- // real_height = fix_size ((int)(start_h - 1 / current_scale * y));
- // real_width = fix_size ((int)(start_w + 1 / current_scale * x));
- // break;
- // case 4: // Right
- // real_width = fix_size ((int)(start_w + 1 / current_scale * x));
- // break;
- // case 5: // Bottom Right
- // real_width = fix_size ((int)(start_w + 1 / current_scale * x));
- // real_height = fix_size ((int)(start_h + 1 / current_scale * y));
- // break;
- // case 6: // Bottom
- // real_height = fix_size ((int)(start_h + 1 / current_scale * y));
- // break;
- // case 7: // Bottom left
- // real_height = fix_size ((int)(start_h + 1 / current_scale * y));
- // real_width = fix_size ((int)(start_w - 1 / current_scale * x));
- // delta_x = fix_position (x, real_width, start_w);
- // break;
- // case 8: // Left
- // real_width = fix_size ((int) (start_w - 1 / current_scale * x));
- // delta_x = fix_position (x, real_width, start_w);
- // break;
}
+ selected_item.set ("x", new_x, "y", new_y, "width", new_width, "height", new_height);
+
+ update_nob_position (selected_item);
+ update_select_effect (selected_item);
return false;
}
@@ -212,21 +222,23 @@ public class Akira.Lib.Canvas : Goo.Canvas {
private void motion_hover_event (Gdk.EventMotion event) {
hovered_item = get_item_at (event.x / get_scale (), event.y / get_scale (), true);
- if (!(hovered_item is Goo.CanvasItem)) {
+ if (!(hovered_item is Goo.CanvasItemSimple)) {
remove_hover_effect ();
return;
}
add_hover_effect (hovered_item);
- if ((hover_x != (hovered_item as Goo.CanvasItemSimple).x
- || hover_y != (hovered_item as Goo.CanvasItemSimple).y)
- && hover_effect != hovered_item) {
+ double check_x;
+ double check_y;
+ hovered_item.get ("x", out check_x, "y", out check_y);
+
+ if ((hover_x != check_x || hover_y != check_y) && hover_effect != hovered_item) {
remove_hover_effect ();
}
- hover_x = (hovered_item as Goo.CanvasItemSimple).x;
- hover_y = (hovered_item as Goo.CanvasItemSimple).y;
+ hover_x = check_x;
+ hover_y = check_y;
}
private void add_select_effect (Goo.CanvasItem? target) {
@@ -234,94 +246,57 @@ public class Akira.Lib.Canvas : Goo.Canvas {
return;
}
+ double x, y;
+ target.get ("x", out x, "y", out y);
+
var item = (target as Goo.CanvasItemSimple);
var line_width = 1.0 / current_scale;
- var stroke = item.line_width;
- var x = item.x - stroke;
- var y = item.y - stroke;
- var width = item.bounds.x2 - item.bounds.x1 + stroke;
- var height = item.bounds.y2 - item.bounds.y1 + stroke;
-
- select_effect = Goo.CanvasRect.create (get_root_item (), x, y, width, height,
- "line-width", line_width,
- "stroke-color", "#666"
+ var real_x = x - (line_width * 2);
+ var real_y = y - (line_width * 2);
+ var width = item.bounds.x2 - item.bounds.x1;
+ var height = item.bounds.y2 - item.bounds.y1;
+
+ select_effect = new Goo.CanvasRect (null, real_x, real_y, width, height,
+ "line-width", line_width,
+ "stroke-color", "#666", null
);
+ select_effect.set ("parent", get_root_item ());
+
nob_size = 10 / current_scale;
- nob_tl = Goo.CanvasRect.create (get_root_item (), x - (nob_size / 2), y - (nob_size / 2), nob_size, nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
-
- // nob_tl = new Akira.Lib.Selection.Nob.with_values (get_root_item (), x, y, current_scale);
-
- nob_tr = Goo.CanvasRect.create (get_root_item (), x + width - (nob_size / 2), y - (nob_size / 2), nob_size, nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
-
- nob_bl = Goo.CanvasRect.create (get_root_item (), x - (nob_size / 2), y + height - (nob_size / 2), nob_size, nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
-
- nob_br = Goo.CanvasRect.create (get_root_item (), x + width - (nob_size / 2), y + height - (nob_size / 2), nob_size, nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
-
- nob_tc = Goo.CanvasRect.create (get_root_item (), x + (width / 2) - (nob_size / 2), y - (nob_size / 2), nob_size, nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
-
- nob_rc = Goo.CanvasRect.create (get_root_item (),
- x + width - (nob_size / 2),
- y + (height / 2) - (nob_size / 2),
- nob_size,
- nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
-
- nob_bc = Goo.CanvasRect.create (get_root_item (),
- x + (width / 2) - (nob_size / 2),
- y + height - (nob_size / 2),
- nob_size,
- nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
-
- nob_lc = Goo.CanvasRect.create (get_root_item (),
- x - (nob_size / 2),
- y + (height / 2) - (nob_size / 2),
- nob_size,
- nob_size,
- "line-width", line_width,
- "stroke-color", "#41c9fd",
- "fill-color", "#fff"
- );
+ for (int i = 0; i < 9; i++) {
+ var radius = i == 8 ? nob_size : 0;
+ nobs[i] = new Goo.CanvasRect (null, 0, 0, nob_size, nob_size,
+ "line-width", line_width,
+ "radius-x", radius,
+ "radius-y", radius,
+ "stroke-color", "#41c9fd",
+ "fill-color", "#fff", null
+ );
+ nobs[i].set ("parent", get_root_item ());
+ }
+
+ update_nob_position (target);
select_effect.can_focus = false;
- nob_tl.can_focus = false;
- nob_tr.can_focus = false;
- nob_bl.can_focus = false;
- nob_br.can_focus = false;
- nob_tc.can_focus = false;
- nob_rc.can_focus = false;
- nob_bc.can_focus = false;
- nob_lc.can_focus = false;
-
- nobs = {nob_tl, nob_tr, nob_bl, nob_br, nob_tc, nob_rc, nob_bc, nob_lc};
+ }
+
+ private void update_select_effect (Goo.CanvasItem? target) {
+ if (target == null || target == select_effect) {
+ return;
+ }
+
+ double x, y, width, height;
+ target.get ("x", out x, "y", out y, "width", out width, "height", out height);
+
+ var item = (target as Goo.CanvasItemSimple);
+ var stroke = (item.line_width / 2);
+ var line_width = 1.0 / current_scale;
+ var real_x = x - (line_width * 2);
+ var real_y = y - (line_width * 2);
+
+ select_effect.set ("x", real_x, "y", real_y, "width", width + (stroke * 2), "height", height + (stroke * 2));
}
private void remove_select_effect () {
@@ -331,15 +306,27 @@ public class Akira.Lib.Canvas : Goo.Canvas {
select_effect.remove ();
select_effect = null;
+ selected_item = null;
- nob_tl.remove ();
- nob_bl.remove ();
- nob_tr.remove ();
- nob_br.remove ();
- nob_tc.remove ();
- nob_rc.remove ();
- nob_bc.remove ();
- nob_lc.remove ();
+ for (int i = 0; i < 9; i++) {
+ nobs[i].remove ();
+ }
+ }
+
+ public void reset_select () {
+ if (selected_item == null && select_effect == null) {
+ return;
+ }
+
+ select_effect.remove ();
+ select_effect = null;
+
+ for (int i = 0; i < 9; i++) {
+ nobs[i].remove ();
+ }
+
+ current_scale = get_scale ();
+ add_select_effect (selected_item);
}
private void add_hover_effect (Goo.CanvasItem? target) {
@@ -347,24 +334,28 @@ public class Akira.Lib.Canvas : Goo.Canvas {
return;
}
- if (target in nobs) {
- set_cursor_for_nob (target);
+ if ((target as Goo.CanvasItemSimple) in nobs) {
+ set_cursor_for_nob (get_grabbed_id (target));
return;
}
+ double x, y;
+ target.get ("x", out x, "y", out y);
+
var item = (target as Goo.CanvasItemSimple);
var line_width = 2.0 / get_scale ();
var stroke = item.line_width;
- var x = item.x - stroke;
- var y = item.y - stroke;
- var width = item.bounds.x2 - item.bounds.x1 + stroke;
- var height = item.bounds.y2 - item.bounds.y1 + stroke;
-
- hover_effect = Goo.CanvasRect.create (get_root_item (), x, y, width, height,
- "line-width", line_width,
- "stroke-color", "#41c9fd"
+ var real_x = x - (line_width * 2);
+ var real_y = y - (line_width * 2);
+ var width = item.bounds.x2 - item.bounds.x1 + stroke - line_width;
+ var height = item.bounds.y2 - item.bounds.y1 + stroke - line_width;
+
+ hover_effect = new Goo.CanvasRect (null, real_x, real_y, width, height,
+ "line-width", line_width,
+ "stroke-color", "#41c9fd", null
);
+ hover_effect.set ("parent", get_root_item ());
hover_effect.can_focus = false;
}
@@ -380,44 +371,135 @@ public class Akira.Lib.Canvas : Goo.Canvas {
hover_effect = null;
}
- private void set_cursor_for_nob (Goo.CanvasItem? target) {
- if (target == nob_tl) {
- set_cursor (Gdk.CursorType.TOP_LEFT_CORNER);
- } else if (target == nob_tr) {
- set_cursor (Gdk.CursorType.TOP_RIGHT_CORNER);
- } else if (target == nob_br) {
- set_cursor (Gdk.CursorType.BOTTOM_RIGHT_CORNER);
- } else if (target == nob_bl) {
- set_cursor (Gdk.CursorType.BOTTOM_LEFT_CORNER);
- } else if (target == nob_rc) {
- set_cursor (Gdk.CursorType.RIGHT_SIDE);
- } else if (target == nob_bc) {
- set_cursor (Gdk.CursorType.BOTTOM_SIDE);
- } else if (target == nob_lc) {
- set_cursor (Gdk.CursorType.LEFT_SIDE);
- } else if (target == nob_tc) {
- set_cursor (Gdk.CursorType.TOP_SIDE);
- } else {
- set_cursor (Gdk.CursorType.ARROW);
+ private int get_grabbed_id (Goo.CanvasItem? target) {
+ for (int i = 0; i < 9; i++) {
+ if (target == nobs[i]) return i;
+ }
+
+ return Nob.NONE;
+ }
+
+ private void set_cursor_for_nob (int grabbed_id) {
+ switch (grabbed_id) {
+ case Nob.NONE:
+ set_cursor (Gdk.CursorType.ARROW);
+ break;
+ case Nob.TOP_LEFT:
+ set_cursor (Gdk.CursorType.TOP_LEFT_CORNER);
+ break;
+ case Nob.TOP_CENTER:
+ set_cursor (Gdk.CursorType.TOP_SIDE);
+ break;
+ case Nob.TOP_RIGHT:
+ set_cursor (Gdk.CursorType.TOP_RIGHT_CORNER);
+ break;
+ case Nob.RIGHT_CENTER:
+ set_cursor (Gdk.CursorType.RIGHT_SIDE);
+ break;
+ case Nob.BOTTOM_RIGHT:
+ set_cursor (Gdk.CursorType.BOTTOM_RIGHT_CORNER);
+ break;
+ case Nob.BOTTOM_CENTER:
+ set_cursor (Gdk.CursorType.BOTTOM_SIDE);
+ break;
+ case Nob.BOTTOM_LEFT:
+ set_cursor (Gdk.CursorType.BOTTOM_LEFT_CORNER);
+ break;
+ case Nob.LEFT_CENTER:
+ set_cursor (Gdk.CursorType.LEFT_SIDE);
+ break;
+ case Nob.ROTATE:
+ set_cursor (Gdk.CursorType.ICON);
+ break;
}
}
+ // Updates all the nub's position arround the selected item, except for the grabbed nub
+ // TODO: concider item rotation into account
+ private void update_nob_position (Goo.CanvasItem target) {
+ var item = (target as Goo.CanvasItemSimple);
+
+ var stroke = (item.line_width / 2);
+ double x, y, width, height;
+ target.get ("x", out x, "y", out y, "width", out width, "height", out height);
+ var middle = (nob_size / 2) + stroke;
+ var middle_stroke = (nob_size / 2) - stroke;
+
+ // TOP LEFT nob
+ nobs[Nob.TOP_LEFT].set ("x", x - middle, "y", y - middle);
+
+ // TOP CENTER nob
+ nobs[Nob.TOP_CENTER].set ("x", x + (width / 2) - middle, "y", y - middle);
+
+ // TOP RIGHT nob
+ nobs[Nob.TOP_RIGHT].set ("x", x + width - middle_stroke, "y", y - middle);
+
+ // RIGHT CENTER nob
+ nobs[Nob.RIGHT_CENTER].set ("x", x + width - middle_stroke,
+ "y", y + (height / 2) - middle);
+
+ // BOTTOM RIGHT nob
+ nobs[Nob.BOTTOM_RIGHT].set ("x", x + width - middle_stroke,
+ "y", y + height - middle_stroke);
+
+ // BOTTOM CENTER nob
+ nobs[Nob.BOTTOM_CENTER].set ("x", x + (width / 2) - middle,
+ "y", y + height - middle_stroke);
+
+ // BOTTOM LEFT nob
+ nobs[Nob.BOTTOM_LEFT].set ("x", x - middle,
+ "y", y + height - middle_stroke);
+
+ // LEFT CENTER nob
+ nobs[Nob.LEFT_CENTER].set ("x", x - middle,
+ "y", y + (height / 2) - middle);
+
+ // ROTATE nob
+ double distance = 40;
+ if (current_scale < 1) {
+ distance = 40 + ((40 - (40 * current_scale)) * 2);
+ }
+
+ nobs[Nob.ROTATE].set ("x", x + (width / 2) - middle,
+ "y", y - (nob_size / 2) - distance);
+ }
+
private void set_cursor (Gdk.CursorType cursor_type) {
var cursor = new Gdk.Cursor.for_display (Gdk.Display.get_default (), cursor_type);
- get_window ().get_screen ().get_root_window ().set_cursor (cursor);
+ get_window ().set_cursor (cursor);
+ }
+
+ // To make it so items can't become imposible to grab. TODOs
+ private double fix_y_position (double y, double height) {
+ var min_delta = (MIN_POS - height) * current_scale;
+ var max_delta = (bounds_h + height - MIN_POS) * current_scale;
+ print("min_y_delta %f\n", min_delta);
+ print("max_y_delta %f\n", max_delta);
+ if (y < min_delta) {
+ return Math.round (min_delta);
+ } else if (y > max_delta) {
+ return Math.round (max_delta);
+ } else {
+ return Math.round (y);
+ }
}
// To make it so items can't become imposible to grab. TODOs
- // private int fix_position (int delta, int length, int initial_length) {
- // var max_delta = (initial_length - MIN_SIZE) * current_scale;
- // if (delta < max_delta) {
- // return delta;
- // } else {
- // return (int) max_delta;
- // }
- // }
-
- // private int fix_size (int size) {
- // return size > MIN_SIZE ? size : MIN_SIZE;
- // }
-}
\ No newline at end of file
+ private double fix_x_position (double x, double width) {
+ var min_delta = (MIN_POS - width) * current_scale;
+ var max_delta = (bounds_h + width - MIN_POS) * current_scale;
+ print("min_x_delta %f\n", min_delta);
+ print("max_x_delta %f\n", max_delta);
+ if (x < min_delta) {
+ return Math.round (min_delta);
+ } else if (x > max_delta) {
+ return Math.round (max_delta);
+ } else {
+ return Math.round (x);
+ }
+ }
+
+ private double fix_size (double size) {
+ return size > MIN_SIZE ? Math.round (size) : MIN_SIZE;
+ }
+}
diff --git a/src/Lib/Item.vala b/src/Lib/Item.vala
index 1217c3bfb..4bb1e9176 100644
--- a/src/Lib/Item.vala
+++ b/src/Lib/Item.vala
@@ -1,22 +1,22 @@
/*
-* Copyright (c) 2018 Alessandro Castellani (https://github.com/Alecaddd)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-* Boston, MA 02111-1307, USA.
+* 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 Akira. If not, see .
*
-* Authored by: Alessandro Castellani
+* Authored by: Alessandro "Alecaddd" Castellani
*/
public class Akira.Lib.Item : Goo.CanvasItemSimple, Goo.CanvasItem {
diff --git a/src/Lib/Selection/Nob.vala b/src/Lib/Selection/Nob.vala
index 8ba29b0e7..e5070804c 100644
--- a/src/Lib/Selection/Nob.vala
+++ b/src/Lib/Selection/Nob.vala
@@ -1,24 +1,23 @@
/*
-* Copyright (c) 2018 Alessandro Castellani (https://github.com/Alecaddd)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-* Boston, MA 02111-1307, USA.
+* 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 Akira. If not, see .
*
-* Authored by: Alessandro Castellani
+* Authored by: Alessandro "Alecaddd" Castellani
*/
-
public class Akira.Lib.Selection.Nob : Goo.CanvasItemSimple, Goo.CanvasItem {
public double height { get; set; default = 10; }
public double radius_x { get; set; }
diff --git a/src/Main.vala b/src/Main.vala
index 4f653852b..63db673b2 100644
--- a/src/Main.vala
+++ b/src/Main.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
diff --git a/src/Partials/HeaderBarButton.vala b/src/Partials/HeaderBarButton.vala
index fe21c567c..df2ceb763 100644
--- a/src/Partials/HeaderBarButton.vala
+++ b/src/Partials/HeaderBarButton.vala
@@ -1,26 +1,26 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
public class Akira.Partials.HeaderBarButton : Gtk.Grid {
- public bool labelled {
+ public bool labeled {
get {
return label_btn.visible;
} set {
@@ -33,45 +33,45 @@ public class Akira.Partials.HeaderBarButton : Gtk.Grid {
public Gtk.Button button;
public Gtk.Image image;
- public HeaderBarButton (string icon_name, string name) {
+ public HeaderBarButton (string icon_name, string name, string[]? accels = null) {
label_btn = new Gtk.Label (name);
label_btn.get_style_context ().add_class ("headerbar-label");
- var size = settings.icon_style == "symbolic" ? Gtk.IconSize.SMALL_TOOLBAR : Gtk.IconSize.LARGE_TOOLBAR;
+ var size = settings.use_symbolic == true ? Gtk.IconSize.SMALL_TOOLBAR : Gtk.IconSize.LARGE_TOOLBAR;
+ var icon = settings.use_symbolic == true ? ("%s-symbolic".printf (icon_name)) : icon_name;
- image = new Gtk.Image.from_icon_name (icon_name, size);
+ image = new Gtk.Image.from_icon_name (icon, size);
image.margin = 0;
button = new Gtk.Button ();
button.can_focus = false;
button.halign = Gtk.Align.CENTER;
- button.margin_top = 10;
button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
button.add (image);
+ button.tooltip_markup = Granite.markup_accel_tooltip (accels, name);
attach (button, 0, 0, 1, 1);
attach (label_btn, 0, 1, 1, 1);
-
- button.margin_bottom = 3;
- margin_bottom = 6;
+ valign = Gtk.Align.CENTER;
}
public void toggle () {
- labelled = !labelled;
+ labeled = !labeled;
}
public void show_labels () {
- labelled = true;
+ labeled = true;
}
public void hide_labels () {
- labelled = false;
+ labeled = false;
}
- public void update_image (string icon_name) {
- var size = settings.icon_style == "symbolic" ? Gtk.IconSize.SMALL_TOOLBAR : Gtk.IconSize.LARGE_TOOLBAR;
+ public void update_image () {
+ var size = settings.use_symbolic == true ? Gtk.IconSize.SMALL_TOOLBAR : Gtk.IconSize.LARGE_TOOLBAR;
+ var new_icon = settings.use_symbolic == true ? ("%s-symbolic".printf (image.icon_name)) : image.icon_name.replace ("-symbolic", "");
button.remove (image);
- image = new Gtk.Image.from_icon_name (icon_name, size);
+ image = new Gtk.Image.from_icon_name (new_icon, size);
button.add (image);
image.show_all ();
}
diff --git a/src/Partials/MenuButton.vala b/src/Partials/MenuButton.vala
index 6553f4e6e..0872bb445 100644
--- a/src/Partials/MenuButton.vala
+++ b/src/Partials/MenuButton.vala
@@ -1,74 +1,79 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
-public class Akira.Partials.MenuButton : Gtk.MenuButton {
- public bool labelled {
+public class Akira.Partials.MenuButton : Gtk.Grid {
+ public bool labeled {
get {
return label_btn.visible;
} set {
label_btn.visible = value;
label_btn.no_show_all = !value;
-
- if (value) {
- get_style_context ().add_class ("headerbar-button");
- } else {
- get_style_context ().remove_class ("headerbar-button");
- }
}
}
private Gtk.Label label_btn;
+ public Gtk.MenuButton button;
+ public Gtk.Image image;
- public MenuButton (string icon_name, string name, string tooltip) {
- can_focus = false;
- valign = Gtk.Align.CENTER;
- margin_top = 4;
- margin_bottom = 2;
-
- Gtk.Image image;
- var grid = new Gtk.Grid ();
+ public MenuButton (string icon_name, string name, string[]? accels = null) {
label_btn = new Gtk.Label (name);
- label_btn.margin_top = 2;
+ label_btn.get_style_context ().add_class ("headerbar-label");
- image = new Gtk.Image.from_icon_name (icon_name, Gtk.IconSize.SMALL_TOOLBAR);
+ var size = settings.use_symbolic == true ? Gtk.IconSize.SMALL_TOOLBAR : Gtk.IconSize.LARGE_TOOLBAR;
+ var icon = settings.use_symbolic == true ? ("%s-symbolic".printf (icon_name)) : icon_name;
+
+ image = new Gtk.Image.from_icon_name (icon, size);
image.margin = 0;
- grid.attach (image, 0, 0, 1, 1);
- grid.attach (label_btn, 0, 1, 1, 1);
- add (grid);
+ button = new Gtk.MenuButton ();
+ button.can_focus = false;
+ button.halign = Gtk.Align.CENTER;
+ button.get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
+ button.add (image);
+ button.tooltip_markup = Granite.markup_accel_tooltip (accels, name);
+
+ attach (button, 0, 0, 1, 1);
+ attach (label_btn, 0, 1, 1, 1);
- get_style_context ().add_class (Gtk.STYLE_CLASS_FLAT);
- get_style_context ().add_class ("headerbar-button");
- set_tooltip_text (tooltip);
+ valign = Gtk.Align.CENTER;
}
public void toggle () {
- labelled = !labelled;
+ labeled = !labeled;
}
public void show_labels () {
- labelled = true;
+ labeled = true;
}
public void hide_labels () {
- labelled = false;
+ labeled = false;
+ }
+
+ public void update_image () {
+ var size = settings.use_symbolic == true ? Gtk.IconSize.SMALL_TOOLBAR : Gtk.IconSize.LARGE_TOOLBAR;
+ var new_icon = settings.use_symbolic == true ? ("%s-symbolic".printf (image.icon_name)) : image.icon_name.replace ("-symbolic", "");
+ button.remove (image);
+ image = new Gtk.Image.from_icon_name (new_icon, size);
+ button.add (image);
+ image.show_all ();
}
}
diff --git a/src/Partials/ZoomButton.vala b/src/Partials/ZoomButton.vala
new file mode 100644
index 000000000..46fc279ca
--- /dev/null
+++ b/src/Partials/ZoomButton.vala
@@ -0,0 +1,129 @@
+/*
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
+*
+* This file is part of Akira.
+*
+* Akira 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.
+
+* Akira 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 Akira. If not, see .
+*
+* Authored by: Alessandro "Alecaddd" Castellani
+*/
+
+public class Akira.Partials.ZoomButton : Gtk.Grid {
+ public weak Akira.Window window { get; construct; }
+
+ public bool labeled {
+ get {
+ return label_btn.visible;
+ } set {
+ label_btn.visible = value;
+ label_btn.no_show_all = !value;
+ }
+ }
+
+ private Gtk.Label label_btn;
+ public Gtk.Button zoom_out_button;
+ public Gtk.Button zoom_default_button;
+ public Gtk.Button zoom_in_button;
+
+ public ZoomButton (Akira.Window main_window) {
+ Object (
+ window: main_window
+ );
+ }
+
+ construct {
+ get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED);
+ get_style_context ().add_class ("linked-flat");
+ valign = Gtk.Align.CENTER;
+ column_homogeneous = false;
+ width_request = 140;
+ hexpand = false;
+
+ zoom_out_button = new Gtk.Button.from_icon_name ("zoom-out-symbolic", Gtk.IconSize.MENU);
+ zoom_out_button.clicked.connect (zoom_out);
+ zoom_out_button.get_style_context ().add_class ("raised");
+ zoom_out_button.get_style_context ().add_class ("button-zoom");
+ zoom_out_button.can_focus = false;
+ zoom_out_button.tooltip_markup = Granite.markup_accel_tooltip ({"minus"}, _("Zoom Out"));
+
+ zoom_default_button = new Gtk.Button.with_label ("100%");
+ zoom_default_button.hexpand = true;
+ zoom_default_button.clicked.connect (zoom_reset);
+ zoom_default_button.can_focus = false;
+ zoom_default_button.tooltip_markup = Granite.markup_accel_tooltip ({"0"}, _("Reset Zoom"));
+
+ zoom_in_button = new Gtk.Button.from_icon_name ("zoom-in-symbolic", Gtk.IconSize.MENU);
+ zoom_in_button.clicked.connect (zoom_in);
+ zoom_in_button.get_style_context ().add_class ("raised");
+ zoom_in_button.get_style_context ().add_class ("button-zoom");
+ zoom_in_button.can_focus = false;
+ zoom_in_button.tooltip_markup = Granite.markup_accel_tooltip ({"plus"}, _("Zoom In"));
+
+ attach (zoom_out_button, 0, 0, 1, 1);
+ attach (zoom_default_button, 1, 0, 1, 1);
+ attach (zoom_in_button, 2, 0, 1, 1);
+
+ label_btn = new Gtk.Label (_("Zoom"));
+ label_btn.get_style_context ().add_class ("headerbar-label");
+ label_btn.margin_top = 4;
+
+ attach (label_btn, 0, 1, 3, 1);
+ }
+
+ public void toggle () {
+ labeled = !labeled;
+ }
+
+ public void show_labels () {
+ labeled = true;
+ }
+
+ public void hide_labels () {
+ labeled = false;
+ }
+
+ public void zoom_out () {
+ var zoom = int.parse (zoom_default_button.label) - 10;
+ if (zoom < 0) {
+ zoom_out_button.sensitive = false;
+ return;
+ }
+
+ zoom_out_button.sensitive = true;
+ zoom_default_button.label = "%.0f%%".printf (zoom);
+ window.main_window.main_canvas.canvas.set_scale (window.main_window.main_canvas.canvas.get_scale () - 0.1);
+ window.main_window.main_canvas.canvas.reset_select ();
+ }
+
+ public void zoom_in () {
+ var zoom = int.parse (zoom_default_button.label) + 10;
+ if (zoom > 1000) {
+ zoom_in_button.sensitive = false;
+ return;
+ }
+
+ zoom_in_button.sensitive = true;
+ zoom_default_button.label = "%.0f%%".printf (zoom);
+ window.main_window.main_canvas.canvas.set_scale (window.main_window.main_canvas.canvas.get_scale () + 0.1);
+ window.main_window.main_canvas.canvas.reset_select ();
+ }
+
+ public void zoom_reset () {
+ zoom_in_button.sensitive = true;
+ zoom_out_button.sensitive = true;
+ zoom_default_button.label = "100%";
+ window.main_window.main_canvas.canvas.set_scale (1);
+ window.main_window.main_canvas.canvas.reset_select ();
+ }
+}
\ No newline at end of file
diff --git a/src/Services/ActionManager.vala b/src/Services/ActionManager.vala
index 99403683e..1a0739565 100644
--- a/src/Services/ActionManager.vala
+++ b/src/Services/ActionManager.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
@@ -34,8 +34,12 @@ public class Akira.Services.ActionManager : Object {
public const string ACTION_SHOW_UI_GRID = "action-show-ui-grid";
public const string ACTION_PRESENTATION = "action_presentation";
public const string ACTION_PREFERENCES = "action_preferences";
+ public const string ACTION_EXPORT = "action_export";
public const string ACTION_LABELS = "action_labels";
public const string ACTION_QUIT = "action_quit";
+ public const string ACTION_ZOOM_IN = "action_zoom_in";
+ public const string ACTION_ZOOM_OUT = "action_zoom_out";
+ public const string ACTION_ZOOM_RESET = "action_zoom_reset";
public static Gee.MultiMap action_accelerators = new Gee.HashMultiMap ();
@@ -48,8 +52,12 @@ public class Akira.Services.ActionManager : Object {
{ ACTION_SHOW_UI_GRID, action_show_ui_grid },
{ ACTION_PRESENTATION, action_presentation },
{ ACTION_PREFERENCES, action_preferences },
+ { ACTION_EXPORT, action_export },
{ ACTION_LABELS, action_labels },
{ ACTION_QUIT, action_quit },
+ { ACTION_ZOOM_IN, action_zoom_in },
+ { ACTION_ZOOM_OUT, action_zoom_out },
+ { ACTION_ZOOM_RESET, action_zoom_reset },
};
public ActionManager (Akira.Application akira_app, Akira.Window main_window) {
@@ -68,7 +76,11 @@ public class Akira.Services.ActionManager : Object {
action_accelerators.set (ACTION_SHOW_UI_GRID, "g");
action_accelerators.set (ACTION_PRESENTATION, "period");
action_accelerators.set (ACTION_PREFERENCES, "comma");
+ action_accelerators.set (ACTION_EXPORT, "e");
action_accelerators.set (ACTION_QUIT, "q");
+ action_accelerators.set (ACTION_ZOOM_IN, "equal");
+ action_accelerators.set (ACTION_ZOOM_OUT, "minus");
+ action_accelerators.set (ACTION_ZOOM_RESET, "0");
}
construct {
@@ -84,33 +96,60 @@ public class Akira.Services.ActionManager : Object {
private void action_labels () {
window.headerbar.toggle ();
window.headerbar.menu.toggle ();
- window.headerbar.layout.toggle ();
- window.headerbar.grid.toggle ();
- window.headerbar.pixel_grid.toggle ();
window.headerbar.toolset.toggle ();
+ window.headerbar.zoom.toggle ();
window.headerbar.preferences.toggle ();
+ window.headerbar.export.toggle ();
+ window.headerbar.group.toggle ();
+ window.headerbar.ungroup.toggle ();
+ window.headerbar.move_up.toggle ();
+ window.headerbar.move_down.toggle ();
+ window.headerbar.move_top.toggle ();
+ window.headerbar.move_bottom.toggle ();
+ window.headerbar.path_difference.toggle ();
+ window.headerbar.path_exclusion.toggle ();
+ window.headerbar.path_intersect.toggle ();
+ window.headerbar.path_union.toggle ();
window.headerbar.toggle ();
}
public void show_labels () {
window.headerbar.toggle ();
window.headerbar.menu.show_labels ();
- window.headerbar.layout.show_labels ();
- window.headerbar.grid.show_labels ();
- window.headerbar.pixel_grid.show_labels ();
window.headerbar.toolset.show_labels ();
+ window.headerbar.zoom.show_labels ();
window.headerbar.preferences.show_labels ();
+ window.headerbar.export.show_labels ();
+ window.headerbar.group.show_labels ();
+ window.headerbar.ungroup.show_labels ();
+ window.headerbar.move_up.show_labels ();
+ window.headerbar.move_down.show_labels ();
+ window.headerbar.move_top.show_labels ();
+ window.headerbar.move_bottom.show_labels ();
+ window.headerbar.path_difference.show_labels ();
+ window.headerbar.path_exclusion.show_labels ();
+ window.headerbar.path_intersect.show_labels ();
+ window.headerbar.path_union.show_labels ();
window.headerbar.toggle ();
}
public void hide_labels () {
window.headerbar.toggle ();
window.headerbar.menu.hide_labels ();
- window.headerbar.layout.hide_labels ();
- window.headerbar.grid.hide_labels ();
- window.headerbar.pixel_grid.hide_labels ();
window.headerbar.toolset.hide_labels ();
+ window.headerbar.zoom.hide_labels ();
window.headerbar.preferences.hide_labels ();
+ window.headerbar.export.hide_labels ();
+ window.headerbar.group.hide_labels ();
+ window.headerbar.ungroup.hide_labels ();
+ window.headerbar.move_up.hide_labels ();
+ window.headerbar.move_down.hide_labels ();
+ window.headerbar.move_top.hide_labels ();
+ window.headerbar.move_bottom.hide_labels ();
+ window.headerbar.path_difference.hide_labels ();
+ window.headerbar.path_exclusion.hide_labels ();
+ window.headerbar.path_intersect.hide_labels ();
+ window.headerbar.path_union.hide_labels ();
window.headerbar.toggle ();
}
@@ -154,19 +193,35 @@ public class Akira.Services.ActionManager : Object {
private void action_show_ui_grid () {
warning ("show UI grid");
}
-
+
private void action_preferences () {
if (window.settings_dialog == null) {
window.settings_dialog = new Akira.Widgets.SettingsDialog (window);
window.settings_dialog.show_all ();
-
+
window.settings_dialog.destroy.connect (() => {
window.settings_dialog = null;
});
}
-
+
window.settings_dialog.present ();
}
+
+ private void action_export () {
+ warning ("export");
+ }
+
+ private void action_zoom_in () {
+ window.headerbar.zoom.zoom_in ();
+ }
+
+ private void action_zoom_out () {
+ window.headerbar.zoom.zoom_out ();
+ }
+
+ private void action_zoom_reset () {
+ window.headerbar.zoom.zoom_reset ();
+ }
public static void action_from_group (string action_name, ActionGroup? action_group) {
action_group.activate_action (action_name, null);
diff --git a/src/Services/Settings.vala b/src/Services/Settings.vala
index ab2040dff..8c1db3a05 100644
--- a/src/Services/Settings.vala
+++ b/src/Services/Settings.vala
@@ -1,23 +1,24 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
+
public class Akira.Services.Settings : Granite.Services.Settings {
public int pos_x { get; set; }
public int pos_y { get; set; }
@@ -28,7 +29,6 @@ public class Akira.Services.Settings : Granite.Services.Settings {
public bool dark_theme { get; set; }
public bool show_label { get; set; }
public bool use_symbolic { get; set; }
- public string icon_style { get; set; }
public bool open_quick { get; set; }
public Settings () {
diff --git a/src/Utils/Dialogs.vala b/src/Utils/Dialogs.vala
index 12d5fade2..5ae1f7ff0 100644
--- a/src/Utils/Dialogs.vala
+++ b/src/Utils/Dialogs.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
diff --git a/src/Widgets/SettingsDialog.vala b/src/Widgets/SettingsDialog.vala
index 736c8cee7..5da58dfb3 100644
--- a/src/Widgets/SettingsDialog.vala
+++ b/src/Widgets/SettingsDialog.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
@@ -25,8 +25,7 @@ public class Akira.Widgets.SettingsDialog : Gtk.Dialog {
private Gtk.Stack main_stack;
private Gtk.Switch dark_theme_switch;
private Gtk.Switch label_switch;
- private Gee.HashMap icon_types;
- private Gtk.ComboBox icon_combo_box;
+ private Gtk.Switch symbolic_switch;
enum Column {
ICONTYPE
@@ -114,43 +113,11 @@ public class Akira.Widgets.SettingsDialog : Gtk.Dialog {
}
});
- content_grid.attach (new SettingsLabel (_("Select Icon Style:")), 0, 4, 1, 1);
-
- icon_types = new Gee.HashMap ();
- icon_types.set (0, "filled");
- icon_types.set (1, "lineart");
- icon_types.set (2, "symbolic");
-
- var list_store = new Gtk.ListStore (1, typeof (string));
-
- for (int i = 0; i < icon_types.size; i++){
- Gtk.TreeIter iter;
- list_store.append (out iter);
- list_store.set (iter, Column.ICONTYPE, icon_types[i]);
- }
-
- icon_combo_box = new Gtk.ComboBox.with_model (list_store);
- var cell = new Gtk.CellRendererText ();
- icon_combo_box.pack_start (cell, false);
-
- icon_combo_box.set_attributes (cell, "text", Column.ICONTYPE);
- icon_combo_box.set_active (0);
-
- foreach (var entry in icon_types.entries) {
- if (entry.value == settings.icon_style) {
- icon_combo_box.set_active (entry.key);
- }
- }
-
- // icons_combo_box = new Gtk.ComboBoxText ();
- // icons_combo_box.append_text ("filled");
- // icons_combo_box.append_text ("lineart");
- // icons_combo_box.append_text ("symbolic");
- // icons_combo_box.active_id = settings.icon_style;
- content_grid.attach (icon_combo_box, 1, 4, 1, 1);
+ content_grid.attach (new SettingsLabel (_("Use Symbolic Icons:")), 0, 4, 1, 1);
+ symbolic_switch = new SettingsSwitch ("use-symbolic");
+ content_grid.attach (symbolic_switch, 1, 4, 1, 1);
- icon_combo_box.changed.connect (() => {
- settings.icon_style = icon_types[icon_combo_box.get_active ()];
+ symbolic_switch.notify["active"].connect (() => {
window.action_manager.update_icons_style ();
});
diff --git a/src/Window.vala b/src/Window.vala
index 5a6de5c1f..417a017d3 100644
--- a/src/Window.vala
+++ b/src/Window.vala
@@ -1,20 +1,20 @@
/*
-* Copyright (c) 2018 Alecaddd (http://alecaddd.com)
+* Copyright (c) 2019 Alecaddd (http://alecaddd.com)
*
-* 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 2 of the License, or (at your option) any later version.
+* This file is part of Akira.
*
-* This program is distributed in the hope that it will be useful,
+* Akira 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.
+
+* Akira 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, write to the
-* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-* Boston, MA 02110-1301 USA
+* 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 Akira. If not, see .
*
* Authored by: Alessandro "Alecaddd" Castellani
*/
diff --git a/src/meson.build b/src/meson.build
index 6aa85af72..525b8503c 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -40,6 +40,7 @@ executable(
'Partials/HeaderBarButton.vala',
'Partials/MenuButton.vala',
+ 'Partials/ZoomButton.vala',
'Widgets/SettingsDialog.vala',
@@ -58,6 +59,7 @@ executable(
dependency('gtksourceview-3.0'),
dependency('cairo', version: '>=1.14'),
dependency('goocanvas-2.0'),
+ m_dep
],
install: true
)
diff --git a/src/vapi/goocanvas-2.0.vapi b/src/vapi/goocanvas-2.0.vapi
index e7e414916..957e49f96 100644
--- a/src/vapi/goocanvas-2.0.vapi
+++ b/src/vapi/goocanvas-2.0.vapi
@@ -1,49 +1,39 @@
-/* goocanvas.vapi generated by vapigen, do not modify. */
+/* goocanvas-2.0.vapi generated by vapigen, do not modify. */
+
[CCode (cprefix = "Goo", gir_namespace = "GooCanvas", gir_version = "2.0", lower_case_cprefix = "goo_")]
namespace Goo {
- [CCode (cheader_filename = "goocanvas.h", copy_function = "goo_cairo_matrix_copy", type_id = "GOO_TYPE_CAIRO_MATRIX")]
- [Compact]
- public class CairoMatrix {
- public double x0;
- public double xx;
- public double xy;
- public double y0;
- public double yx;
- public double yy;
- public static Cairo.Matrix copy (Cairo.Matrix matrix);
- }
- [CCode (cheader_filename = "goocanvas.h", type_id = "goo_cairo_pattern_get_type ()")]
- [Compact]
- public class CairoPattern {
- }
- [CCode (cheader_filename = "goocanvas.h")]
- public class Canvas : Gtk.Container, Atk.Implementor, Gtk.Buildable {
- [CCode (has_construct_function = false)]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_get_type ()")]
+ public class Canvas : Gtk.Container, Atk.Implementor, Gtk.Buildable, Gtk.Scrollable {
+ [CCode (has_construct_function = false, type = "GtkWidget*")]
public Canvas ();
public void convert_bounds_to_item_space (Goo.CanvasItem item, ref Goo.CanvasBounds bounds);
public void convert_from_item_space (Goo.CanvasItem item, ref double x, ref double y);
public void convert_from_pixels (ref double x, ref double y);
public void convert_to_item_space (Goo.CanvasItem item, ref double x, ref double y);
public void convert_to_pixels (ref double x, ref double y);
- public unowned Cairo.Context create_cairo_context ();
- public virtual unowned Goo.CanvasItem create_item (Goo.CanvasItemModel model);
+ [Version (since = "2.0.1")]
+ public void convert_units_from_pixels (ref double x, ref double y);
+ [Version (since = "2.0.1")]
+ public void convert_units_to_pixels (ref double x, ref double y);
+ public Cairo.Context create_cairo_context ();
+ public virtual Goo.CanvasItem create_item (Goo.CanvasItemModel model);
public static void create_path (GLib.Array commands, Cairo.Context cr);
- public void get_bounds (out unowned double? left, out unowned double? top, out unowned double? right, out unowned double? bottom);
+ public void get_bounds (out double left, out double top, out double right, out double bottom);
public double get_default_line_width ();
- public unowned Goo.CanvasItem? get_item (Goo.CanvasItemModel model);
- public unowned Goo.CanvasItem? get_item_at (double x, double y, bool is_pointer_event);
- public GLib.List? get_items_at (double x, double y, bool is_pointer_event);
- public GLib.List? get_items_in_area (Goo.CanvasBounds area, bool inside_area, bool allow_overlaps, bool include_containers);
- public unowned Goo.CanvasItem? get_root_item ();
- public unowned Goo.CanvasItemModel? get_root_item_model ();
+ public unowned Goo.CanvasItem get_item (Goo.CanvasItemModel model);
+ public unowned Goo.CanvasItem get_item_at (double x, double y, bool is_pointer_event);
+ public GLib.List get_items_at (double x, double y, bool is_pointer_event);
+ public GLib.List get_items_in_area (Goo.CanvasBounds area, bool inside_area, bool allow_overlaps, bool include_containers);
+ public unowned Goo.CanvasItem get_root_item ();
+ public unowned Goo.CanvasItemModel get_root_item_model ();
public double get_scale ();
- public unowned Goo.CanvasItem? get_static_root_item ();
- public unowned Goo.CanvasItemModel? get_static_root_item_model ();
+ public unowned Goo.CanvasItem get_static_root_item ();
+ public unowned Goo.CanvasItemModel get_static_root_item_model ();
public void grab_focus (Goo.CanvasItem item);
public Gdk.GrabStatus keyboard_grab (Goo.CanvasItem item, bool owner_events, uint32 time);
public void keyboard_ungrab (Goo.CanvasItem item, uint32 time);
public static GLib.Array parse_path_data (string path_data);
- public Gdk.GrabStatus pointer_grab (Goo.CanvasItem item, Gdk.EventMask event_mask, Gdk.Cursor? cursor, uint32 time);
+ public Gdk.GrabStatus pointer_grab (Goo.CanvasItem item, Gdk.EventMask event_mask, Gdk.Cursor cursor, uint32 time);
public void pointer_ungrab (Goo.CanvasItem item, uint32 time);
public void register_widget_item (Goo.CanvasWidget witem);
public void render (Cairo.Context cr, Goo.CanvasBounds? bounds, double scale);
@@ -67,6 +57,9 @@ namespace Goo {
[NoAccessorMethod]
public string background_color { set; }
[NoAccessorMethod]
+ [Version (since = "2.0.1")]
+ public Gdk.RGBA background_color_gdk_rgba { set; }
+ [NoAccessorMethod]
public uint background_color_rgb { set; }
[NoAccessorMethod]
public bool bounds_from_origin { get; set; }
@@ -98,14 +91,17 @@ namespace Goo {
[NoAccessorMethod]
public double y2 { get; set; }
public virtual signal void item_created (Goo.CanvasItem item, Goo.CanvasItemModel model);
- public virtual signal void set_scroll_adjustments (Gtk.Adjustment hadjustment, Gtk.Adjustment vadjustment);
}
- [CCode (cheader_filename = "goocanvas.h")]
- public class CanvasEllipse : Goo.CanvasItemSimple, Goo.CanvasItem {
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_accessible_factory_get_type ()")]
+ public class CanvasAccessibleFactory : Atk.ObjectFactory {
[CCode (has_construct_function = false)]
- protected CanvasEllipse ();
- [CCode (cname = "goo_canvas_ellipse_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasEllipse create (Goo.CanvasItem? parent, double center_x, double center_y, double radius_x, double radius_y, ...);
+ protected CanvasAccessibleFactory ();
+ }
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_ellipse_get_type ()")]
+ public class CanvasEllipse : Goo.CanvasItemSimple, Goo.CanvasItem {
+ public Goo.CanvasEllipseData ellipse_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasEllipse (Goo.CanvasItem? parent, double center_x, double center_y, double radius_x, double radius_y, ...);
[NoAccessorMethod]
public double center_x { get; set; }
[NoAccessorMethod]
@@ -123,12 +119,11 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_ellipse_model_get_type ()")]
public class CanvasEllipseModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasEllipseModel ();
- [CCode (cname = "goo_canvas_ellipse_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasEllipseModel create (Goo.CanvasItemModel? parent, double center_x, double center_y, double radius_x, double radius_y, ...);
+ public Goo.CanvasEllipseData ellipse_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasEllipseModel (Goo.CanvasItemModel? parent, double center_x, double center_y, double radius_x, double radius_y, ...);
[NoAccessorMethod]
public double center_x { get; set; }
[NoAccessorMethod]
@@ -146,18 +141,20 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_grid_get_type ()")]
public class CanvasGrid : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasGrid ();
- [CCode (cname = "goo_canvas_grid_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasGrid create (Goo.CanvasItem? parent, double x, double y, double width, double height, double x_step, double y_step, double x_offset, double y_offset, ...);
+ public Goo.CanvasGridData grid_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasGrid (Goo.CanvasItem? parent, double x, double y, double width, double height, double x_step, double y_step, double x_offset, double y_offset, ...);
[NoAccessorMethod]
public string border_color { set; }
[NoAccessorMethod]
+ [Version (since = "2.0.1")]
+ public Gdk.RGBA border_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint border_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern border_pattern { owned get; set; }
+ public Cairo.Pattern? border_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf border_pixbuf { set; }
[NoAccessorMethod]
@@ -167,9 +164,12 @@ namespace Goo {
[NoAccessorMethod]
public string horz_grid_line_color { set; }
[NoAccessorMethod]
+ [Version (since = "2.0.1")]
+ public Gdk.RGBA horz_grid_line_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint horz_grid_line_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern horz_grid_line_pattern { owned get; set; }
+ public Cairo.Pattern? horz_grid_line_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf horz_grid_line_pixbuf { set; }
[NoAccessorMethod]
@@ -181,9 +181,12 @@ namespace Goo {
[NoAccessorMethod]
public string vert_grid_line_color { set; }
[NoAccessorMethod]
+ [Version (since = "2.0.1")]
+ public Gdk.RGBA vert_grid_line_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint vert_grid_line_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern vert_grid_line_pattern { owned get; set; }
+ public Cairo.Pattern? vert_grid_line_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf vert_grid_line_pixbuf { set; }
[NoAccessorMethod]
@@ -205,18 +208,19 @@ namespace Goo {
[NoAccessorMethod]
public double y_step { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_grid_model_get_type ()")]
public class CanvasGridModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasGridModel ();
- [CCode (cname = "goo_canvas_grid_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasGridModel create (Goo.CanvasItemModel? parent, double x, double y, double width, double height, double x_step, double y_step, double x_offset, double y_offset, ...);
+ public Goo.CanvasGridData grid_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasGridModel (Goo.CanvasItemModel? parent, double x, double y, double width, double height, double x_step, double y_step, double x_offset, double y_offset, ...);
[NoAccessorMethod]
public string border_color { set; }
[NoAccessorMethod]
+ public Gdk.RGBA border_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint border_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern border_pattern { owned get; set; }
+ public Cairo.Pattern? border_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf border_pixbuf { set; }
[NoAccessorMethod]
@@ -226,9 +230,11 @@ namespace Goo {
[NoAccessorMethod]
public string horz_grid_line_color { set; }
[NoAccessorMethod]
+ public Gdk.RGBA horz_grid_line_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint horz_grid_line_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern horz_grid_line_pattern { owned get; set; }
+ public Cairo.Pattern? horz_grid_line_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf horz_grid_line_pixbuf { set; }
[NoAccessorMethod]
@@ -240,9 +246,11 @@ namespace Goo {
[NoAccessorMethod]
public string vert_grid_line_color { set; }
[NoAccessorMethod]
+ public Gdk.RGBA vert_grid_line_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint vert_grid_line_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern vert_grid_line_pattern { owned get; set; }
+ public Cairo.Pattern? vert_grid_line_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf vert_grid_line_pixbuf { set; }
[NoAccessorMethod]
@@ -264,12 +272,11 @@ namespace Goo {
[NoAccessorMethod]
public double y_step { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_group_get_type ()")]
public class CanvasGroup : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasGroup ();
- [CCode (cname = "goo_canvas_group_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasGroup create (Goo.CanvasItem? parent, ...);
+ public weak GLib.GenericArray items;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasGroup (Goo.CanvasItem? parent, ...);
[NoAccessorMethod]
public double height { get; set; }
[NoAccessorMethod]
@@ -279,12 +286,11 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_group_model_get_type ()")]
public class CanvasGroupModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasGroupModel ();
- [CCode (cname = "goo_canvas_group_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasGroupModel create (Goo.CanvasItemModel? parent, ...);
+ public weak GLib.GenericArray children;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasGroupModel (Goo.CanvasItemModel? parent, ...);
[NoAccessorMethod]
public double height { get; set; }
[NoAccessorMethod]
@@ -294,16 +300,17 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_image_get_type ()")]
public class CanvasImage : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasImage ();
- [CCode (cname = "goo_canvas_image_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasImage create (Goo.CanvasItem? parent, Gdk.Pixbuf pixbuf, double x, double y, ...);
+ public Goo.CanvasImageData image_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasImage (Goo.CanvasItem? parent, Gdk.Pixbuf? pixbuf, double x, double y, ...);
+ [NoAccessorMethod]
+ public double alpha { get; set; }
[NoAccessorMethod]
public double height { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern pattern { owned get; set; }
+ public Cairo.Pattern? pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf pixbuf { set; }
[NoAccessorMethod]
@@ -315,16 +322,17 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_image_model_get_type ()")]
public class CanvasImageModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasImageModel ();
- [CCode (cname = "goo_canvas_image_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasImageModel create (Goo.CanvasItemModel? parent, Gdk.Pixbuf pixbuf, double x, double y, ...);
+ public Goo.CanvasImageData image_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasImageModel (Goo.CanvasItemModel? parent, Gdk.Pixbuf? pixbuf, double x, double y, ...);
+ [NoAccessorMethod]
+ public double alpha { get; set; }
[NoAccessorMethod]
public double height { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern pattern { owned get; set; }
+ public Cairo.Pattern? pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf pixbuf { set; }
[NoAccessorMethod]
@@ -336,10 +344,17 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_item_accessible_factory_get_type ()")]
+ public class CanvasItemAccessibleFactory : Atk.ObjectFactory {
+ [CCode (has_construct_function = false)]
+ protected CanvasItemAccessibleFactory ();
+ }
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_item_model_simple_get_type ()")]
public class CanvasItemModelSimple : GLib.Object, Goo.CanvasItemModel {
+ public weak string description;
public weak Goo.CanvasItemModel parent;
public Goo.CanvasItemSimpleData simple_data;
+ public weak string title;
[CCode (has_construct_function = false)]
protected CanvasItemModelSimple ();
[NoAccessorMethod]
@@ -351,9 +366,11 @@ namespace Goo {
[NoAccessorMethod]
public string fill_color { set; }
[NoAccessorMethod]
+ public Gdk.RGBA fill_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint fill_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern fill_pattern { owned get; set; }
+ public Cairo.Pattern? fill_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf fill_pixbuf { set; }
[NoAccessorMethod]
@@ -379,13 +396,15 @@ namespace Goo {
[NoAccessorMethod]
public string stroke_color { set; }
[NoAccessorMethod]
+ public Gdk.RGBA stroke_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint stroke_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern stroke_pattern { owned get; set; }
+ public Cairo.Pattern? stroke_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf stroke_pixbuf { set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_item_simple_get_type ()")]
public class CanvasItemSimple : GLib.Object, Goo.CanvasItem {
public Goo.CanvasBounds bounds;
public weak Goo.Canvas canvas;
@@ -421,9 +440,12 @@ namespace Goo {
[NoAccessorMethod]
public string fill_color { set; }
[NoAccessorMethod]
+ [Version (since = "2.0.1")]
+ public Gdk.RGBA fill_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint fill_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern fill_pattern { owned get; set; }
+ public Cairo.Pattern? fill_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf fill_pixbuf { set; }
[NoAccessorMethod]
@@ -449,35 +471,37 @@ namespace Goo {
[NoAccessorMethod]
public string stroke_color { set; }
[NoAccessorMethod]
+ [Version (since = "2.0.1")]
+ public Gdk.RGBA stroke_color_gdk_rgba { get; set; }
+ [NoAccessorMethod]
public uint stroke_color_rgba { get; set; }
[NoAccessorMethod]
- public Goo.CairoPattern stroke_pattern { owned get; set; }
+ public Cairo.Pattern? stroke_pattern { owned get; set; }
[NoAccessorMethod]
public Gdk.Pixbuf stroke_pixbuf { set; }
- [NoAccessorMethod]
- public virtual double x { get; set; }
- [NoAccessorMethod]
- public virtual double y { get ; set; }
-
}
- [CCode (cheader_filename = "goocanvas.h", ref_function = "goo_canvas_line_dash_ref", type_id = "GOO_TYPE_CANVAS_LINE_DASH", unref_function = "goo_canvas_line_dash_unref")]
+ [CCode (cheader_filename = "goocanvas.h", ref_function = "goo_canvas_line_dash_ref", type_id = "goo_canvas_line_dash_get_type ()", unref_function = "goo_canvas_line_dash_unref")]
[Compact]
public class CanvasLineDash {
public double dash_offset;
- public double* dashes;
+ [CCode (array_length_cname = "num_dashes")]
+ public double[] dashes;
public int num_dashes;
public int ref_count;
[CCode (has_construct_function = false)]
- public CanvasLineDash (int num_dashes);
- [CCode (has_construct_function = false)]
- public CanvasLineDash.newv (int num_dashes, double* dashes);
+ public CanvasLineDash (int num_dashes, ...);
+ [CCode (cname = "goo_canvas_line_dash_newv", has_construct_function = false)]
+ public CanvasLineDash.newv ([CCode (array_length_cname = "num_dashes", array_length_pos = 0.5)] owned double[] dashes);
+ public Goo.CanvasLineDash @ref ();
+ [Version (since = "2.0.2")]
+ public void set_offset (double dash_offset);
+ public void unref ();
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_path_get_type ()")]
public class CanvasPath : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasPath ();
- [CCode (cname = "goo_canvas_path_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasPath create (Goo.CanvasItem? parent, string path_data, ...);
+ public Goo.CanvasPathData path_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasPath (Goo.CanvasItem? parent, string path_data, ...);
[NoAccessorMethod]
public string data { set; }
[NoAccessorMethod]
@@ -489,12 +513,11 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_path_model_get_type ()")]
public class CanvasPathModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasPathModel ();
- [CCode (cname = "goo_canvas_path_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasPathModel create (Goo.CanvasItemModel? parent, string path_data, ...);
+ public Goo.CanvasPathData path_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasPathModel (Goo.CanvasItemModel? parent, string path_data, ...);
[NoAccessorMethod]
public string data { set; }
[NoAccessorMethod]
@@ -506,23 +529,29 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h", ref_function = "goo_canvas_points_ref", type_id = "GOO_TYPE_CANVAS_POINTS", unref_function = "goo_canvas_points_unref")]
+ [CCode (cheader_filename = "goocanvas.h", ref_function = "goo_canvas_points_ref", type_id = "goo_canvas_points_get_type ()", unref_function = "goo_canvas_points_unref")]
[Compact]
public class CanvasPoints {
- public double* coords;
+ [CCode (array_length_cname = "num_points")]
+ public double[] coords;
public int num_points;
public int ref_count;
[CCode (has_construct_function = false)]
public CanvasPoints (int num_points);
+ [Version (since = "2.0.1")]
+ public void get_point (int idx, out double x, out double y);
+ public Goo.CanvasPoints @ref ();
+ [Version (since = "2.0.1")]
+ public void set_point (int idx, double x, double y);
+ public void unref ();
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_polyline_get_type ()")]
public class CanvasPolyline : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasPolyline ();
- [CCode (cname = "goo_canvas_polyline_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasPolyline create (Goo.CanvasItem? parent, bool close_path, int num_points, ...);
- [CCode (cname = "goo_canvas_polyline_new_line", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasPolyline create_line (Goo.CanvasItem? parent, double x1, double y1, double x2, double y2, ...);
+ public Goo.CanvasPolylineData polyline_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasPolyline (Goo.CanvasItem? parent, bool close_path, int num_points, ...);
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasPolyline.line (Goo.CanvasItem? parent, double x1, double y1, double x2, double y2, ...);
[NoAccessorMethod]
public double arrow_length { get; set; }
[NoAccessorMethod]
@@ -546,29 +575,13 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
- [Compact]
- public class CanvasPolylineArrowData {
- public double arrow_length;
- public double arrow_tip_length;
- public double arrow_width;
- [CCode (array_length = false)]
- public weak double[] end_arrow_coords;
- [CCode (array_length = false)]
- public weak double[] line_end;
- [CCode (array_length = false)]
- public weak double[] line_start;
- [CCode (array_length = false)]
- public weak double[] start_arrow_coords;
- }
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_polyline_model_get_type ()")]
public class CanvasPolylineModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasPolylineModel ();
- [CCode (cname = "goo_canvas_polyline_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasPolylineModel create (Goo.CanvasItemModel? parent, bool close_path, int num_points, ...);
- [CCode (cname = "goo_canvas_polyline_model_new_line", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasPolylineModel create_line (Goo.CanvasItemModel? parent, double x1, double y1, double x2, double y2, ...);
+ public Goo.CanvasPolylineData polyline_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasPolylineModel (Goo.CanvasItemModel? parent, bool close_path, int num_points, ...);
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasPolylineModel.line (Goo.CanvasItemModel? parent, double x1, double y1, double x2, double y2, ...);
[NoAccessorMethod]
public double arrow_length { get; set; }
[NoAccessorMethod]
@@ -592,12 +605,11 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_rect_get_type ()")]
public class CanvasRect : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasRect ();
- [CCode (cname = "goo_canvas_rect_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasRect create (Goo.CanvasItem? parent, double x, double y, double width, double height, ...);
+ public Goo.CanvasRectData rect_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasRect (Goo.CanvasItem? parent, double x, double y, double width, double height, ...);
[NoAccessorMethod]
public double height { get; set; }
[NoAccessorMethod]
@@ -611,12 +623,11 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_rect_model_get_type ()")]
public class CanvasRectModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasRectModel ();
- [CCode (cname = "goo_canvas_rect_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasRectModel create (Goo.CanvasItemModel? parent, double x, double y, double width, double height, ...);
+ public Goo.CanvasRectData rect_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasRectModel (Goo.CanvasItemModel? parent, double x, double y, double width, double height, ...);
[NoAccessorMethod]
public double height { get; set; }
[NoAccessorMethod]
@@ -630,26 +641,25 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_style_get_type ()")]
public class CanvasStyle : GLib.Object {
- public weak Goo.CanvasStyle? parent;
- public weak GLib.Array properties;
+ public weak Goo.CanvasStyle parent;
+ public weak GLib.Array properties;
[CCode (has_construct_function = false)]
public CanvasStyle ();
public Goo.CanvasStyle copy ();
- public unowned Goo.CanvasStyle? get_parent ();
- public unowned GLib.Value? get_property (GLib.Quark property_id);
+ public unowned Goo.CanvasStyle get_parent ();
+ public GLib.Value? get_property (GLib.Quark property_id);
public bool set_fill_options (Cairo.Context cr);
- public void set_parent (Goo.CanvasStyle? parent);
+ public void set_parent (Goo.CanvasStyle parent);
public void set_property (GLib.Quark property_id, GLib.Value value);
public bool set_stroke_options (Cairo.Context cr);
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_table_get_type ()")]
public class CanvasTable : Goo.CanvasGroup, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasTable ();
- [CCode (cname = "goo_canvas_table_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasTable create (Goo.CanvasItem? parent, ...);
+ public Goo.CanvasTableData table_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasTable (Goo.CanvasItem? parent, ...);
[NoAccessorMethod]
public double column_spacing { get; set; }
[NoAccessorMethod]
@@ -667,12 +677,15 @@ namespace Goo {
[NoAccessorMethod]
public double y_border_spacing { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ [Compact]
+ public class CanvasTableLayoutData {
+ }
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_table_model_get_type ()")]
public class CanvasTableModel : Goo.CanvasGroupModel, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasTableModel ();
- [CCode (cname = "goo_canvas_table_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasTableModel create (Goo.CanvasItemModel? parent, ...);
+ public Goo.CanvasTableData table_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasTableModel (Goo.CanvasItemModel? parent, ...);
[NoAccessorMethod]
public double column_spacing { get; set; }
[NoAccessorMethod]
@@ -690,13 +703,13 @@ namespace Goo {
[NoAccessorMethod]
public double y_border_spacing { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_text_get_type ()")]
public class CanvasText : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasText ();
- [CCode (cname = "goo_canvas_text_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasText create (Goo.CanvasItem? parent, string str, double x, double y, double width, Goo.CanvasAnchorType anchor, ...);
- public void get_natural_extents (out unowned Pango.Rectangle? ink_rect, out unowned Pango.Rectangle? logical_rect);
+ public double layout_width;
+ public Goo.CanvasTextData text_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasText (Goo.CanvasItem? parent, string string, double x, double y, double width, Goo.CanvasAnchorType anchor, ...);
+ public void get_natural_extents (out Pango.Rectangle ink_rect, out Pango.Rectangle logical_rect);
[NoAccessorMethod]
public Pango.Alignment alignment { get; set; }
[NoAccessorMethod]
@@ -718,12 +731,11 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_text_model_get_type ()")]
public class CanvasTextModel : Goo.CanvasItemModelSimple, Goo.CanvasItemModel {
- [CCode (has_construct_function = false)]
- protected CanvasTextModel ();
- [CCode (cname = "goo_canvas_text_model_new", type = "GooCanvasItemModel*")]
- public static unowned Goo.CanvasTextModel create (Goo.CanvasItemModel? parent, string str, double x, double y, double width, Goo.CanvasAnchorType anchor, ...);
+ public Goo.CanvasTextData text_data;
+ [CCode (has_construct_function = false, type = "GooCanvasItemModel*")]
+ public CanvasTextModel (Goo.CanvasItemModel? parent, string string, double x, double y, double width, Goo.CanvasAnchorType anchor, ...);
[NoAccessorMethod]
public Pango.Alignment alignment { get; set; }
[NoAccessorMethod]
@@ -745,12 +757,10 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_widget_get_type ()")]
public class CanvasWidget : Goo.CanvasItemSimple, Goo.CanvasItem {
- [CCode (has_construct_function = false)]
- protected CanvasWidget ();
- [CCode (cname = "goo_canvas_widget_new", type = "GooCanvasItem*")]
- public static unowned Goo.CanvasWidget create (Goo.CanvasItem? parent, Gtk.Widget widget, double x, double y, double width, double height, ...);
+ [CCode (has_construct_function = false, type = "GooCanvasItem*")]
+ public CanvasWidget (Goo.CanvasItem? parent, Gtk.Widget widget, double x, double y, double width, double height, ...);
[NoAccessorMethod]
public Goo.CanvasAnchorType anchor { get; set; }
[NoAccessorMethod]
@@ -764,27 +774,37 @@ namespace Goo {
[NoAccessorMethod]
public double y { get; set; }
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_widget_accessible_factory_get_type ()")]
+ public class CanvasWidgetAccessibleFactory : Atk.ObjectFactory {
+ [CCode (has_construct_function = false)]
+ protected CanvasWidgetAccessibleFactory ();
+ }
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_item_get_type ()")]
public interface CanvasItem : GLib.Object {
public abstract void add_child (Goo.CanvasItem child, int position);
public abstract void allocate_area (Cairo.Context cr, Goo.CanvasBounds requested_area, Goo.CanvasBounds allocated_area, double x_offset, double y_offset);
public void animate (double x, double y, double scale, double degrees, bool absolute, int duration, int step_time, Goo.CanvasAnimateType type);
- public static unowned GLib.ParamSpec? class_find_child_property (GLib.ObjectClass iclass, string property_name);
+ public static unowned GLib.ParamSpec class_find_child_property (GLib.ObjectClass iclass, string property_name);
public static void class_install_child_property (GLib.ObjectClass iclass, uint property_id, GLib.ParamSpec pspec);
- public static GLib.ParamSpec[] class_list_child_properties (GLib.ObjectClass iclass, out uint n_properties);
+ [CCode (array_length_pos = 1.1, array_length_type = "guint")]
+ public static (unowned GLib.ParamSpec)[] class_list_child_properties (GLib.ObjectClass iclass);
public void ensure_updated ();
public int find_child (Goo.CanvasItem child);
public abstract void get_bounds (out Goo.CanvasBounds bounds);
public abstract unowned Goo.Canvas get_canvas ();
- public abstract unowned Goo.CanvasItem? get_child (int child_num);
+ public abstract unowned Goo.CanvasItem get_child (int child_num);
public void get_child_properties (Goo.CanvasItem child, ...);
- public abstract void get_child_property (Goo.CanvasItem child, string property_name, out GLib.Value value);
+ public void get_child_properties_valist (Goo.CanvasItem child, va_list var_args);
+ [NoWrapper]
+ public abstract void get_child_property (Goo.CanvasItem child, uint property_id, GLib.Value value, GLib.ParamSpec pspec);
public abstract bool get_is_static ();
public abstract unowned GLib.List get_items_at (double x, double y, Cairo.Context cr, bool is_pointer_event, bool parent_is_visible, GLib.List found_items);
- public abstract unowned Goo.CanvasItemModel? get_model ();
+ public abstract unowned Goo.CanvasItemModel get_model ();
public abstract int get_n_children ();
- public abstract unowned Goo.CanvasItem? get_parent ();
- public abstract bool get_requested_area (Cairo.Context cr, out Goo.CanvasBounds requested_area);
+ public abstract unowned Goo.CanvasItem get_parent ();
+ public abstract bool get_requested_area (Cairo.Context cr, Goo.CanvasBounds requested_area);
+ [Version (since = "2.0.1")]
+ public abstract bool get_requested_area_for_width (Cairo.Context cr, double width, Goo.CanvasBounds requested_area);
public abstract double get_requested_height (Cairo.Context cr, double width);
public bool get_simple_transform (out double x, out double y, out double scale, out double rotation);
public abstract unowned Goo.CanvasStyle get_style ();
@@ -803,7 +823,9 @@ namespace Goo {
public void scale (double sx, double sy);
public abstract void set_canvas (Goo.Canvas canvas);
public void set_child_properties (Goo.CanvasItem child, ...);
- public abstract void set_child_property (Goo.CanvasItem child, string property_name, GLib.Value value);
+ public void set_child_properties_valist (Goo.CanvasItem child, va_list var_args);
+ [NoWrapper]
+ public abstract void set_child_property (Goo.CanvasItem child, uint property_id, GLib.Value value, GLib.ParamSpec pspec);
public abstract void set_is_static (bool is_static);
public abstract void set_model (Goo.CanvasItemModel model);
public abstract void set_parent (Goo.CanvasItem parent);
@@ -816,51 +838,55 @@ namespace Goo {
public void translate (double tx, double ty);
public abstract void update (bool entire_tree, Cairo.Context cr, Goo.CanvasBounds bounds);
[NoAccessorMethod]
- public bool can_focus { get; set; }
+ public abstract bool can_focus { get; set; }
+ [NoAccessorMethod]
+ public abstract string description { owned get; set; }
+ public abstract Goo.CanvasItem parent { get; set; }
[NoAccessorMethod]
- public string description { owned get; set; }
- public Goo.CanvasItem parent { get; set; }
+ public abstract Goo.CanvasPointerEvents pointer_events { get; set; }
[NoAccessorMethod]
- public Goo.CanvasPointerEvents pointer_events { get; set; }
+ public abstract string title { owned get; set; }
[NoAccessorMethod]
- public string title { owned get; set; }
+ public abstract string tooltip { owned get; set; }
[NoAccessorMethod]
- public string tooltip { owned get; set; }
- public Goo.CairoMatrix transform { get; set; }
+ public abstract Cairo.Matrix? transform { owned get; set; }
[NoAccessorMethod]
- public Goo.CanvasItemVisibility visibility { get; set; }
+ public abstract Goo.CanvasItemVisibility visibility { get; set; }
[NoAccessorMethod]
- public double visibility_threshold { get; set; }
- public signal void animation_finished (bool stopped);
- public signal bool button_press_event (Goo.CanvasItem target, Gdk.EventButton event);
- public signal bool button_release_event (Goo.CanvasItem target, Gdk.EventButton event);
- public signal void child_notify (GLib.ParamSpec pspec);
- public signal bool enter_notify_event (Goo.CanvasItem target, Gdk.EventCrossing event);
- public signal bool focus_in_event (Goo.CanvasItem target, Gdk.EventFocus event);
- public signal bool focus_out_event (Goo.CanvasItem target, Gdk.EventFocus event);
- public signal bool grab_broken_event (Goo.CanvasItem target, Gdk.EventGrabBroken event);
- public signal bool key_press_event (Goo.CanvasItem target, Gdk.EventKey event);
- public signal bool key_release_event (Goo.CanvasItem target, Gdk.EventKey event);
- public signal bool leave_notify_event (Goo.CanvasItem target, Gdk.EventCrossing event);
- public signal bool motion_notify_event (Goo.CanvasItem target, Gdk.EventMotion event);
- public signal bool query_tooltip (double x, double y, bool keyboard_tooltip, Gtk.Tooltip tooltip);
- public signal bool scroll_event (Goo.CanvasItem target, Gdk.Event event);
+ public abstract double visibility_threshold { get; set; }
+ public virtual signal void animation_finished (bool stopped);
+ public virtual signal bool button_press_event (Goo.CanvasItem target, Gdk.EventButton event);
+ public virtual signal bool button_release_event (Goo.CanvasItem target, Gdk.EventButton event);
+ public virtual signal void child_notify (GLib.ParamSpec pspec);
+ public virtual signal bool enter_notify_event (Goo.CanvasItem target, Gdk.EventCrossing event);
+ public virtual signal bool focus_in_event (Goo.CanvasItem target, Gdk.EventFocus event);
+ public virtual signal bool focus_out_event (Goo.CanvasItem target, Gdk.EventFocus event);
+ public virtual signal bool grab_broken_event (Goo.CanvasItem target, Gdk.EventGrabBroken event);
+ public virtual signal bool key_press_event (Goo.CanvasItem target, Gdk.EventKey event);
+ public virtual signal bool key_release_event (Goo.CanvasItem target, Gdk.EventKey event);
+ public virtual signal bool leave_notify_event (Goo.CanvasItem target, Gdk.EventCrossing event);
+ public virtual signal bool motion_notify_event (Goo.CanvasItem target, Gdk.EventMotion event);
+ public virtual signal bool query_tooltip (double x, double y, bool keyboard_tooltip, Gtk.Tooltip tooltip);
+ public virtual signal bool scroll_event (Goo.CanvasItem target, Gdk.EventScroll event);
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_item_model_get_type ()")]
public interface CanvasItemModel : GLib.Object {
public abstract void add_child (Goo.CanvasItemModel child, int position);
public void animate (double x, double y, double scale, double degrees, bool absolute, int duration, int step_time, Goo.CanvasAnimateType type);
- public static unowned GLib.ParamSpec? class_find_child_property (GLib.ObjectClass mclass, string property_name);
+ public static unowned GLib.ParamSpec class_find_child_property (GLib.ObjectClass mclass, string property_name);
public static void class_install_child_property (GLib.ObjectClass mclass, uint property_id, GLib.ParamSpec pspec);
- public static GLib.ParamSpec[] class_list_child_properties (GLib.ObjectClass iclass, out uint n_properties);
+ [CCode (array_length_pos = 1.1, array_length_type = "guint")]
+ public static (unowned GLib.ParamSpec)[] class_list_child_properties (GLib.ObjectClass mclass);
[NoWrapper]
public abstract unowned Goo.CanvasItem create_item (Goo.Canvas canvas);
public int find_child (Goo.CanvasItemModel child);
- public abstract unowned Goo.CanvasItemModel? get_child (int child_num);
- public void get_child_properties (Goo.CanvasItem child, ...);
- public abstract void get_child_property (Goo.CanvasItemModel child, string property_name, out GLib.Value value);
+ public abstract unowned Goo.CanvasItemModel get_child (int child_num);
+ public void get_child_properties (Goo.CanvasItemModel child, ...);
+ public void get_child_properties_valist (Goo.CanvasItemModel child, va_list var_args);
+ [NoWrapper]
+ public abstract void get_child_property (Goo.CanvasItemModel child, uint property_id, GLib.Value value, GLib.ParamSpec pspec);
public abstract int get_n_children ();
- public abstract unowned Goo.CanvasItemModel? get_parent ();
+ public abstract unowned Goo.CanvasItemModel get_parent ();
public bool get_simple_transform (out double x, out double y, out double scale, out double rotation);
public abstract unowned Goo.CanvasStyle get_style ();
public abstract bool get_transform (out Cairo.Matrix transform);
@@ -872,8 +898,10 @@ namespace Goo {
public abstract void remove_child (int child_num);
public void rotate (double degrees, double cx, double cy);
public void scale (double sx, double sy);
- public void set_child_properties (Goo.CanvasItem child, ...);
- public abstract void set_child_property (Goo.CanvasItemModel child, string property_name, GLib.Value value);
+ public void set_child_properties (Goo.CanvasItemModel child, ...);
+ public void set_child_properties_valist (Goo.CanvasItemModel child, va_list var_args);
+ [NoWrapper]
+ public abstract void set_child_property (Goo.CanvasItemModel child, uint property_id, GLib.Value value, GLib.ParamSpec pspec);
public abstract void set_parent (Goo.CanvasItemModel parent);
public void set_simple_transform (double x, double y, double scale, double rotation);
public abstract void set_style (Goo.CanvasStyle style);
@@ -883,40 +911,76 @@ namespace Goo {
public void stop_animation ();
public void translate (double tx, double ty);
[NoAccessorMethod]
- public bool can_focus { get; set; }
+ public abstract bool can_focus { get; set; }
+ [NoAccessorMethod]
+ public abstract string description { owned get; set; }
+ public abstract Goo.CanvasItemModel parent { get; set; }
[NoAccessorMethod]
- public string description { owned get; set; }
- public Goo.CanvasItemModel parent { get; set; }
+ public abstract Goo.CanvasPointerEvents pointer_events { get; set; }
[NoAccessorMethod]
- public Goo.CanvasPointerEvents pointer_events { get; set; }
+ public abstract string title { owned get; set; }
[NoAccessorMethod]
- public string title { owned get; set; }
+ public abstract string tooltip { owned get; set; }
[NoAccessorMethod]
- public string tooltip { owned get; set; }
- public Goo.CairoMatrix transform { get; set; }
+ public abstract Cairo.Matrix? transform { owned get; set; }
[NoAccessorMethod]
- public Goo.CanvasItemVisibility visibility { get; set; }
+ public abstract Goo.CanvasItemVisibility visibility { get; set; }
[NoAccessorMethod]
- public double visibility_threshold { get; set; }
- public signal void animation_finished (bool stopped);
- public signal void changed (bool recompute_bounds);
- public signal void child_added (int child_num);
- public signal void child_moved (int old_child_num, int new_child_num);
- public signal void child_notify (GLib.ParamSpec pspec);
- public signal void child_removed (int child_num);
+ public abstract double visibility_threshold { get; set; }
+ public virtual signal void animation_finished (bool stopped);
+ public virtual signal void changed (bool recompute_bounds);
+ public virtual signal void child_added (int child_num);
+ public virtual signal void child_moved (int old_child_num, int new_child_num);
+ public virtual signal void child_notify (GLib.ParamSpec pspec);
+ public virtual signal void child_removed (int child_num);
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", type_id = "goo_canvas_bounds_get_type ()")]
public struct CanvasBounds {
public double x1;
public double y1;
public double x2;
public double y2;
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasEllipseData {
+ public double center_x;
+ public double center_y;
+ public double radius_x;
+ public double radius_y;
+ }
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasGridData {
+ public double x;
+ public double y;
+ public double width;
+ public double height;
+ public double x_step;
+ public double y_step;
+ public double x_offset;
+ public double y_offset;
+ public double horz_grid_line_width;
+ public double vert_grid_line_width;
+ public Cairo.Pattern? horz_grid_line_pattern;
+ public Cairo.Pattern? vert_grid_line_pattern;
+ public double border_width;
+ public Cairo.Pattern? border_pattern;
+ public uint show_horz_grid_lines;
+ public uint show_vert_grid_lines;
+ public uint vert_grid_lines_on_top;
+ }
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasImageData {
+ public Cairo.Pattern? pattern;
+ public double x;
+ public double y;
+ public double width;
+ public double height;
+ }
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
public struct CanvasItemSimpleData {
- public Cairo.Matrix? transform;
- public weak GLib.Array clip_path_commands;
public weak Goo.CanvasStyle style;
+ public Cairo.Matrix? transform;
+ public GLib.Array clip_path_commands;
public weak string tooltip;
public double visibility_threshold;
public uint visibility;
@@ -928,78 +992,153 @@ namespace Goo {
public uint cache_setting;
public uint has_tooltip;
}
- [CCode (cheader_filename = "goocanvas.h", type_id = "GOO_TYPE_CANVAS_PATH_COMMAND")]
+ [CCode (cheader_filename = "goocanvas.h")]
public struct CanvasPathCommand {
- public Goo.CanvasPathCommandSimple simple;
- public Goo.CanvasPathCommandCurve curve;
- public Goo.CanvasPathCommandArc arc;
+ [CCode (cname = "simple.type")]
+ public uint simple_type;
+ [CCode (cname = "simple.relative")]
+ public uint simple_relative;
+ [CCode (cname = "simple.x")]
+ public double simple_x;
+ [CCode (cname = "simple.y")]
+ public double simple_y;
+ [CCode (cname = "curve.type")]
+ public uint curve_type;
+ [CCode (cname = "curve.relative")]
+ public uint curve_relative;
+ [CCode (cname = "curve.x")]
+ public double curve_x;
+ [CCode (cname = "curve.y")]
+ public double curve_y;
+ [CCode (cname = "curve.x1")]
+ public double curve_x1;
+ [CCode (cname = "curve.y1")]
+ public double curve_y1;
+ [CCode (cname = "curve.x2")]
+ public double curve_x2;
+ [CCode (cname = "curve.y2")]
+ public double curve_y2;
+ [CCode (cname = "arc.type")]
+ public uint arc_type;
+ [CCode (cname = "arc.relative")]
+ public uint arc_relative;
+ [CCode (cname = "arc.large_arc_flag")]
+ public uint arc_large_arc_flag;
+ [CCode (cname = "arc.sweep_flag")]
+ public uint arc_sweep_flag;
+ [CCode (cname = "arc.rx")]
+ public double arc_rx;
+ [CCode (cname = "arc.ry")]
+ public double arc_ry;
+ [CCode (cname = "arc.x_axis_rotation")]
+ public double arc_x_axis_rotation;
+ [CCode (cname = "arc.x")]
+ public double arc_x;
+ [CCode (cname = "arc.y")]
+ public double arc_y;
}
- [CCode (cheader_filename = "goocanvas.h")]
- public struct CanvasPathCommandArc {
- public uint type;
- public uint relative;
- public uint large_arc_flag;
- public uint sweep_flag;
- public double rx;
- public double ry;
- public double x_axis_rotation;
- public double x;
- public double y;
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasPathData {
+ public GLib.Array path_commands;
}
- [CCode (cheader_filename = "goocanvas.h")]
- public struct CanvasPathCommandCurve {
- public uint type;
- public uint relative;
- public double x;
- public double y;
- public double x1;
- public double y1;
- public double x2;
- public double y2;
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasPolylineArrowData {
+ public double arrow_width;
+ public double arrow_length;
+ public double arrow_tip_length;
+ [CCode (array_length = false)]
+ public weak double line_start[2];
+ [CCode (array_length = false)]
+ public weak double line_end[2];
+ [CCode (array_length = false)]
+ public weak double start_arrow_coords[10];
+ [CCode (array_length = false)]
+ public weak double end_arrow_coords[10];
}
- [CCode (cheader_filename = "goocanvas.h")]
- public struct CanvasPathCommandSimple {
- public uint type;
- public uint relative;
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasPolylineData {
+ public double coords;
+ public Goo.CanvasPolylineArrowData arrow_data;
+ public uint num_points;
+ public uint close_path;
+ public uint start_arrow;
+ public uint end_arrow;
+ public uint reconfigure_arrows;
+ }
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasRectData {
public double x;
public double y;
+ public double width;
+ public double height;
+ public double radius_x;
+ public double radius_y;
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
public struct CanvasStyleProperty {
public GLib.Quark id;
public GLib.Value value;
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_ANTIALIAS_")]
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasTableData {
+ public double width;
+ public double height;
+ [CCode (array_length = false)]
+ public weak Goo.CanvasTableDimension dimensions[2];
+ public double border_width;
+ public weak GLib.Array children;
+ public weak Goo.CanvasTableLayoutData layout_data;
+ }
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasTableDimension {
+ public int size;
+ public double default_spacing;
+ public double spacings;
+ public uint homogeneous;
+ }
+ [CCode (cheader_filename = "goocanvas.h", has_type_id = false)]
+ public struct CanvasTextData {
+ public weak string text;
+ public double x;
+ public double y;
+ public double width;
+ public uint use_markup;
+ public uint anchor;
+ public uint alignment;
+ public uint ellipsize;
+ public uint wrap;
+ }
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_ANTIALIAS_", type_id = "goo_cairo_antialias_get_type ()")]
public enum CairoAntialias {
DEFAULT,
NONE,
GRAY,
SUBPIXEL
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_FILL_RULE_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_FILL_RULE_", type_id = "goo_cairo_fill_rule_get_type ()")]
public enum CairoFillRule {
WINDING,
EVEN_ODD
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_HINT_METRICS_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_HINT_METRICS_", type_id = "goo_cairo_hint_metrics_get_type ()")]
public enum CairoHintMetrics {
DEFAULT,
OFF,
ON
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_LINE_CAP_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_LINE_CAP_", type_id = "goo_cairo_line_cap_get_type ()")]
public enum CairoLineCap {
BUTT,
ROUND,
SQUARE
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_LINE_JOIN_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_LINE_JOIN_", type_id = "goo_cairo_line_join_get_type ()")]
public enum CairoLineJoin {
MITER,
ROUND,
BEVEL
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_OPERATOR_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "CAIRO_OPERATOR_", type_id = "goo_cairo_operator_get_type ()")]
public enum CairoOperator {
CLEAR,
SOURCE,
@@ -1036,21 +1175,21 @@ namespace Goo {
W,
E
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_ANIMATE_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_ANIMATE_", type_id = "goo_canvas_animate_type_get_type ()")]
public enum CanvasAnimateType {
FREEZE,
RESET,
RESTART,
BOUNCE
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_ITEM_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_ITEM_", type_id = "goo_canvas_item_visibility_get_type ()")]
public enum CanvasItemVisibility {
HIDDEN,
INVISIBLE,
VISIBLE,
VISIBLE_ABOVE_THRESHOLD
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_PATH_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_PATH_", type_id = "goo_canvas_path_command_type_get_type ()")]
public enum CanvasPathCommandType {
MOVE_TO,
CLOSE_PATH,
@@ -1063,7 +1202,7 @@ namespace Goo {
SMOOTH_QUADRATIC_CURVE_TO,
ELLIPTICAL_ARC
}
- [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_EVENTS_")]
+ [CCode (cheader_filename = "goocanvas.h", cprefix = "GOO_CANVAS_EVENTS_", type_id = "goo_canvas_pointer_events_get_type ()")]
[Flags]
public enum CanvasPointerEvents {
VISIBLE_MASK,
@@ -1080,6 +1219,6 @@ namespace Goo {
STROKE,
ALL
}
- [CCode (cheader_filename = "goocanvas.h")]
+ [CCode (cheader_filename = "goocanvas.h", cname = "GOO_CANVAS_POLYLINE_NUM_ARROW_POINTS")]
public const int NUM_ARROW_POINTS;
-}
\ No newline at end of file
+}
diff --git a/vapi/goocanvas-2.0.deps b/vapi/goocanvas-2.0.deps
new file mode 100644
index 000000000..e804358eb
--- /dev/null
+++ b/vapi/goocanvas-2.0.deps
@@ -0,0 +1,7 @@
+atk
+cairo
+pango
+gdk-3.0
+gio-2.0
+gtk+-3.0
+gdk-pixbuf-2.0
\ No newline at end of file