summaryrefslogtreecommitdiff
path: root/libreofficekit/qa/gtktiledviewer/gtv-helpers.hxx
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.co.uk>2017-07-13 19:34:41 +0530
committerpranavk <pranavk@collabora.co.uk>2017-07-14 09:33:24 +0200
commitf059293344ba93d76fcc6e64015923dfa639c4bf (patch)
tree429f59ba36f9d4d577c1a7ac941fe2b1949dcd7a /libreofficekit/qa/gtktiledviewer/gtv-helpers.hxx
parentb7b2887d62ea249310f02f03c4ce31cbd8f21307 (diff)
Modernize gtktiledviewer; use GApplication
Put all the UI content in UI XML file. Unfortunately, lots of boilerplate code because G_DECLARE_* macros are available only since glib 2.44 Change-Id: Idc74ba8565d482c28abd00b6f6f75646ab3d40b9 Reviewed-on: https://gerrit.libreoffice.org/39913 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: pranavk <pranavk@collabora.co.uk>
Diffstat (limited to 'libreofficekit/qa/gtktiledviewer/gtv-helpers.hxx')
-rw-r--r--libreofficekit/qa/gtktiledviewer/gtv-helpers.hxx45
1 files changed, 45 insertions, 0 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-helpers.hxx b/libreofficekit/qa/gtktiledviewer/gtv-helpers.hxx
new file mode 100644
index 000000000000..033b974f0fbd
--- /dev/null
+++ b/libreofficekit/qa/gtktiledviewer/gtv-helpers.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef GTV_HELPERS_H
+#define GTV_HELPERS_H
+
+#include <gtk/gtk.h>
+
+#include <gtv-signal-handlers.hxx>
+
+#include <map>
+#include <string>
+#include <memory>
+
+#include <boost/property_tree/json_parser.hpp>
+
+#define UI_FILE_NAME "gtv.ui"
+
+// Wrapper with custom deleter to use for Gtk objects
+template <class T>
+using GtvGtkWrapper = std::unique_ptr<T, void(*)(T*)>;
+
+namespace GtvHelpers
+{
+ void userPromptDialog(GtkWindow* pWindow, const std::string& aTitle, std::map<std::string, std::string>& aEntries);
+
+ void clipboardSetHtml(GtkClipboard* pClipboard, const char* pSelection);
+
+ /// Generate an author string for multiple views.
+ std::string getNextAuthor();
+
+ GtkWidget* createCommentBox(const boost::property_tree::ptree& aComment);
+
+ const std::string getDirPath(const std::string& filePath);
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */