[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 04/15: First draft working
noreply at xfce.org
noreply at xfce.org
Wed Jun 1 22:39:57 CEST 2016
This is an automated email from the git hooks/post-receive script.
schuellerf pushed a commit to branch master
in repository panel-plugins/xfce4-clipman-plugin.
commit 3bf7d97944604a0b002a1ff4baff19cbb5c92c21
Author: Florian Schüller <florian.schueller at gmail.com>
Date: Wed May 25 00:06:58 2016 +0200
First draft working
---
panel-plugin/Makefile.am | 24 +++++++++++++++++++++++-
panel-plugin/collector.c | 37 +++++++++++++++++++++++++++++++++++++
panel-plugin/collector.h | 1 +
panel-plugin/common.h | 5 +++--
panel-plugin/plugin.c | 3 +++
5 files changed, 67 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 26af20f..cb24801 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -10,7 +10,7 @@ INCLUDES = \
-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
$(NULL)
-bin_PROGRAMS = xfce4-clipman xfce4-popup-clipman xfce4-clipman-settings
+bin_PROGRAMS = xfce4-clipman xfce4-popup-clipman xfce4-clipman-settings xfce4-popup-clipman-actions
#
# Maintainer Mode
@@ -45,6 +45,28 @@ xfce4_popup_clipman_LDADD = \
$(NULL)
#
+# Action Popup Command
+#
+
+xfce4_popup_clipman_actions_SOURCES = \
+ xfce4-popup-clipman-actions.c \
+ common.h \
+ $(NULL)
+
+xfce4_popup_clipman_actions_CFLAGS = \
+ -DGSEAL_ENABLE \
+ @LIBX11_CFLAGS@ \
+ @GDKX_CFLAGS@ \
+ @GTK_CFLAGS@ \
+ $(NULL)
+
+xfce4_popup_clipman_actions_LDADD = \
+ @LIBX11_LIBS@ \
+ @GDKX_LIBS@ \
+ @GTK_LIBS@ \
+ $(NULL)
+
+#
# Settings dialog
#
diff --git a/panel-plugin/collector.c b/panel-plugin/collector.c
index 075b1be..74af711 100644
--- a/panel-plugin/collector.c
+++ b/panel-plugin/collector.c
@@ -244,6 +244,43 @@ clipman_collector_get (void)
return singleton;
}
+void
+clipman_collector_show_actions (void)
+{
+ ClipmanCollector *collector;
+ const ClipmanHistoryItem *item;
+ ClipmanHistory *history;
+ GSList *entries;
+ gint group;
+
+ history = clipman_history_get();
+ collector = clipman_collector_get();
+
+ item = clipman_history_get_item_to_restore(history);
+
+ if (item == NULL)
+ return;
+
+ if (item->type == CLIPMAN_HISTORY_TYPE_TEXT)
+ {
+ entries = clipman_actions_match (collector->priv->actions, ACTION_GROUP_MANUAL, item->content.text);
+ if (entries == NULL)
+ {
+ group = ACTION_GROUP_SELECTION;
+ }
+ else
+ {
+ group = ACTION_GROUP_MANUAL;
+ }
+ g_slist_free (entries);
+ clipman_actions_match_with_menu (collector->priv->actions, group, item->content.text);
+ }
+ else
+ {
+ DBG("I can't show actions on item type %d", item->type);
+ }
+}
+
/*
* GObject
*/
diff --git a/panel-plugin/collector.h b/panel-plugin/collector.h
index a32272a..ccdee34 100644
--- a/panel-plugin/collector.h
+++ b/panel-plugin/collector.h
@@ -52,6 +52,7 @@ GType clipman_collector_get_type ();
ClipmanCollector * clipman_collector_get ();
void clipman_collector_set_is_restoring (ClipmanCollector *collector);
+void clipman_collector_show_actions ();
#endif /* !__CLIPMAN_COLLECTOR_H__ */
diff --git a/panel-plugin/common.h b/panel-plugin/common.h
index de5b17c..b151d02 100644
--- a/panel-plugin/common.h
+++ b/panel-plugin/common.h
@@ -45,8 +45,9 @@
* Selection for the popup command
*/
-#define XFCE_CLIPMAN_SELECTION "XFCE_CLIPMAN_SELECTION"
-#define XFCE_CLIPMAN_MESSAGE "MENU"
+#define XFCE_CLIPMAN_SELECTION "XFCE_CLIPMAN_SELECTION"
+#define XFCE_CLIPMAN_MESSAGE "MENU"
+#define XFCE_CLIPMAN_ACTION_MESSAGE "ACTIONS"
/*
* Action Groups
diff --git a/panel-plugin/plugin.c b/panel-plugin/plugin.c
index dbf604f..c3d580a 100644
--- a/panel-plugin/plugin.c
+++ b/panel-plugin/plugin.c
@@ -461,6 +461,9 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}
return TRUE;
+ } else if (!g_ascii_strcasecmp (XFCE_CLIPMAN_ACTION_MESSAGE, evt->data.b))
+ {
+ clipman_collector_show_actions();
}
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list