[gnote] Add popoverwidgets files



commit 4646eed9459e813a61dc32d61fdc9b67707ded98
Author: Aurimas Černius <aurisc4 gmail com>
Date:   Sat Mar 30 18:59:59 2019 +0200

    Add popoverwidgets files

 src/Makefile.am        |  1 +
 src/popoverwidgets.cpp | 31 +++++++++++++++++++++++++++++
 src/popoverwidgets.hpp | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 85 insertions(+)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 78c048d7..e4907b56 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -123,6 +123,7 @@ libgnote_la_SOURCES = \
        notetag.hpp notetag.cpp \
        note.hpp note.cpp \
        notewindow.hpp notewindow.cpp \
+       popoverwidgets.hpp popoverwidgets.cpp \
        preferences.hpp preferences.cpp \
        preferencetabaddin.hpp \
        recenttreeview.hpp \
diff --git a/src/popoverwidgets.cpp b/src/popoverwidgets.cpp
new file mode 100644
index 00000000..67dfcdf7
--- /dev/null
+++ b/src/popoverwidgets.cpp
@@ -0,0 +1,31 @@
+/*
+ * gnote
+ *
+ * Copyright (C) 2019 Aurimas Cernius
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#include "iactionmanager.hpp"
+#include "popoverwidgets.hpp"
+
+namespace gnote {
+
+PopoverWidget PopoverWidget::create_for_app(int ord, Gtk::Widget *w)
+{
+  return PopoverWidget(IActionManager::APP_ACTION_MANAGE, ord, w);
+}
+
+}
+
diff --git a/src/popoverwidgets.hpp b/src/popoverwidgets.hpp
new file mode 100644
index 00000000..bcedb807
--- /dev/null
+++ b/src/popoverwidgets.hpp
@@ -0,0 +1,53 @@
+/*
+ * gnote
+ *
+ * Copyright (C) 2019 Aurimas Cernius
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _POPOVERWIDGETS_HPP_
+#define _POPOVERWIDGETS_HPP_
+
+namespace gnote {
+
+struct PopoverWidget
+{
+  Gtk::Widget *widget;
+  int section;
+  int order;
+  int secondary_order;
+
+  static PopoverWidget create_for_app(int ord, Gtk::Widget *w);
+
+  PopoverWidget(int sec, int ord, Gtk::Widget *w)
+    : widget(w)
+    , section(sec)
+    , order(ord)
+    {}
+
+  bool operator< (const PopoverWidget & other)
+    {
+      if(section != other.section)
+        return section < other.section;
+      if(order != other.order)
+        return order < other.order;
+      return secondary_order < other.secondary_order;
+    }
+};
+
+}
+
+#endif
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]