diff --git a/README.md b/README.md
index e77c3a39..ddc096a9 100644
--- a/README.md
+++ b/README.md
@@ -74,11 +74,11 @@ Then follow instructions from above, as if installing package from repos.
**On Ubuntu:**
- sudo apt-get install gnome-common intltool valac libglib2.0-dev gobject-introspection libgirepository1.0-dev libgtk-3-dev libgnome-desktop-3-dev libcanberra-dev libdbus-glib-1-dev libgstreamer1.0-dev fonts-droid libsqlite3-dev libgom-dev
+ sudo apt-get install gnome-common intltool valac libglib2.0-dev gobject-introspection libgirepository1.0-dev libgtk-3-dev libgnome-desktop-3-dev libcanberra-dev libdbus-glib-1-dev libgstreamer1.0-dev fonts-droid
**On Fedora:**
- sudo dnf install gnome-common intltool vala vala-tools glib2-devel gobject-introspection-devel gtk3-devel gnome-desktop3-devel libcanberra-devel dbus-glib-devel gstreamer1-devel google-droid-sans-fonts sqlite-devel gom-devel
+ sudo dnf install gnome-common intltool vala vala-tools glib2-devel gobject-introspection-devel gtk3-devel gnome-desktop3-devel libcanberra-devel dbus-glib-devel gstreamer1-devel google-droid-sans-fonts
3. Build it and install
diff --git a/configure.ac b/configure.ac
index cf3560d9..0a869966 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,6 @@ AC_ARG_ENABLE([more-warnings],
GLIB_REQUIRED=2.36.0
GTK_REQUIRED=3.13.0
GNOME_REQUIRED=3.13.0
-GOM_REQUIRED=0.2
TELEPATHY_GLIB_REQUIRED=0.17.5
PKG_CHECK_MODULES(GNOME_POMODORO, [
@@ -55,8 +54,6 @@ PKG_CHECK_MODULES(GNOME_POMODORO, [
gsettings-desktop-schemas >= $GTK_REQUIRED
gnome-desktop-3.0 >= $GNOME_REQUIRED
dbus-glib-1
- gom-1.0 >= $GOM_REQUIRED
- sqlite3
libcanberra >= 0.30
gstreamer-1.0 >= 1.0.10
telepathy-glib >= $TELEPATHY_GLIB_REQUIRED
@@ -141,7 +138,6 @@ AC_SUBST(WARNING_CFLAGS)
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GTK_REQUIRED)
AC_SUBST(GNOME_REQUIRED)
-AC_SUBST(GOM_REQUIRED)
AC_SUBST(TELEPATHY_GLIB_REQUIRED)
diff --git a/data/gnome-pomodoro.gresource.xml b/data/gnome-pomodoro.gresource.xml
index 28b76b40..237b253a 100644
--- a/data/gnome-pomodoro.gresource.xml
+++ b/data/gnome-pomodoro.gresource.xml
@@ -2,8 +2,6 @@
resources/menu.ui
- resources/bookmark-add-symbolic.svg
- resources/bookmark-symbolic.svg
resources/gtk-style.css
diff --git a/data/resources/bookmark-add-symbolic.svg b/data/resources/bookmark-add-symbolic.svg
deleted file mode 100644
index f00eec0c..00000000
--- a/data/resources/bookmark-add-symbolic.svg
+++ /dev/null
@@ -1,32 +0,0 @@
-
-
-
-
diff --git a/data/resources/bookmark-symbolic.svg b/data/resources/bookmark-symbolic.svg
deleted file mode 100644
index 2f4b77f7..00000000
--- a/data/resources/bookmark-symbolic.svg
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
diff --git a/data/resources/menu.ui b/data/resources/menu.ui
index 6a9529da..69a4b4e4 100644
--- a/data/resources/menu.ui
+++ b/data/resources/menu.ui
@@ -1,12 +1,6 @@
-
-
diff --git a/extension/Makefile.am b/extension/Makefile.am
index e4ad3016..c34e3441 100644
--- a/extension/Makefile.am
+++ b/extension/Makefile.am
@@ -10,7 +10,6 @@ dist_extension_DATA = \
presence.js \
settings.js \
stylesheet.css \
- tasklist.js \
timer.js \
utils.js
diff --git a/extension/dbus.js b/extension/dbus.js
index 5679f4ef..4e7b5f6e 100644
--- a/extension/dbus.js
+++ b/extension/dbus.js
@@ -34,9 +34,6 @@ const PomodoroInterface = ' \
\
\
\
- \
- \
- \
\
\
\
diff --git a/extension/indicator.js b/extension/indicator.js
index 2cac1e88..2c771c33 100644
--- a/extension/indicator.js
+++ b/extension/indicator.js
@@ -42,7 +42,6 @@ const Tweener = imports.ui.tweener;
const DBus = Extension.imports.dbus;
const Config = Extension.imports.config;
const Settings = Extension.imports.settings;
-const Tasklist = Extension.imports.tasklist;
const Timer = Extension.imports.timer;
const Gettext = imports.gettext.domain(Config.GETTEXT_PACKAGE);
@@ -86,23 +85,8 @@ const IndicatorMenu = new Lang.Class({
}));
this.addMenuItem(this._timerToggle);
- /* Task list */
- // this.entry = new Tasklist.TaskEntry();
- // this.entry.connect('task-entered', Lang.bind(this, this._onTaskEntered));
-
- /* TODO: Lock focus on the entry once active */
- /* TODO: Add history manager, just as in runDialog */
- /* TODO: More items could be added to context menu */
-
- // this.tasklist = new Tasklist.TaskList();
- // this.tasklist.connect('task-selected', Lang.bind(this, this._onTaskSelected));
-
this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
- this.addAction(_("Manage Tasks"), Lang.bind(this, this._showMainWindow));
this.addAction(_("Preferences"), Lang.bind(this, this._showPreferences));
- // this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem());
- // this.addMenuItem(this.tasklist);
- // this.addMenuItem(this.entry);
this.connect('destroy', Lang.bind(this,
function() {
@@ -121,27 +105,11 @@ const IndicatorMenu = new Lang.Class({
return this.indicator.timer.getState() != Timer.State.NULL;
},
- _showMainWindow: function() {
- let timestamp = global.get_current_time();
-
- this.indicator.timer.showMainWindow(timestamp);
- },
-
_showPreferences: function() {
let view = 'timer';
let timestamp = global.get_current_time();
this.indicator.timer.showPreferences(view, timestamp);
- },
-
- _onTaskEntered: function(entry, text) {
- this.tasklist.addTask(new Tasklist.Task(text), {
- animate: true
- });
- },
-
- _onTaskSelected: function(tasklist, task) {
- global.log("Selected task: " + (task ? task.name : '-'));
}
});
diff --git a/extension/tasklist.js b/extension/tasklist.js
deleted file mode 100644
index 20af3114..00000000
--- a/extension/tasklist.js
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * Copyright (c) 2014 gnome-pomodoro contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- * Authors: Kamil Prusko
- */
-
-const Lang = imports.lang;
-const Mainloop = imports.mainloop;
-const Signals = imports.signals;
-
-const Clutter = imports.gi.Clutter;
-const Gio = imports.gi.Gio;
-const Gtk = imports.gi.Gtk;
-const GLib = imports.gi.GLib;
-const Meta = imports.gi.Meta;
-const Pango = imports.gi.Pango;
-const Shell = imports.gi.Shell;
-const St = imports.gi.St;
-
-const BoxPointer = imports.ui.boxpointer;
-const GrabHelper = imports.ui.grabHelper;
-const Separator = imports.ui.separator;
-
-const Animation = imports.ui.animation;
-const Extension = imports.misc.extensionUtils.getCurrentExtension();
-const Main = imports.ui.main;
-const MessageTray = imports.ui.messageTray;
-const PanelMenu = imports.ui.panelMenu;
-const Params = imports.misc.params;
-const PopupMenu = imports.ui.popupMenu;
-const ShellEntry = imports.ui.shellEntry;
-const Tweener = imports.ui.tweener;
-
-const DBus = Extension.imports.dbus;
-
-const Gettext = imports.gettext.domain('gnome-pomodoro');
-const _ = Gettext.gettext;
-
-
-const MENU_POPUP_TIMEOUT = 600;
-const SCROLL_ANIMATION_TIME = 0.5;
-
-
-const TaskEntry = new Lang.Class({
- Name: 'PomodoroTaskEntry',
- Extends: PopupMenu.PopupMenuSection,
-
- _init: function() {
- this.parent();
-
- this.actor.add_style_class_name('extension-pomodoro-task-entry-menu-item');
- this.actor._delegate = this;
-
- this.entry = new St.Entry({
- style_class: 'extension-pomodoro-task-entry',
- can_focus: true,
- hint_text: _("Enter new task")
- });
- this.entry.clutter_text.set_max_length(200);
- this.entry.clutter_text.connect('activate', Lang.bind(this, this._onEntryActivated));
-
- ShellEntry.addContextMenu(this.entry);
-
- this.actor.add(this.entry, { expand: true });
-
-// TODO: Grab mouse events
-// this.actor.connect('notify::mapped', Lang.bind(this,
-// function() {
-// if (this.actor.mapped) {
-// this._keyPressEventId =
-// global.stage.connect('key-press-event',
-// Lang.bind(this, this._onKeyPressEvent));
-// } else {
-// if (this._keyPressEventId)
-// global.stage.disconnect(this._keyPressEventId);
-// this._keyPressEventId = 0;
-// }
-// }));
- },
-
- _onEntryActivated: function(entry) {
- let text = entry.get_text();
- if (text != '') {
- this.emit('task-entered', text);
-
- entry.set_text('');
- }
- },
-});
-
-
-const Task = new Lang.Class({
- Name: 'PomodoroTask',
-
- id: 0,
-
- _init: function (name) {
- if (!Task.prototype.id) {
- Task.prototype.id = 0;
- }
-
- Task.prototype.id += 1;
- this.id = Task.prototype.id;
-
- this.name = name;
- }
-});
-
-
-const TaskListItemMenu = new Lang.Class({
- Name: 'PomodoroTaskListItemMenu',
- Extends: PopupMenu.PopupMenu,
-
- _init: function(source) {
- this.parent(source.actor, 0.5, St.Side.TOP);
-
- // We want to keep the item hovered while the menu is up
- this.blockSourceEvents = true;
-
- this._source = source;
-
- // Chain our visibility and lifecycle to that of the source
- source.actor.connect('notify::mapped', Lang.bind(this, function () {
- if (!source.actor.mapped) {
- this.close();
- }
- }));
- source.actor.connect('destroy', Lang.bind(this, function () {
- this.actor.destroy();
- }));
-
- Main.uiGroup.add_actor(this.actor);
- },
-});
-Signals.addSignalMethods(TaskListItemMenu.prototype);
-
-
-const TaskListItem = new Lang.Class({
- Name: 'PomodoroTaskListItem',
- Extends: PopupMenu.PopupBaseMenuItem,
-
- _init: function (task, params) {
- this.parent(params);
-
- this.actor.add_style_class_name('extension-pomodoro-task-list-item');
-
- this.task = task;
- this.selected = false;
-
-// if (Clutter.get_default_text_direction() == Clutter.TextDirection.RTL) {
-// this.actor.set_pack_start(false);
-// }
-
- this.label = new St.Label({ text: task.name });
- this.label.add_style_class_name('extension-pomodoro-task-list-item-name');
-
- this.actor.add_actor(this.label, { expand: true });
-
- this._menu = null;
- this._menuManager = new PopupMenu.PopupMenuManager(this);
-
- this.actor.connect('button-press-event', Lang.bind(this, this._onButtonPressEvent));
- this.actor.connect('button-release-event', Lang.bind(this, this._onButtonReleaseEvent));
- this.actor.connect('popup-menu', Lang.bind(this, this._onKeyboardPopupMenu));
- },
-
- setSelected: function(selected) {
- let selectedChanged = selected != this.selected;
- if (selectedChanged) {
- this.selected = selected;
- if (selected) {
- this.actor.add_style_pseudo_class('selected');
- this.setOrnament(PopupMenu.Ornament.DOT);
- } else {
- this.actor.remove_style_pseudo_class('selected');
- this.setOrnament(PopupMenu.Ornament.NONE);
- }
- this.emit('selected-changed', selected);
- }
- },
-
- _removeMenuTimeout: function() {
- if (this._menuTimeoutId > 0) {
- Mainloop.source_remove(this._menuTimeoutId);
- this._menuTimeoutId = 0;
- }
- },
-
- _onDestroy: function() {
- this._removeMenuTimeout();
- },
-
- _onButtonPressEvent: function(actor, event) {
- let button = event.get_button();
- if (button == 1) {
- this._removeMenuTimeout();
- this._menuTimeoutId = Mainloop.timeout_add(MENU_POPUP_TIMEOUT,
- Lang.bind(this, function() {
- this.popupMenu();
- }));
- } else if (button == 3) {
- this.popupMenu();
- return true;
- }
- return false;
- },
-
- /* override PopupBaseMenuItem._onButtonReleaseEvent */
- _onButtonReleaseEvent: function (actor, event) {
- this._removeMenuTimeout();
-
- if (!this._menu || !this._menu.isOpen) {
- this.activate(event);
- }
-
- return true;
- },
-
- _onKeyboardPopupMenu: function() {
- this.popupMenu();
- this._menu.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
- },
-
- popupMenu: function() {
- this._removeMenuTimeout();
-
- if (!this._menu) {
- this._menu = new TaskListItemMenu(this);
- this._menu.connect('open-state-changed', Lang.bind(this, function (menu, isPoppedUp) {
- if (!isPoppedUp) {
- this._onMenuPoppedDown();
- }
- }));
- Main.overview.connect('hiding', Lang.bind(this, function () {
- this._menu.close();
- }));
-
- this._menuManager.addMenu(this._menu);
-
- let item = new PopupMenu.PopupMenuItem(_("Mark as done"));
- this._menu.addMenuItem(item);
-
- this._menuManager.addMenu(this._menu);
- }
-
- this.emit('menu-state-changed', true);
-
- this.actor.set_hover(true);
- this._menu.open();
- this._menuManager.ignoreRelease();
-
- return false;
- },
-
- _onMenuPoppedDown: function() {
- this.actor.sync_hover();
- this.emit('menu-state-changed', false);
- },
-
- _onKeyFocusIn: function(actor) {
- this.setActive(true);
- this.emit('focus-in', Clutter.get_current_event());
- }
-});
-
-
-const TaskList = new Lang.Class({
- Name: 'PomodoroTaskList',
- Extends: PopupMenu.PopupMenuSection,
-
- _init: function() {
- this.parent();
-
- this.actor = new St.ScrollView({ x_expand: true,
- y_expand: true,
- x_fill: true,
- y_fill: false,
- reactive: true,
- y_align: St.Align.START });
- this.actor.add_style_class_name('extension-pomodoro-task-list');
- // this.actor.set_mouse_scrolling (false);
- this.actor.set_overlay_scrollbars (true);
- this.actor.set_policy(Gtk.PolicyType.NEVER,
- Gtk.PolicyType.AUTOMATIC);
-
- // FIXME: why fade effect doesn't work?
- this.actor.update_fade_effect(15, 0);
- this.actor.get_effect('fade').fade_edges = true;
-
- // we are only using ScrollView for the fade effect, hide scrollbars
- this.actor.vscroll.hide();
-
- this.actor.add_actor(this.box);
-
- // TODO: write custom _getPreferredHeight to show exactly 10 items or so
- // this.actor.connect('get-preferred-height', Lang.bind(this, this._getPreferredHeight));
-
- this._items = {};
- this._selected = null;
-
- let tasks = [
- new Task("Walk the dog"),
- new Task("Buy milk"),
- new Task("Save the world")
- ];
-
- for (var i=0; i < tasks.length; i++) {
- this.addTask(tasks[i]);
- }
- },
-
- _moveFocusToItems: function() {
- let hasItems = Object.keys(this._items).length > 0;
-
- if (!hasItems) {
- return;
- }
-
- if (global.stage.get_key_focus() != this.actor) {
- return;
- }
-
- let focusSet = this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
- if (!focusSet) {
- Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() {
- this._moveFocusToItems();
- return false;
- }));
- }
- },
-
- scrollToItem: function(item) {
- let box = item.actor.get_allocation_box();
-
- let adjustment = this.actor.get_vscroll_bar().get_adjustment();
-
- // TODO: only reveal top or bottom item
- let value = (box.y1 + adjustment.step_increment / 2.0) - (adjustment.page_size / 2.0);
- Tweener.removeTweens(adjustment);
- Tweener.addTween(adjustment,
- { value: value,
- time: SCROLL_ANIMATION_TIME,
- transition: 'easeOutQuad' });
- },
-
- getItemFromTaskId: function(task_id) {
- let item = this._items[task_id];
-
- if (!item) {
- return null;
- }
-
- return item;
- },
-
- addTask: function(task, params) {
- params = Params.parse (params, { animate: false,
- style_class: null });
- if (!task.id) {
- return null;
- }
-
- if (this._items[task.id])
- {
- // TODO: Move task to top
-
- return this._items[task.id];
- }
-
- let position = 0;
-
- let item = new TaskListItem(task);
- item.connect('activate', Lang.bind(this, this._onItemActivate));
- item.connect('focus-in', Lang.bind(this, this._onItemFocusIn));
- this.addMenuItem(item, position);
-
- this._items[task.id] = item;
-
- if (params.animate) {
- let [naturalWidth, naturalHeight] = item.actor.get_size();
-
- item.actor.set_height(0);
- Tweener.addTween(item.actor,
- { height: naturalHeight,
- time: 0.2,
- transition: 'easeOutQuad',
- onCompleteScope: item,
- onComplete: function() {
- this.actor.set_height(-1);
- }
- });
- }
-
- return item;
- },
-
- removeTask: function(task) {
- let id = task.id;
-
- if (!id) {
- return;
- }
-
- let item = this._items[id];
-
- if (!item) {
- return;
- }
-
- item.actor.destroy();
- delete this._items[id];
- },
-
- _onItemActivate: function(item, event) {
- if (this._selected) {
- this._selected.setSelected(false);
- }
-
- if (!this._selected || this._selected != item) {
- this._selected = item;
- this._selected.setSelected(true);
- this.emit('task-selected', item.task);
- }
- else {
- this._selected = null;
- this.emit('task-selected', null);
- }
- },
-
- _onItemFocusIn: function(item, event) {
- switch (event.type())
- {
- case Clutter.EventType.KEY_PRESS:
- case Clutter.EventType.BUTTON_PRESS:
- this.scrollToItem(item);
- break;
- }
- }
-});
-
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 544899e7..2f58de08 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -14,7 +14,6 @@ libgnome_pomodoro_la_SOURCES = \
keybinding-chooser-button.vala \
keybindings.vala \
log-scale.vala \
- main-window.vala \
mode-button.vala \
module.vala \
plugin.vala \
diff --git a/lib/application.vala b/lib/application.vala
index b943b72a..be1b828d 100644
--- a/lib/application.vala
+++ b/lib/application.vala
@@ -46,7 +46,6 @@ public class Pomodoro.Application : Gtk.Application
{
public Pomodoro.Service service;
public Pomodoro.Timer timer;
- public Gtk.Window main_window;
private Gtk.Window preferences_dialog;
private Gtk.Window about_dialog;
@@ -67,7 +66,6 @@ public class Pomodoro.Application : Gtk.Application
this.timer = null;
this.service = null;
- this.main_window = null;
this.hold_reasons = HoldReason.NONE;
}
@@ -120,33 +118,6 @@ public class Pomodoro.Application : Gtk.Application
Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
}
- public void show_main_window_full (uint32 timestamp)
- {
- if (this.main_window == null)
- {
- this.main_window = new Pomodoro.MainWindow ();
- this.main_window.destroy.connect (() => {
- this.main_window = null;
- });
-
- this.add_window (this.main_window);
- }
-
- if (this.main_window != null) {
- if (timestamp > 0) {
- this.main_window.present_with_time (timestamp);
- }
- else {
- this.main_window.present ();
- }
- }
- }
-
- public void show_main_window ()
- {
- this.show_main_window_full (0);
- }
-
public void show_preferences_full (string? view,
uint32 timestamp)
{
@@ -174,12 +145,6 @@ public class Pomodoro.Application : Gtk.Application
this.show_preferences_full (null, 0);
}
- private void action_main_window (SimpleAction action,
- Variant? parameter)
- {
- this.show_main_window ();
- }
-
private void action_preferences (SimpleAction action,
Variant? parameter)
{
@@ -262,9 +227,6 @@ public class Pomodoro.Application : Gtk.Application
var preferences_action = new GLib.SimpleAction ("preferences", null);
preferences_action.activate.connect (this.action_preferences);
- var main_window_action = new GLib.SimpleAction ("main-window", null);
- main_window_action.activate.connect (this.action_main_window);
-
var visit_website_action = new GLib.SimpleAction ("visit-website", null);
visit_website_action.activate.connect (this.action_visit_website);
@@ -281,7 +243,6 @@ public class Pomodoro.Application : Gtk.Application
quit_action.activate.connect (this.action_quit);
this.add_action (preferences_action);
- this.add_action (main_window_action);
this.add_action (visit_website_action);
this.add_action (report_issue_action);
this.add_action (enable_extension_action);
@@ -407,7 +368,7 @@ public class Pomodoro.Application : Gtk.Application
*/
public override void activate ()
{
- this.activate_action ("main-window", null);
+ this.activate_action ("preferences", null);
}
public override bool dbus_register (DBusConnection connection,
diff --git a/lib/main-window.vala b/lib/main-window.vala
deleted file mode 100644
index b904b785..00000000
--- a/lib/main-window.vala
+++ /dev/null
@@ -1,775 +0,0 @@
-/*
- * Copyright (c) 2014 gnome-pomodoro contributors
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- * Authors: Kamil Prusko
- *
- */
-
-using GLib;
-
-
-public enum Pomodoro.TaskStatus
-{
- DEFAULT = 0,
- DONE = 1,
- DISMISSED = 2,
- BLOCKED = 3
-}
-
-
-public enum Pomodoro.Urgency
-{
- LOW = 0,
- NORMAL = 1,
- HIGH = 2,
- VERY_HIGH = 3
-}
-
-
-public enum Pomodoro.Importance
-{
- LOW = 0,
- NORMAL = 1,
- HIGH = 2,
- VERY_HIGH = 3
-}
-
-
-public class Pomodoro.Project : Object
-{
- public string name { get; set; }
-}
-
-
-public class Pomodoro.Task : Object
-{
- public string summary { get; set; }
- public string description { get; set; }
-
-// public uint16 status { get; set; }
- public Importance importance { get; set; default = Importance.NORMAL; }
- public Urgency urgency { get; set; default = Urgency.NORMAL; }
-
- public uint64 time_spent { get; set; }
-
- public bool is_done { get; set; }
-
- public Task? parent { get; set; }
- public Project? project { get; set; }
-
-// public List attachments;
-
-// public uint64 start_date { get; set; }
-// public uint64 end_date { get; set; }
-
-// public List get_children () {
-// }
-
-// public List get_tasks_blocked () { // get_preceding_tasks ()
-// }
-
-// public List get_tasks_blocking () { // get_following_tasks ()
-// }
-
-}
-
-
-// TODO: File/URL attachments
-private class Pomodoro.AddTaskDialog : Gtk.Dialog
-{
- public Project? project;
- public Task task;
-
- private Gtk.Grid grid;
- private int grid_rows = 0;
-
- private enum Column {
- LABEL = 0,
- CONTENT = 1
- }
-
- construct {
- this.task = new Task ();
-
- this.destroy_with_parent = true;
- this.modal = true;
- this.use_header_bar = 1;
-
- this.title = _("New Task");
-
- var cancel_button = new Gtk.Button.with_mnemonic (_("_Cancel"));
-
- var done_button = new Gtk.Button.with_mnemonic (_("_Done"));
- done_button.get_style_context ().add_class ("suggested-action");
-
- cancel_button.clicked.connect (() => {
- this.response (Gtk.ResponseType.CANCEL);
- });
-
- done_button.clicked.connect (() => {
- this.response (Gtk.ResponseType.OK);
- });
-
- this.response.connect ((response) => {
- this.destroy ();
- });
-
- var header_bar = new Gtk.HeaderBar ();
- header_bar.show_close_button = false;
- header_bar.title = this.title;
- header_bar.pack_start (cancel_button);
- header_bar.pack_end (done_button);
- header_bar.show_all ();
- this.set_titlebar (header_bar);
-
- var entry = new Gtk.Entry ();
- entry.halign = Gtk.Align.FILL;
- entry.hexpand = true;
- entry.width_chars = 30;
- entry.truncate_multiline = true;
- entry.input_purpose = Gtk.InputPurpose.ALPHA;
- entry.input_hints = Gtk.InputHints.SPELLCHECK |
- Gtk.InputHints.UPPERCASE_SENTENCES |
- Gtk.InputHints.WORD_COMPLETION;
-// entry.has_default = true; // TODO
-
- var notes_text_view = new Gtk.TextView ();
- notes_text_view.border_width = 4;
- entry.input_purpose = Gtk.InputPurpose.FREE_FORM;
- entry.input_hints = Gtk.InputHints.SPELLCHECK |
- Gtk.InputHints.UPPERCASE_SENTENCES;
- notes_text_view.wrap_mode = Gtk.WrapMode.WORD;
-
-
- var notes_window = new Gtk.ScrolledWindow (null, null);
- notes_window.halign = Gtk.Align.FILL;
- notes_window.valign = Gtk.Align.FILL;
- notes_window.hexpand = true;
- notes_window.vexpand = true;
- notes_window.shadow_type = Gtk.ShadowType.IN;
- notes_window.min_content_height = 200;
- notes_window.add (notes_text_view);
-
- var project_select = new Gtk.ComboBoxText();
- project_select.halign = Gtk.Align.START;
- project_select.no_show_all = true;
- project_select.append_text ("Household");
- project_select.append_text ("Pomodoro");
-
- var tag_flow_box = new Gtk.FlowBox ();
- tag_flow_box.halign = Gtk.Align.FILL;
- tag_flow_box.hexpand = false;
- tag_flow_box.selection_mode = Gtk.SelectionMode.NONE;
- tag_flow_box.column_spacing = 6;
- tag_flow_box.row_spacing = 6;
- tag_flow_box.homogeneous = false;
-
- tag_flow_box.add (new Gtk.ToggleButton.with_label (_("Urgent")));
- tag_flow_box.add (new Gtk.ToggleButton.with_label (_("Important")));
-
- foreach (var child in tag_flow_box.get_children ()) {
- child.hexpand = false;
- }
-
- var due_date_button = new Widgets.CalendarButton ();
- due_date_button.halign = Gtk.Align.START;
-
- // var completed/done checkbox
-
- // var time_spent
-
- // var parent_task
-
- // var blocked_by
-
- // var blocks
-
- // mark_as_done_button, dismiss_button, delete_button
-
- this.grid = new Gtk.Grid ();
- this.grid.row_spacing = 10;
- this.grid.column_spacing = 10;
- this.grid.insert_column (Column.LABEL);
- this.grid.insert_column (Column.CONTENT);
-
- this.grid.set_margin_start (24);
- this.grid.set_margin_end (32);
- this.grid.set_margin_top (24);
- this.grid.set_margin_bottom (24);
-
- // this.add_field (_("Project"), project_select); // TODO: Pass parent_task/project when creating a dialog
- this.add_field (_("Summary"), entry);
- this.add_field (_("Tags"), tag_flow_box);
- this.add_field (_("Due Date"), due_date_button);
- this.add_field (_("Notes"), notes_window);
-
- this.grid.show_all ();
-
- var content_area = this.get_content_area ();
- content_area.pack_start (this.grid, true, true);
- }
-
- private void add_field (string title, Gtk.Widget widget)
- {
- var label = new Gtk.Label (title);
- label.halign = Gtk.Align.END;
- label.valign = Gtk.Align.CENTER;
-
- this.grid.attach (label, Column.LABEL, this.grid_rows, 1, 1);
- this.grid.attach (widget, Column.CONTENT, this.grid_rows, 1, 1);
- this.grid_rows += 1;
- }
-}
-
-
-private class Pomodoro.TaskListRow : Gtk.ListBoxRow
-{
- public Gtk.Label label;
- public Task task;
-
- public TaskListRow (Task task)
- {
- this.height_request = 50;
-
- var row_context = this.get_style_context ();
- row_context.add_class ("task");
-
- this.task = task;
-
- this.label = new Gtk.Label (task.summary);
- this.label.set_ellipsize (Pango.EllipsizeMode.END);
- this.label.set_alignment (0.0f, 0.5f);
- this.label.wrap = true;
- this.label.wrap_mode = Pango.WrapMode.WORD;
-
- var label_context = this.label.get_style_context ();
- label_context.add_class ("summary");
-
- var check_button = new Gtk.CheckButton ();
- check_button.set_margin_left (15); /* TODO: Use css */
- check_button.set_margin_right (3); /* TODO: Use css */
-
- task.bind_property ("is-done",
- check_button,
- "active",
- GLib.BindingFlags.BIDIRECTIONAL | GLib.BindingFlags.SYNC_CREATE);
-
- task.notify.connect(() => {
- this.on_task_changed ();
- });
-
- var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 2);
- hbox.set_halign (Gtk.Align.START);
- hbox.pack_start (check_button, false, true);
- hbox.pack_start (label, true, false);
-
- hbox.show_all ();
-
- this.add (hbox);
-
- this.on_task_changed ();
- }
-
- private void on_task_changed ()
- {
- var attribs = new Pango.AttrList ();
-
- if (this.task.is_done) {
- var strikethrough = Pango.attr_strikethrough_new (true);
- attribs.insert ((owned) strikethrough);
- }
-
- label.set_attributes (attribs);
- }
-}
-
-
-private class Pomodoro.TaskListPane : Gtk.Box
-{
- public Gtk.SearchBar search_bar;
-
- private Gtk.ListBox list_box;
- private unowned GLib.ActionGroup? action_group;
-
-// private GLib.List selection;
-
- /* TODO: Move to Utils? */
- private void list_box_separator_func (Gtk.ListBoxRow row,
- Gtk.ListBoxRow? before)
- {
- if (before != null)
- {
- var current = row.get_header ();
-
- if (current == null)
- {
- current = new Gtk.Separator (Gtk.Orientation.HORIZONTAL);
- current.show ();
- row.set_header (current);
- }
- }
- }
-
- public TaskListPane () {
- this.orientation = Gtk.Orientation.VERTICAL;
- this.spacing = 0;
- }
-
- construct
- {
- this.setup_search_bar ();
-
- this.list_box = new Gtk.ListBox ();
- this.list_box.set_selection_mode (Gtk.SelectionMode.NONE);
- this.list_box.set_activate_on_single_click (true);
- this.list_box.set_header_func (this.list_box_separator_func);
- this.list_box.can_focus = false;
- this.list_box.show ();
-
- this.list_box.insert (this.create_row_for_task ("Save the world"), -1);
- this.list_box.insert (this.create_row_for_task ("Buy milk"), -1);
- this.list_box.insert (this.create_row_for_task ("Walk the dog"), -1);
-
- this.list_box.insert (this.create_row_for_task ("Save the world"), -1);
- this.list_box.insert (this.create_row_for_task ("Buy milk"), -1);
- this.list_box.insert (this.create_row_for_task ("Walk the dog"), -1);
-
- this.list_box.insert (this.create_row_for_task ("Save the world"), -1);
- this.list_box.insert (this.create_row_for_task ("Buy milk"), -1);
- this.list_box.insert (this.create_row_for_task ("Walk the dog"), -1);
-
- this.list_box.insert (this.create_row_for_task ("Save the world"), -1);
- this.list_box.insert (this.create_row_for_task ("Buy milk"), -1);
- this.list_box.insert (this.create_row_for_task ("Walk the dog"), -1);
-
- this.list_box.row_activated.connect (this.on_row_activated);
-
- this.list_box.selected_rows_changed.connect
- (this.on_selected_rows_changed);
-
- var scrolled_window = new Gtk.ScrolledWindow (null, null);
- scrolled_window.set_policy (Gtk.PolicyType.NEVER,
- Gtk.PolicyType.AUTOMATIC);
- scrolled_window.add (this.list_box);
- scrolled_window.show ();
-
- this.pack_start (this.search_bar, false, true);
- this.pack_start (scrolled_window, true, true);
-
- this.setup_actions ();
- }
-
- public GLib.List get_selection ()
- {
- var selection = new GLib.List ();
-
- foreach (var row in this.list_box.get_selected_rows ()) {
- selection.prepend ((row as TaskListRow).task);
- }
-
- return selection;
- }
-
- public void select_all ()
- {
- this.list_box.select_all ();
- }
-
- public void unselect_all ()
- {
- this.list_box.unselect_all ();
- }
-
-
- private void action_select_all (SimpleAction action,
- Variant? parameter)
- {
- this.select_all ();
- }
-
- private void action_select_none (SimpleAction action,
- Variant? parameter)
- {
- this.unselect_all ();
- }
-
- private void action_find (SimpleAction action,
- Variant? parameter)
- {
- var is_enabled = this.search_bar.search_mode_enabled;
-
- this.search_bar.search_mode_enabled = !is_enabled;
- }
-
- private void setup_search_bar ()
- {
- var entry = new Gtk.SearchEntry ();
- entry.set_placeholder_text (_("Type to search..."));
- entry.set_width_chars (30);
- entry.valign = Gtk.Align.FILL;
- entry.shadow_type = Gtk.ShadowType.NONE;
-
- // var prev_button = new Gtk.Button.from_icon_name ("go-up-symbolic",
- // Gtk.IconSize.MENU);
- // var next_button = new Gtk.Button.from_icon_name ("go-down-symbolic",
- // Gtk.IconSize.MENU);
- // var options_button = new Gtk.Button.from_icon_name ("go-down-symbolic",
- // Gtk.IconSize.MENU);
-
- var hbox = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 0);
- // hbox.get_style_context ().add_class (Gtk.STYLE_CLASS_LINKED);
- hbox.pack_start (entry, true, false);
- // hbox.pack_start (prev_button, false, false);
- // hbox.pack_start (next_button, false, false);
- // hbox.pack_start (options_button, false, false);
-
- var size_group = new Gtk.SizeGroup (Gtk.SizeGroupMode.VERTICAL);
- size_group.add_widget (entry);
- // size_group.add_widget (prev_button);
- // size_group.add_widget (next_button);
- // size_group.add_widget (options_button);
-
- this.search_bar = new Gtk.SearchBar ();
- this.search_bar.get_style_context ().add_class (Gtk.STYLE_CLASS_PRIMARY_TOOLBAR);
- this.search_bar.get_style_context ().add_class (Gtk.STYLE_CLASS_TOOLBAR);
- this.search_bar.add (hbox);
- this.search_bar.connect_entry (entry);
- this.search_bar.show_all ();
- }
-
- private void setup_actions ()
- {
- this.realize.connect (() => {
- var window = this.get_toplevel ();
-
- return_if_fail (window != null);
-
- var action_group = window as ActionMap;
- // var action_group = new GLib.SimpleActionGroup ();
-
- var select_all_action = new GLib.SimpleAction ("select-all", null);
- select_all_action.activate.connect (this.action_select_all);
-
- var select_none_action = new GLib.SimpleAction ("select-none", null);
- select_none_action.activate.connect (this.action_select_none);
-
- var find_action = new GLib.SimpleAction ("find", null);
- find_action.activate.connect (this.action_find);
-
- action_group.add_action (select_all_action);
- action_group.add_action (select_none_action);
- action_group.add_action (find_action);
-
- this.action_group = action_group as GLib.ActionGroup;
- });
- }
-
- private void on_row_activated (Gtk.ListBoxRow row)
- {
- var tmp_row = row as TaskListRow;
-
- GLib.message ("\"%s\" activated", tmp_row.task.summary);
-
- if (this.list_box.selection_mode != Gtk.SelectionMode.MULTIPLE)
- {
- this.list_box.set_selection_mode (Gtk.SelectionMode.MULTIPLE);
- this.list_box.select_row (row);
- }
- }
-
- private void on_selected_rows_changed ()
- {
- this.selection_changed ();
- }
-
- protected Gtk.ListBoxRow create_row_for_task (string text)
- {
- var task = new Task ();
- task.summary = text;
-
- var row = new TaskListRow (task);
- row.show ();
-
- return row;
- }
-
- public signal void selection_changed ();
-}
-
-
-public class Pomodoro.MainWindow : Gtk.ApplicationWindow
-{
- private GLib.Settings settings;
-
- private Gtk.Box vbox;
- private Gtk.Stack header_bar_stack;
- private Gtk.Stack stack;
-
- private TaskListPane task_list_pane;
-
-
- public MainWindow ()
- {
- this.title = _("Tasks");
-
- var geometry = Gdk.Geometry ();
- geometry.min_width = 300;
- geometry.min_height = 300;
-
- var geometry_hints = Gdk.WindowHints.MIN_SIZE;
-
- this.set_geometry_hints (this,
- geometry,
- geometry_hints);
-
- this.set_default_size (450, 600);
-
- this.set_destroy_with_parent (false);
-
- this.set_type_hint (Gdk.WindowTypeHint.NORMAL);
-
- this.settings = Pomodoro.get_settings ().get_child ("preferences");
-
- this.setup ();
- }
-
- private void setup ()
- {
- var context = this.get_style_context ();
- context.add_class ("main-window");
-
- this.stack = new Gtk.Stack ();
- this.stack.homogeneous = true;
- this.stack.transition_duration = 150;
- this.stack.transition_type = Gtk.StackTransitionType.CROSSFADE;
- this.stack.show ();
-
- this.add (this.stack);
-
- this.setup_task_list ();
- this.setup_header_bar ();
-
- this.key_press_event.connect (this.on_key_press_event);
- }
-
- private Gtk.HeaderBar create_task_list_header_bar ()
- {
- var project_button = new Gtk.MenuButton ();
- project_button.relief = Gtk.ReliefStyle.NONE;
- project_button.valign = Gtk.Align.CENTER;
- // project_button.menu_model = project_menu;
- // project_button.get_style_context ().add_class ("project-menu");
-
- var project_button_label = new Gtk.Label (_("All Tasks"));
- project_button_label.get_style_context ().add_class ("title");
-
- var project_button_arrow = new Gtk.Arrow (Gtk.ArrowType.DOWN,
- Gtk.ShadowType.NONE);
-
- var project_button_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
- project_button_box.pack_start (project_button_label, true, false);
- project_button_box.pack_start (project_button_arrow, false, false);
- project_button.add (project_button_box);
-
- var new_task_button = new Gtk.Button.with_mnemonic (_("_New"));
- new_task_button.clicked.connect (() => {
- var dialog = new AddTaskDialog (); // TODO: Set current project
- dialog.set_transient_for (this.get_toplevel () as Gtk.Window);
- dialog.present ();
- });
-
- var find_image = new Gtk.Image.from_icon_name ("edit-find-symbolic",
- Gtk.IconSize.MENU);
- var find_button = new Gtk.ToggleButton ();
- find_button.set_image (find_image);
- find_button.bind_property ("active",
- this.task_list_pane.search_bar,
- "search-mode-enabled",
- GLib.BindingFlags.BIDIRECTIONAL);
-
- var header_bar = new Gtk.HeaderBar ();
- header_bar.show_close_button = true;
- header_bar.set_custom_title (project_button);
- header_bar.pack_start (new_task_button);
- header_bar.pack_end (find_button);
-
- //var bookmark_icon = GLib.Icon.new_for_string (
- // "resource:///org/gnome/pomodoro/" + Resources.BOOKMARK + ".svg");
- //var urgency_status = new Gtk.Image.from_gicon (bookmark_icon,
- // Gtk.IconSize.MENU);
-
- //var filter_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 3);
- //filter_box.pack_start (urgency_status, false, false);
-
- //var filter_label = new Gtk.Label (_("Today"));
- //filter_box.pack_start (filter_label, true, false);
-
- //var filter_button = new Gtk.Button ();
- //filter_button.set_relief (Gtk.ReliefStyle.NONE);
- //filter_button.add (filter_box);
-
- //var urgency_filter_menu = new GLib.Menu ();
- //urgency_filter_menu.append (_("Urgent"), "action-name");
- //urgency_filter_menu.append (_("Important"), "action-name");
-
- //var time_filter_menu = new GLib.Menu ();
- //time_filter_menu.append (_("All"), "action-name");
- //time_filter_menu.append (_("Today"), "action-name");
-
- //var filter_menu = new GLib.Menu ();
- //filter_menu.append_section (null, urgency_filter_menu);
- //filter_menu.append_section (null, time_filter_menu );
-
- //var urgency_popover = new Gtk.Popover.from_model (filter_button,
- // filter_menu);
- //urgency_popover.set_modal (true);
- //urgency_popover.set_position (Gtk.PositionType.TOP);
-
- //filter_button.clicked.connect(() => {
- // urgency_popover.show();
- //});
-
- //filter_button.show_all();
- //this.header_bar.pack_start (filter_button);
-
- header_bar.show_all ();
- return header_bar;
- }
-
- private Gtk.Label selection_menubutton_label;
-
- private Gtk.HeaderBar create_task_list_selection_header_bar ()
- {
- var header_bar = new Gtk.HeaderBar ();
- header_bar.show_close_button = false;
- header_bar.get_style_context ().add_class ("selection-mode");
-
- var menubutton = new Gtk.MenuButton ();
- menubutton.valign = Gtk.Align.CENTER;
- menubutton.get_style_context ().add_class ("selection-menu");
-
- try {
- var builder = new Gtk.Builder ();
- builder.add_from_resource ("/org/gnome/pomodoro/menu.ui");
-
- var selection_menu = builder.get_object ("selection-menu") as GLib.MenuModel;
- menubutton.menu_model = selection_menu;
- }
- catch (GLib.Error error) {
- GLib.warning (error.message);
- }
-
- var menubutton_label = new Gtk.Label (_("Click on items to select them"));
-
- var menubutton_arrow = new Gtk.Arrow (Gtk.ArrowType.DOWN,
- Gtk.ShadowType.NONE);
- var menubutton_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
- menubutton_box.pack_start (menubutton_label, true, false);
- menubutton_box.pack_start (menubutton_arrow, false, false);
- menubutton.add (menubutton_box);
-
- this.selection_menubutton_label = menubutton_label;
-
- var search_button = new Gtk.ToggleButton ();
- var search_image = new Gtk.Image.from_icon_name ("edit-find-symbolic",
- Gtk.IconSize.MENU);
- search_button.set_image (search_image);
- search_button.show_all();
- search_button.bind_property ("active",
- this.task_list_pane.search_bar,
- "search-mode-enabled",
- GLib.BindingFlags.BIDIRECTIONAL);
-
- var cancel_button = new Gtk.Button.with_mnemonic (_("_Cancel"));
- cancel_button.clicked.connect (() => {
- this.task_list_pane.unselect_all ();
- this.header_bar_stack.set_visible_child_name ("task-list");
- });
-
- header_bar.set_custom_title (menubutton);
- header_bar.pack_end (cancel_button);
- header_bar.pack_end (search_button);
-
- header_bar.show_all ();
- return header_bar;
- }
-
- private Gtk.HeaderBar create_task_details_header_bar ()
- {
- var header_bar = new Gtk.HeaderBar ();
- header_bar.show_close_button = true;
-
- header_bar.title = "";
-
- header_bar.show_all ();
- return header_bar;
- }
-
- private void setup_header_bar ()
- {
- this.header_bar_stack = new Gtk.Stack ();
- this.header_bar_stack.add_named (
- this.create_task_list_header_bar (),
- "task-list");
- this.header_bar_stack.add_named (
- this.create_task_list_selection_header_bar (),
- "task-list-selection");
- this.header_bar_stack.add_named (
- this.create_task_details_header_bar (),
- "task-details");
- this.header_bar_stack.show ();
-
- this.header_bar_stack.set_visible_child_name ("task-list");
-
- this.set_titlebar (this.header_bar_stack);
- }
-
- private void setup_task_list ()
- {
- this.task_list_pane = new TaskListPane ();
- this.task_list_pane.show ();
-
- this.task_list_pane.selection_changed.connect (() => {
- var items = this.task_list_pane.get_selection ();
- var n_items = items.length ();
-
- if (n_items > 0) {
- this.header_bar_stack.set_visible_child_name ("task-list-selection");
- }
- else {
- this.header_bar_stack.set_visible_child_name ("task-list");
- }
-
- string label;
- if (n_items == 0) {
- label = _("Click on items to select them");
- } else {
- label = ngettext ("%d selected",
- "%d selected",
- n_items).printf (n_items);
- }
-
- this.selection_menubutton_label.label = label;
- });
-
- this.stack.add_named (this.task_list_pane, "task-list");
- }
-
- private bool on_key_press_event (Gdk.EventKey event)
- {
- return this.task_list_pane.search_bar.handle_event (event); //Gtk.get_current_event ());
- }
-}
diff --git a/lib/service.vala b/lib/service.vala
index 76441caa..4d45516f 100644
--- a/lib/service.vala
+++ b/lib/service.vala
@@ -74,12 +74,6 @@ public class Pomodoro.Service : Object
});
}
- public void show_main_window (uint32 timestamp)
- {
- var application = GLib.Application.get_default () as Pomodoro.Application;
- application.show_main_window_full (timestamp);
- }
-
public void show_preferences (string view,
uint32 timestamp)
{
diff --git a/vapi/Gom-1.0.metadata b/vapi/Gom-1.0.metadata
deleted file mode 100644
index 565b5040..00000000
--- a/vapi/Gom-1.0.metadata
+++ /dev/null
@@ -1,2 +0,0 @@
-gom_command_execute.cursor nullable="1"
-Filter.sql skip
diff --git a/vapi/Makefile.am b/vapi/Makefile.am
index b49d266a..aef25a89 100644
--- a/vapi/Makefile.am
+++ b/vapi/Makefile.am
@@ -4,10 +4,8 @@ BUILT_SOURCES = \
EXTRA_DIST = \
gnome-desktop-3.0.vapi \
- gom-1.0.vapi \
GnomeDesktop-3.0.metadata \
- Gio-2.0.metadata \
- Gom-1.0.metadata
+ Gio-2.0.metadata
CLEANFILES = \
$(BUILT_SOURCES)
@@ -15,9 +13,6 @@ CLEANFILES = \
gnome-desktop-3.0.vapi: $(INTROSPECTION_GIRDIR)/GnomeDesktop-3.0.gir GnomeDesktop-3.0.metadata
$(AM_V_GEN) $(VAPIGEN) --library gnome-desktop-3.0 --metadatadir=$(srcdir) --pkg gio-2.0 --pkg gtk+-3.0 $<
-#gom-1.0.vapi: $(INTROSPECTION_GIRDIR)/Gom-1.0.gir Gom-1.0.metadata Gio-2.0.metadata
-# $(AM_V_GEN) $(VAPIGEN) --library gom-1.0 --metadatadir=$(srcdir) --pkg sqlite3 $<
-
dist-hook:
cd $(distdir) && rm -f $(CLEANFILES)
diff --git a/vapi/gom-1.0.vapi b/vapi/gom-1.0.vapi
deleted file mode 100644
index a0342356..00000000
--- a/vapi/gom-1.0.vapi
+++ /dev/null
@@ -1,219 +0,0 @@
-/* gom-1.0.vapi generated by vapigen, do not modify. */
-
-[CCode (cprefix = "Gom", gir_namespace = "Gom", gir_version = "1.0", lower_case_cprefix = "gom_")]
-namespace Gom {
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_adapter_get_type ()")]
- public class Adapter : GLib.Object {
- [CCode (has_construct_function = false)]
- public Adapter ();
- public async bool close_async () throws GLib.Error;
- public bool close_sync () throws GLib.Error;
- public bool execute_sql (string sql) throws GLib.Error;
- public unowned Sqlite.Database get_handle ();
- public async bool open_async (string uri) throws GLib.Error;
- public bool open_sync (string uri) throws GLib.Error;
- public void queue_read ([CCode (scope = "async")] owned Gom.AdapterCallback callback);
- public void queue_write ([CCode (scope = "async")] owned Gom.AdapterCallback callback);
- }
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_command_get_type ()")]
- public class Command : GLib.Object {
- [CCode (has_construct_function = false)]
- protected Command ();
- public bool execute (Gom.Cursor? cursor) throws GLib.Error;
- public int get_param_index (string param_name);
- public void reset ();
- public void set_param (uint param, GLib.Value value);
- public void set_param_double (uint param, double value);
- public void set_param_float (uint param, float value);
- public void set_param_int (uint param, int value);
- public void set_param_int64 (uint param, int64 value);
- public void set_param_string (uint param, string value);
- public void set_param_uint (uint param, uint value);
- public void set_param_uint64 (uint param, uint64 value);
- public void set_sql (string sql);
- [NoAccessorMethod]
- public Gom.Adapter adapter { owned get; construct; }
- public string sql { set; }
- }
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_command_builder_get_type ()")]
- public class CommandBuilder : GLib.Object {
- [CCode (has_construct_function = false)]
- protected CommandBuilder ();
- public Gom.Command build_count ();
- public GLib.List build_create (uint version);
- public Gom.Command build_delete ();
- public Gom.Command build_insert (Gom.Resource resource);
- public Gom.Command build_select ();
- public Gom.Command build_update (Gom.Resource resource);
- [NoAccessorMethod]
- public Gom.Adapter adapter { owned get; construct; }
- [NoAccessorMethod]
- public Gom.Filter filter { owned get; set; }
- [NoAccessorMethod]
- public uint limit { get; set; }
- [NoAccessorMethod]
- public string m2m_table { owned get; construct; }
- [NoAccessorMethod]
- public GLib.Type m2m_type { get; construct; }
- [NoAccessorMethod]
- public uint offset { get; set; }
- [NoAccessorMethod]
- public GLib.Type resource_type { get; set; }
- }
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_cursor_get_type ()")]
- public class Cursor : GLib.Object {
- [CCode (has_construct_function = false)]
- protected Cursor ();
- public void get_column (uint column, GLib.Value value);
- public bool get_column_boolean (uint column);
- public double get_column_double (uint column);
- public float get_column_float (uint column);
- public int get_column_int (uint column);
- public int64 get_column_int64 (uint column);
- public unowned string get_column_name (uint column);
- public unowned string get_column_string (uint column);
- public uint get_column_uint (uint column);
- public uint64 get_column_uint64 (uint column);
- public uint get_n_columns ();
- public bool next ();
- [NoAccessorMethod]
- public void* statement { get; construct; }
- }
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_filter_get_type ()")]
- public class Filter : GLib.InitiallyUnowned {
- [CCode (has_construct_function = false)]
- protected Filter ();
- [CCode (has_construct_function = false)]
- public Filter.and (Gom.Filter left, Gom.Filter right);
- [CCode (has_construct_function = false)]
- public Filter.eq (GLib.Type resource_type, string property_name, GLib.Value value);
- public string get_sql (GLib.HashTable table_map);
- public GLib.Array get_values ();
- [CCode (has_construct_function = false)]
- public Filter.gt (GLib.Type resource_type, string property_name, GLib.Value value);
- [CCode (has_construct_function = false)]
- public Filter.gte (GLib.Type resource_type, string property_name, GLib.Value value);
- [CCode (has_construct_function = false)]
- public Filter.like (GLib.Type resource_type, string property_name, GLib.Value value);
- [CCode (has_construct_function = false)]
- public Filter.lt (GLib.Type resource_type, string property_name, GLib.Value value);
- [CCode (has_construct_function = false)]
- public Filter.lte (GLib.Type resource_type, string property_name, GLib.Value value);
- [CCode (has_construct_function = false)]
- public Filter.neq (GLib.Type resource_type, string property_name, GLib.Value value);
- [CCode (has_construct_function = false)]
- public Filter.or (Gom.Filter left, Gom.Filter right);
- [CCode (has_construct_function = false)]
- public Filter.sql (string sql, GLib.Array values);
- [NoAccessorMethod]
- public Gom.FilterMode mode { get; construct; }
- }
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_repository_get_type ()")]
- public class Repository : GLib.Object {
- [CCode (has_construct_function = false)]
- public Repository (Gom.Adapter adapter);
- public async bool automatic_migrate_async (uint version, owned GLib.List object_types) throws GLib.Error;
- public bool automatic_migrate_sync (uint version, owned GLib.List object_types) throws GLib.Error;
- public async Gom.ResourceGroup find_async (GLib.Type resource_type, Gom.Filter filter) throws GLib.Error;
- public async Gom.Resource find_one_async (GLib.Type resource_type, Gom.Filter filter) throws GLib.Error;
- public Gom.Resource find_one_sync (GLib.Type resource_type, Gom.Filter filter) throws GLib.Error;
- public Gom.ResourceGroup find_sync (GLib.Type resource_type, Gom.Filter? filter) throws GLib.Error;
- public unowned Gom.Adapter get_adapter ();
- public async bool migrate_async (uint version, [CCode (scope = "async")] owned Gom.RepositoryMigrator migrator) throws GLib.Error;
- public bool migrate_sync (uint version, Gom.RepositoryMigrator migrator) throws GLib.Error;
- public Gom.Adapter adapter { get; construct; }
- }
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_resource_get_type ()")]
- public abstract class Resource : GLib.Object {
- [CCode (has_construct_function = false)]
- protected Resource ();
- public async bool delete_async () throws GLib.Error;
- public bool delete_sync () throws GLib.Error;
- public async Gom.ResourceGroup fetch_m2m_async (GLib.Type resource_type, string m2m_table, Gom.Filter filter) throws GLib.Error;
- public static GLib.Quark from_bytes_func_quark ();
- public bool get_is_from_table ();
- public static bool has_dynamic_pkey (GLib.Type type);
- public static GLib.Quark new_in_version_quark ();
- public static GLib.Quark not_mapped_quark ();
- public static GLib.Quark notnull ();
- public static GLib.Quark ref_property_name ();
- public static GLib.Quark ref_table_class ();
- public async bool save_async () throws GLib.Error;
- public bool save_sync () throws GLib.Error;
- public void set_is_from_table (bool is_from_table);
- [CCode (cname = "gom_resource_class_set_notnull")]
- public class void set_notnull (string property_name);
- [CCode (cname = "gom_resource_class_set_primary_key")]
- public class void set_primary_key (string primary_key);
- [CCode (cname = "gom_resource_class_set_property_from_bytes")]
- public class void set_property_from_bytes (string property_name, [CCode (destroy_notify_pos = 2.1)] owned Gom.ResourceFromBytesFunc from_bytes_func);
- [CCode (cname = "gom_resource_class_set_property_new_in_version")]
- public class void set_property_new_in_version (string property_name, uint version);
- [CCode (cname = "gom_resource_class_set_property_set_mapped")]
- public class void set_property_set_mapped (string property_name, bool is_mapped);
- [CCode (cname = "gom_resource_class_set_property_to_bytes")]
- public class void set_property_to_bytes (string property_name, [CCode (destroy_notify_pos = 2.1)] owned Gom.ResourceToBytesFunc to_bytes_func);
- [CCode (cname = "gom_resource_class_set_reference")]
- public class void set_reference (string property_name, string ref_table_name, string ref_property_name);
- [CCode (cname = "gom_resource_class_set_table")]
- public class void set_table (string table);
- [CCode (cname = "gom_resource_class_set_unique")]
- public class void set_unique (string property_name);
- public static GLib.Quark to_bytes_func_quark ();
- public static GLib.Quark unique ();
- [NoAccessorMethod]
- public Gom.Repository repository { owned get; set; }
- }
- [CCode (cheader_filename = "gom/gom.h", type_id = "gom_resource_group_get_type ()")]
- public class ResourceGroup : GLib.Object {
- [CCode (has_construct_function = false)]
- protected ResourceGroup ();
- public async bool fetch_async (uint index_, uint count) throws GLib.Error;
- public bool fetch_sync (uint index_, uint count) throws GLib.Error;
- public uint get_count ();
- public unowned Gom.Resource get_index (uint index_);
- public unowned string get_m2m_table ();
- [NoAccessorMethod]
- public Gom.Adapter adapter { owned get; construct; }
- public uint count { get; construct; }
- [NoAccessorMethod]
- public Gom.Filter filter { owned get; construct; }
- public string m2m_table { get; construct; }
- [NoAccessorMethod]
- public GLib.Type m2m_type { get; construct; }
- [NoAccessorMethod]
- public Gom.Repository repository { owned get; construct; }
- [NoAccessorMethod]
- public GLib.Type resource_type { get; construct; }
- }
- [CCode (cheader_filename = "gom/gom.h", cprefix = "GOM_FILTER_", type_id = "gom_filter_mode_get_type ()")]
- public enum FilterMode {
- SQL,
- OR,
- AND,
- EQ,
- NEQ,
- GT,
- GTE,
- LT,
- LTE,
- LIKE
- }
- [CCode (cheader_filename = "gom/gom.h", cprefix = "GOM_ERROR_")]
- public errordomain Error {
- ADAPTER_OPEN,
- COMMAND_NO_SQL,
- COMMAND_SQLITE,
- REPOSITORY_EMPTY_RESULT,
- RESOURCE_CURSOR;
- public static GLib.Quark quark ();
- }
- [CCode (cheader_filename = "gom/gom.h", instance_pos = 1.9)]
- public delegate void AdapterCallback (Gom.Adapter adapter);
- [CCode (cheader_filename = "gom/gom.h", instance_pos = 3.9)]
- public delegate bool RepositoryMigrator (Gom.Repository repository, Gom.Adapter adapter, uint version) throws GLib.Error;
- [CCode (cheader_filename = "gom/gom.h", has_target = false)]
- public delegate void ResourceFromBytesFunc (GLib.Bytes bytes, GLib.Value value);
- [CCode (cheader_filename = "gom/gom.h", has_target = false)]
- public delegate GLib.Bytes ResourceToBytesFunc (GLib.Value value);
-}