diff options
33 files changed, 1281 insertions, 778 deletions
@@ -1,5 +1,103 @@ # Generated by Makefile. Do not edit. +2011-08-11 Ted Gould <ted@gould.cx> + + 0.3.91 + +2011-07-22 Ted Gould <ted@gould.cx> + + Fix comments to work with g-ir-scanner + +2011-07-20 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Fixed comments to correctly work with g-ir-scanner + + No more missing transfer warning (and relative missing + bindings for some getting functions). + +2011-07-22 Ted Gould <ted@gould.cx> + + Adding in support for the secondary activate (middle click) + +2011-07-22 Ted Gould <ted@gould.cx> + + Adding the secondary target functions to the documentation + +2011-07-22 Ted Gould <ted@gould.cx> + + Watching for the 'XAyatanaSecondaryActivate' method as well + +2011-07-22 Ted Gould <ted@gould.cx> + + Always clear the sec_activate_target + +2011-07-20 Marco Trevisan (Treviño) <mail@3v1n0.net> + + examples: use the set_secondary_activate_target API + +2011-07-20 Marco Trevisan (Treviño) <mail@3v1n0.net> + + vala: updated example to use the new API + +2011-07-20 Marco Trevisan (Treviño) <mail@3v1n0.net> + + mono bindings: updated API and example + +2011-07-20 Marco Trevisan (Treviño) <mail@3v1n0.net> + + app-indicator: Move from "secondary-activate" signal to secondary_activate target + + To avoid appindicators writers to use the "secondary-activate" + event to perform actions that can't be done via a menu item + we added a new API: + + - app_indicator_set_secondary_activate_target + - app_indicator_get_secondary_activate_target + + With it, an appindicator writer can simply define a new GtkWidget + that will be activated when a secondary activation will occur. + The GtkWidget must be a sensitive and visible inner child of + the appindicator MenuItem. + +2011-07-19 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Call the right signal on middle-click over the tray icon! + +2011-07-18 Marco Trevisan (Treviño) <mail@3v1n0.net> + + app-indicator: added middle click support for wrapper tray + + When a trayicon is used, the middle click over the icon + is considered as a secondary activation. + +2011-07-18 Marco Trevisan (Treviño) <mail@3v1n0.net> + + examples: add secondary-activate signal usage to Vala and C + +2011-07-18 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Vala bindings example: added secondary_activate + +2011-07-18 Marco Trevisan (Treviño) <mail@3v1n0.net> + + mono bindings: added SecondaryActivate support. + + Updated the example too. + +2011-07-18 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Add signal "secondary-activate" and emit it when needed + + When a libappindicator app get the "SecondaryActivate" dbus + method call, the library redirects it to the app emitting + the "secondary-activate" signal. + + This should be conform to the StatusNotifierItem specifications. + +2011-07-09 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Merge with Upstream + 2011-07-07 Ted Gould <ted@gould.cx> 0.3.90 diff --git a/bindings/mono/examples/IndicatorExample.cs b/bindings/mono/examples/IndicatorExample.cs index c18a665..7413c54 100644 --- a/bindings/mono/examples/IndicatorExample.cs +++ b/bindings/mono/examples/IndicatorExample.cs @@ -41,12 +41,19 @@ public class IndicatorExample indicator.Status = Status.Attention; Menu menu = new Menu (); - menu.Append (new MenuItem ("Foo")); + var foo = new MenuItem ("Foo"); + menu.Append (foo); + foo.Activated += delegate { + System.Console.WriteLine ("Foo item has been activated"); + }; + menu.Append (new MenuItem ("Bar")); indicator.Menu = menu; indicator.Menu.ShowAll (); + indicator.SecondaryActivateTarget = foo; + win.ShowAll (); Application.Run (); diff --git a/bindings/mono/libappindicator-api.raw b/bindings/mono/libappindicator-api.raw index 37ddae3..561b7a2 100644 --- a/bindings/mono/libappindicator-api.raw +++ b/bindings/mono/libappindicator-api.raw @@ -143,6 +143,9 @@ <method name="GetOrderingIndex" cname="app_indicator_get_ordering_index"> <return-type type="guint32" /> </method> + <method name="GetSecondaryActivateTarget" cname="app_indicator_get_secondary_activate_target"> + <return-type type="GtkWidget*" /> + </method> <method name="GetStatus" cname="app_indicator_get_status"> <return-type type="AppIndicatorStatus" /> </method> @@ -215,6 +218,12 @@ <parameter type="guint32" name="ordering_index" /> </parameters> </method> + <method name="SetSecondaryActivateTarget" cname="app_indicator_set_secondary_activate_target"> + <return-type type="void" /> + <parameters> + <parameter type="GtkWidget*" name="menuitem" /> + </parameters> + </method> <method name="SetStatus" cname="app_indicator_set_status"> <return-type type="void" /> <parameters> diff --git a/bindings/vala/examples/indicator-example.vala b/bindings/vala/examples/indicator-example.vala index 621c962..7bb1d7d 100644 --- a/bindings/vala/examples/indicator-example.vala +++ b/bindings/vala/examples/indicator-example.vala @@ -47,14 +47,15 @@ public class IndicatorExample { item.show(); menu.append(item); - item = new MenuItem.with_label("Bar"); + var bar = item = new MenuItem.with_label("Bar"); item.show(); item.activate.connect(() => { - indicator.set_status(IndicatorStatus.ATTENTION); + indicator.set_status(IndicatorStatus.ACTIVE); }); menu.append(item); indicator.set_menu(menu); + indicator.set_secondary_activate_target(bar); win.show_all(); @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for libappindicator 0.3.90. +# Generated by GNU Autoconf 2.68 for libappindicator 0.3.91. # # Report bugs to <http://bugs.launchpad.net/libappindicator>. # @@ -771,8 +771,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libappindicator' PACKAGE_TARNAME='libappindicator' -PACKAGE_VERSION='0.3.90' -PACKAGE_STRING='libappindicator 0.3.90' +PACKAGE_VERSION='0.3.91' +PACKAGE_STRING='libappindicator 0.3.91' PACKAGE_BUGREPORT='http://bugs.launchpad.net/libappindicator' PACKAGE_URL='http://launchpad.net/libappindicator' @@ -1589,7 +1589,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libappindicator 0.3.90 to adapt to many kinds of systems. +\`configure' configures libappindicator 0.3.91 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1659,7 +1659,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libappindicator 0.3.90:";; + short | recursive ) echo "Configuration of libappindicator 0.3.91:";; esac cat <<\_ACEOF @@ -1802,7 +1802,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libappindicator configure 0.3.90 +libappindicator configure 0.3.91 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2082,7 +2082,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libappindicator $as_me 0.3.90, which was +It was created by libappindicator $as_me 0.3.91, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2905,7 +2905,7 @@ fi # Define the identity of the package. PACKAGE='libappindicator' - VERSION='0.3.90' + VERSION='0.3.91' cat >>confdefs.h <<_ACEOF @@ -13507,7 +13507,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libappindicator $as_me 0.3.90, which was +This file was extended by libappindicator $as_me 0.3.91, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -13574,7 +13574,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libappindicator config.status 0.3.90 +libappindicator config.status 0.3.91 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 75c5200..72bb7f6 100644 --- a/configure.ac +++ b/configure.ac @@ -1,5 +1,5 @@ AC_INIT([libappindicator], - [0.3.90], + [0.3.91], [http://bugs.launchpad.net/libappindicator], [libappindicator], [http://launchpad.net/libappindicator]) diff --git a/debian/changelog b/debian/changelog index 33a9da1..18b3f36 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +libappindicator (0.3.91-0ubuntu1~ppa1) UNRELEASED; urgency=low + + * New upstream release. + * Secondary activate support + * Better GIR file annotations + + -- Ted Gould <ted@ubuntu.com> Thu, 11 Aug 2011 12:03:31 -0500 + libappindicator (0.3.90-0ubuntu1) oneiric; urgency=low * debian/control: updated libindicator requirement. diff --git a/docs/reference/html/annotation-glossary.html b/docs/reference/html/annotation-glossary.html index 777b4ff..056cc26 100644 --- a/docs/reference/html/annotation-glossary.html +++ b/docs/reference/html/annotation-glossary.html @@ -19,11 +19,19 @@ <th width="100%" align="center">libappindicator Reference Manual</th> <td> </td> </tr> -<tr><td colspan="5" class="shortcuts"><a class="shortcut" href="#glsT">T</a></td></tr> +<tr><td colspan="5" class="shortcuts"> +<a class="shortcut" href="#glsA">A</a> + | + <a class="shortcut" href="#glsT">T</a> +</td></tr> </table> <div class="glossary"> <div class="titlepage"><div><div><h2 class="title"> <a name="annotation-glossary"></a>Annotation Glossary</h2></div></div></div> +<a name="glsA"></a><h3 class="title">A</h3> +<dt> +<a name="annotation-glossterm-allow-none"></a>allow-none</dt> +<dd><p>NULL is ok, both for passing and for returning.</p></dd> <a name="glsT"></a><h3 class="title">T</h3> <dt> <a name="annotation-glossterm-transfer%20none"></a>transfer none</dt> diff --git a/docs/reference/html/api-index-full.html b/docs/reference/html/api-index-full.html index 376ad9a..9caab8f 100644 --- a/docs/reference/html/api-index-full.html +++ b/docs/reference/html/api-index-full.html @@ -187,6 +187,10 @@ </dt> <dd></dd> <dt> +<a class="link" href="libappindicator-app-indicator.html#app-indicator-get-secondary-activate-target" title="app_indicator_get_secondary_activate_target ()">app_indicator_get_secondary_activate_target</a>, function in <a class="link" href="libappindicator-app-indicator.html" title="AppIndicator">AppIndicator</a> +</dt> +<dd></dd> +<dt> <a class="link" href="libappindicator-app-indicator.html#app-indicator-get-status" title="app_indicator_get_status ()">app_indicator_get_status</a>, function in <a class="link" href="libappindicator-app-indicator.html" title="AppIndicator">AppIndicator</a> </dt> <dd></dd> @@ -235,6 +239,10 @@ </dt> <dd></dd> <dt> +<a class="link" href="libappindicator-app-indicator.html#app-indicator-set-secondary-activate-target" title="app_indicator_set_secondary_activate_target ()">app_indicator_set_secondary_activate_target</a>, function in <a class="link" href="libappindicator-app-indicator.html" title="AppIndicator">AppIndicator</a> +</dt> +<dd></dd> +<dt> <a class="link" href="libappindicator-app-indicator.html#app-indicator-set-status" title="app_indicator_set_status ()">app_indicator_set_status</a>, function in <a class="link" href="libappindicator-app-indicator.html" title="AppIndicator">AppIndicator</a> </dt> <dd></dd> diff --git a/docs/reference/html/ch01.html b/docs/reference/html/ch01.html index 798ff6e..5f4ca0d 100644 --- a/docs/reference/html/ch01.html +++ b/docs/reference/html/ch01.html @@ -24,7 +24,7 @@ <a name="idp4890160"></a>Base Classes for Applications</h2></div></div></div> <div class="toc"><dl><dt> <span class="refentrytitle"><a href="libappindicator-app-indicator.html">AppIndicator</a></span><span class="refpurpose"> — An object to put application information - into the panel.</span> + into the panel.</span> </dt></dl></div> </div> <div class="footer"> diff --git a/docs/reference/html/index.html b/docs/reference/html/index.html index 19fad9c..c6266da 100644 --- a/docs/reference/html/index.html +++ b/docs/reference/html/index.html @@ -24,7 +24,7 @@ <dt><span class="chapter"><a href="ch01.html">Base Classes for Applications</a></span></dt> <dd><dl><dt> <span class="refentrytitle"><a href="libappindicator-app-indicator.html">AppIndicator</a></span><span class="refpurpose"> — An object to put application information - into the panel.</span> + into the panel.</span> </dt></dl></dd> <dt><span class="chapter"><a href="object-tree.html">Object Hierarchy</a></span></dt> <dt><span class="index"><a href="api-index-full.html">API Index</a></span></dt> diff --git a/docs/reference/html/index.sgml b/docs/reference/html/index.sgml index 0875f4f..0dd5e0b 100644 --- a/docs/reference/html/index.sgml +++ b/docs/reference/html/index.sgml @@ -45,6 +45,7 @@ <ANCHOR id="app-indicator-set-icon-theme-path" href="libappindicator/libappindicator-app-indicator.html#app-indicator-set-icon-theme-path"> <ANCHOR id="app-indicator-set-label" href="libappindicator/libappindicator-app-indicator.html#app-indicator-set-label"> <ANCHOR id="app-indicator-set-ordering-index" href="libappindicator/libappindicator-app-indicator.html#app-indicator-set-ordering-index"> +<ANCHOR id="app-indicator-set-secondary-activate-target" href="libappindicator/libappindicator-app-indicator.html#app-indicator-set-secondary-activate-target"> <ANCHOR id="app-indicator-get-id" href="libappindicator/libappindicator-app-indicator.html#app-indicator-get-id"> <ANCHOR id="app-indicator-get-category" href="libappindicator/libappindicator-app-indicator.html#app-indicator-get-category"> <ANCHOR id="app-indicator-get-status" href="libappindicator/libappindicator-app-indicator.html#app-indicator-get-status"> @@ -57,6 +58,7 @@ <ANCHOR id="app-indicator-get-label" href="libappindicator/libappindicator-app-indicator.html#app-indicator-get-label"> <ANCHOR id="app-indicator-get-label-guide" href="libappindicator/libappindicator-app-indicator.html#app-indicator-get-label-guide"> <ANCHOR id="app-indicator-get-ordering-index" href="libappindicator/libappindicator-app-indicator.html#app-indicator-get-ordering-index"> +<ANCHOR id="app-indicator-get-secondary-activate-target" href="libappindicator/libappindicator-app-indicator.html#app-indicator-get-secondary-activate-target"> <ANCHOR id="app-indicator-build-menu-from-desktop" href="libappindicator/libappindicator-app-indicator.html#app-indicator-build-menu-from-desktop"> <ANCHOR id="libappindicator-app-indicator.property-details" href="libappindicator/libappindicator-app-indicator.html#libappindicator-app-indicator.property-details"> <ANCHOR id="AppIndicator--attention-icon-desc" href="libappindicator/libappindicator-app-indicator.html#AppIndicator--attention-icon-desc"> @@ -80,4 +82,5 @@ <ANCHOR id="AppIndicator-new-label" href="libappindicator/libappindicator-app-indicator.html#AppIndicator-new-label"> <ANCHOR id="AppIndicator-new-status" href="libappindicator/libappindicator-app-indicator.html#AppIndicator-new-status"> <ANCHOR id="AppIndicator-scroll-event" href="libappindicator/libappindicator-app-indicator.html#AppIndicator-scroll-event"> +<ANCHOR id="annotation-glossterm-allow-none" href="libappindicator/annotation-glossary.html#annotation-glossterm-allow-none"> <ANCHOR id="annotation-glossterm-transfer none" href="libappindicator/annotation-glossary.html#annotation-glossterm-transfer none"> diff --git a/docs/reference/html/libappindicator-app-indicator.html b/docs/reference/html/libappindicator-app-indicator.html index 2db5f13..987bc2d 100644 --- a/docs/reference/html/libappindicator-app-indicator.html +++ b/docs/reference/html/libappindicator-app-indicator.html @@ -38,7 +38,7 @@ <td valign="top"> <h2><span class="refentrytitle"><a name="libappindicator-app-indicator.top_of_page"></a>AppIndicator</span></h2> <p>AppIndicator — An object to put application information - into the panel.</p> + into the panel.</p> </td> <td valign="top" align="right"></td> </tr></table></div> @@ -99,6 +99,9 @@ struct <a class="link" href="libappindicator-app-indicator.html#App <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *guide</code></em>); <span class="returnvalue">void</span> <a class="link" href="libappindicator-app-indicator.html#app-indicator-set-ordering-index" title="app_indicator_set_ordering_index ()">app_indicator_set_ordering_index</a> (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>, <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> ordering_index</code></em>); +<span class="returnvalue">void</span> <a class="link" href="libappindicator-app-indicator.html#app-indicator-set-secondary-activate-target" title="app_indicator_set_secondary_activate_target ()">app_indicator_set_secondary_activate_target</a> + (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a> *menuitem</code></em>); const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libappindicator-app-indicator.html#app-indicator-get-id" title="app_indicator_get_id ()">app_indicator_get_id</a> (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>); <a class="link" href="libappindicator-app-indicator.html#AppIndicatorCategory" title="enum AppIndicatorCategory"><span class="returnvalue">AppIndicatorCategory</span></a> <a class="link" href="libappindicator-app-indicator.html#app-indicator-get-category" title="app_indicator_get_category ()">app_indicator_get_category</a> (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>); <a class="link" href="libappindicator-app-indicator.html#AppIndicatorStatus" title="enum AppIndicatorStatus"><span class="returnvalue">AppIndicatorStatus</span></a> <a class="link" href="libappindicator-app-indicator.html#app-indicator-get-status" title="app_indicator_get_status ()">app_indicator_get_status</a> (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>); @@ -117,6 +120,8 @@ const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.htm const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * <a class="link" href="libappindicator-app-indicator.html#app-indicator-get-label-guide" title="app_indicator_get_label_guide ()">app_indicator_get_label_guide</a> (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>); <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="libappindicator-app-indicator.html#app-indicator-get-ordering-index" title="app_indicator_get_ordering_index ()">app_indicator_get_ordering_index</a> (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>); +<a href="http://library.gnome.org/devel/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="libappindicator-app-indicator.html#app-indicator-get-secondary-activate-target" title="app_indicator_get_secondary_activate_target ()">app_indicator_get_secondary_activate_target</a> + (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>); <span class="returnvalue">void</span> <a class="link" href="libappindicator-app-indicator.html#app-indicator-build-menu-from-desktop" title="app_indicator_build_menu_from_desktop ()">app_indicator_build_menu_from_desktop</a> (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>, <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *desktop_file</code></em>, @@ -164,13 +169,13 @@ const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.htm <a name="libappindicator-app-indicator.description"></a><h2>Description</h2> <p> An application indicator is a way for an application to put - a menu into the panel on the user's screen. This allows the - user to interact with the application even though it might - not be visible to the user at the time. In most cases this - is not a good solution as there are other ways to inform the - user. It should only be use if persistence is a desired - feature for the user (not for your marketing purpose of - having your logo in the panel). +a menu into the panel on the user's screen. This allows the +user to interact with the application even though it might +not be visible to the user at the time. In most cases this +is not a good solution as there are other ways to inform the +user. It should only be use if persistence is a desired +feature for the user (not for your marketing purpose of +having your logo in the panel). </p> </div> <div class="refsect1"> @@ -340,7 +345,7 @@ String identifier for the <a class="link" href="libappindicator-app-indicator.ht </pre> <p> The category provides grouping for the indicators so that - users can find indicators that are similar together. +users can find indicators that are similar together. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -384,9 +389,9 @@ The category provides grouping for the indicators so that </pre> <p> These are the states that the indicator can be on in - the user's panel. The indicator by default starts - in the state <em class="parameter"><code>APP_INDICATOR_STATUS_PASSIVE</code></em> and can be - shown by setting it to <em class="parameter"><code>APP_INDICATOR_STATUS_ACTIVE</code></em>. +the user's panel. The indicator by default starts +in the state <em class="parameter"><code>APP_INDICATOR_STATUS_PASSIVE</code></em> and can be +shown by setting it to <em class="parameter"><code>APP_INDICATOR_STATUS_ACTIVE</code></em>. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -414,8 +419,14 @@ These are the states that the indicator can be on in <a name="AppIndicatorPrivate"></a><h3>AppIndicatorPrivate</h3> <pre class="programlisting">typedef struct _AppIndicatorPrivate AppIndicatorPrivate;</pre> <p> -All of the private data in an instance of a - application indicator. +Private Fields +<em class="parameter"><code>id</code></em>: The ID of the indicator. Maps to AppIndicator:id. +<em class="parameter"><code>category</code></em>: Which category the indicator is. Maps to AppIndicator:category. +<em class="parameter"><code>status</code></em>: The status of the indicator. Maps to AppIndicator:status. +<em class="parameter"><code>icon_name</code></em>: The name of the icon to use. Maps to AppIndicator:icon-name. +<em class="parameter"><code>attention_icon_name</code></em>: The name of the attention icon to use. Maps to AppIndicator:attention-icon-name. +<em class="parameter"><code>menu</code></em>: The menu for this indicator. Maps to AppIndicator:menu +<em class="parameter"><code>watcher_proxy</code></em>: The proxy connection to the watcher we're connected to. If we're not connected to one this will be <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. </p> </div> <hr> @@ -423,10 +434,8 @@ All of the private data in an instance of a <a name="AppIndicator-struct"></a><h3>AppIndicator</h3> <pre class="programlisting">typedef struct _AppIndicator AppIndicator;</pre> <p> -A application indicator represents the values that are needed to show a - unique status in the panel for an application. In general, applications - should try to fit in the other indicators that are available on the - panel before using this. But, sometimes it is necissary. +Whether the indicator is shown or requests attention. Defaults to +'Passive'. </p> </div> <hr> @@ -480,7 +489,7 @@ A application indicator represents the values that are needed to show a </pre> <p> The signals and external functions that make up the <a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> - class object. +class object. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -583,9 +592,8 @@ Generates or returns the unique <a href="http://library.gnome.org/devel/gobject/ <em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicatorCategory" title="enum AppIndicatorCategory"><span class="type">AppIndicatorCategory</span></a> category</code></em>);</pre> <p> Creates a new <a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> setting the properties: - <a class="link" href="libappindicator-app-indicator.html#AppIndicator--id" title='The "id" property'><span class="type">"id"</span></a> with <em class="parameter"><code>id</code></em>, <a class="link" href="libappindicator-app-indicator.html#AppIndicator--category" title='The "category" property'><span class="type">"category"</span></a> - with <em class="parameter"><code>category</code></em> and <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> with - <em class="parameter"><code>icon_name</code></em>. +<a class="link" href="libappindicator-app-indicator.html#AppIndicator--id" title='The "id" property'><span class="type">"id"</span></a> with <em class="parameter"><code>id</code></em>, <a class="link" href="libappindicator-app-indicator.html#AppIndicator--category" title='The "category" property'><span class="type">"category"</span></a> with <em class="parameter"><code>category</code></em> +and <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> with <em class="parameter"><code>icon_name</code></em>. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -618,9 +626,9 @@ Creates a new <a class="link" href="libappindicator-app-indicator.html#AppIndica <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *icon_theme_path</code></em>);</pre> <p> Creates a new <a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> setting the properties: - <a class="link" href="libappindicator-app-indicator.html#AppIndicator--id" title='The "id" property'><span class="type">"id"</span></a> with <em class="parameter"><code>id</code></em>, <a class="link" href="libappindicator-app-indicator.html#AppIndicator--category" title='The "category" property'><span class="type">"category"</span></a> - with <em class="parameter"><code>category</code></em>, <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> with - <em class="parameter"><code>icon_name</code></em> and <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-theme-path" title='The "icon-theme-path" property'><span class="type">"icon-theme-path"</span></a> with <em class="parameter"><code>icon_theme_path</code></em>. +<a class="link" href="libappindicator-app-indicator.html#AppIndicator--id" title='The "id" property'><span class="type">"id"</span></a> with <em class="parameter"><code>id</code></em>, <a class="link" href="libappindicator-app-indicator.html#AppIndicator--category" title='The "category" property'><span class="type">"category"</span></a> with <em class="parameter"><code>category</code></em>, +<a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> with <em class="parameter"><code>icon_name</code></em> and <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-theme-path" title='The "icon-theme-path" property'><span class="type">"icon-theme-path"</span></a> +with <em class="parameter"><code>icon_theme_path</code></em>. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -681,7 +689,7 @@ Wrapper function for property <a class="link" href="libappindicator-app-indicato </div> <p> Wrapper for <a class="link" href="libappindicator-app-indicator.html#app-indicator-set-attention-icon-full" title="app_indicator_set_attention_icon_full ()"><code class="function">app_indicator_set_attention_icon_full()</code></a> with a NULL - description. +description. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -732,10 +740,11 @@ Wrapper function for property <a class="link" href="libappindicator-app-indicato <em class="parameter"><code><a href="http://library.gnome.org/devel/gtk/GtkMenu.html"><span class="type">GtkMenu</span></a> *menu</code></em>);</pre> <p> Sets the menu that should be shown when the Application Indicator - is clicked on in the panel. An application indicator will not - be rendered unless it has a menu. - - Wrapper function for property <span class="type">"menu"</span>. +is clicked on in the panel. An application indicator will not +be rendered unless it has a menu. +</p> +<p> +Wrapper function for property <span class="type">"menu"</span>. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -747,7 +756,8 @@ Sets the menu that should be shown when the Application Indicator </tr> <tr> <td><p><span class="term"><em class="parameter"><code>menu</code></em> :</span></p></td> -<td>A <a href="http://library.gnome.org/devel/gtk/GtkMenu.html"><span class="type">GtkMenu</span></a> to set</td> +<td>A <a href="http://library.gnome.org/devel/gtk/GtkMenu.html"><span class="type">GtkMenu</span></a> to set. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> +</td> </tr> </tbody> </table></div> @@ -763,7 +773,7 @@ Sets the menu that should be shown when the Application Indicator </div> <p> Wrapper function for <a class="link" href="libappindicator-app-indicator.html#app-indicator-set-icon-full" title="app_indicator_set_icon_full ()"><code class="function">app_indicator_set_icon_full()</code></a> with a NULL - description. +description. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -787,12 +797,12 @@ Wrapper function for <a class="link" href="libappindicator-app-indicator.html#ap <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *icon_desc</code></em>);</pre> <p> Sets the default icon to use when the status is active but - not set to attention. In most cases, this should be the - application icon for the program. +not set to attention. In most cases, this should be the +application icon for the program. </p> <p> - Wrapper function for property <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> and - <span class="type">"icon-desc"</span>. +Wrapper function for property <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> and +<span class="type">"icon-desc"</span>. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -842,8 +852,8 @@ Sets the path to use when searching for icons. <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *guide</code></em>);</pre> <p> This is a wrapper function for the <a class="link" href="libappindicator-app-indicator.html#AppIndicator--label" title='The "label" property'><span class="type">"label"</span></a> and - <span class="type">"guide"</span> properties. This function can take <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> - as either <em class="parameter"><code>label</code></em> or <em class="parameter"><code>guide</code></em> and will clear the entries. +<span class="type">"guide"</span> properties. This function can take <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><span class="type">NULL</span></a> +as either <em class="parameter"><code>label</code></em> or <em class="parameter"><code>guide</code></em> and will clear the entries. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -870,11 +880,11 @@ This is a wrapper function for the <a class="link" href="libappindicator-app-ind <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="type">guint32</span></a> ordering_index</code></em>);</pre> <p> Sets the ordering index for the app indicator which effects the - placement of it on the panel. For almost all app indicator - this is not the function you're looking for. +placement of it on the panel. For almost all app indicator +this is not the function you're looking for. </p> <p> - Wrapper function for property <a class="link" href="libappindicator-app-indicator.html#AppIndicator--ordering-index" title='The "ordering-index" property'><span class="type">"ordering-index"</span></a>. +Wrapper function for property <a class="link" href="libappindicator-app-indicator.html#AppIndicator--ordering-index" title='The "ordering-index" property'><span class="type">"ordering-index"</span></a>. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -893,6 +903,40 @@ Sets the ordering index for the app indicator which effects the </div> <hr> <div class="refsect2"> +<a name="app-indicator-set-secondary-activate-target"></a><h3>app_indicator_set_secondary_activate_target ()</h3> +<pre class="programlisting"><span class="returnvalue">void</span> app_indicator_set_secondary_activate_target + (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>, + <em class="parameter"><code><a href="http://library.gnome.org/devel/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a> *menuitem</code></em>);</pre> +<p> +Set the <em class="parameter"><code>menuitem</code></em> to be activated when a secondary activation event (i.e. a +middle-click) is emitted over the <a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> icon/label. +</p> +<p> +The <em class="parameter"><code>menuitem</code></em> can be also a complex <a href="http://library.gnome.org/devel/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a>, but to get activated when +a secondary activation occurs in the <span class="type">Appindicator</span>, it must be a visible and +active child (or inner-child) of the <span class="type">"menu"</span>. +</p> +<p> +Setting <em class="parameter"><code>menuitem</code></em> to <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> causes to disable this feature. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td> +<td>The <a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> +</td> +</tr> +<tr> +<td><p><span class="term"><em class="parameter"><code>menuitem</code></em> :</span></p></td> +<td>A <a href="http://library.gnome.org/devel/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a> to be activated on secondary activation. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> +</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> <a name="app-indicator-get-id"></a><h3>app_indicator_get_id ()</h3> <pre class="programlisting">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> * app_indicator_get_id (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>);</pre> <p> @@ -1069,7 +1113,7 @@ Wrapper function for property <a class="link" href="libappindicator-app-indicato <pre class="programlisting"><a href="http://library.gnome.org/devel/gtk/GtkMenu.html"><span class="returnvalue">GtkMenu</span></a> * app_indicator_get_menu (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>);</pre> <p> Gets the menu being used for this application indicator. - Wrapper function for property <span class="type">"menu"</span>. +Wrapper function for property <span class="type">"menu"</span>. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -1153,6 +1197,29 @@ Wrapper function for property <a class="link" href="libappindicator-app-indicato </div> <hr> <div class="refsect2"> +<a name="app-indicator-get-secondary-activate-target"></a><h3>app_indicator_get_secondary_activate_target ()</h3> +<pre class="programlisting"><a href="http://library.gnome.org/devel/gtk/GtkWidget.html"><span class="returnvalue">GtkWidget</span></a> * app_indicator_get_secondary_activate_target + (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>);</pre> +<p> +Gets the menuitem being called on secondary-activate event. +</p> +<div class="variablelist"><table border="0"> +<col align="left" valign="top"> +<tbody> +<tr> +<td><p><span class="term"><em class="parameter"><code>self</code></em> :</span></p></td> +<td>The <a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> object to use</td> +</tr> +<tr> +<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> +<td>A <a href="http://library.gnome.org/devel/gtk/GtkWidget.html"><span class="type">GtkWidget</span></a> object or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if none has been set. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> +</td> +</tr> +</tbody> +</table></div> +</div> +<hr> +<div class="refsect2"> <a name="app-indicator-build-menu-from-desktop"></a><h3>app_indicator_build_menu_from_desktop ()</h3> <pre class="programlisting"><span class="returnvalue">void</span> app_indicator_build_menu_from_desktop (<em class="parameter"><code><a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *self</code></em>, @@ -1160,7 +1227,7 @@ Wrapper function for property <a class="link" href="libappindicator-app-indicato <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *desktop_profile</code></em>);</pre> <p> This function allows for building the Application Indicator menu - from a static desktop file. +from a static desktop file. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -1188,7 +1255,7 @@ This function allows for building the Application Indicator menu <pre class="programlisting"> "attention-icon-desc" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre> <p> If the indicator sets it's status to <a class="link" href="libappindicator-app-indicator.html#APP-INDICATOR-STATUS-ATTENTION:CAPS"><code class="literal">APP_INDICATOR_STATUS_ATTENTION</code></a> - then this textual description of the icon shown. +then this textual description of the icon shown. </p> <p>Default value: NULL</p> </div> @@ -1198,7 +1265,7 @@ If the indicator sets it's status to <a class="link" href="libappindicator-app-i <pre class="programlisting"> "attention-icon-name" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre> <p> If the indicator sets it's status to <a class="link" href="libappindicator-app-indicator.html#APP-INDICATOR-STATUS-ATTENTION:CAPS"><code class="literal">APP_INDICATOR_STATUS_ATTENTION</code></a> - then this icon is shown. +then this icon is shown. </p> <p>Default value: NULL</p> </div> @@ -1208,7 +1275,7 @@ If the indicator sets it's status to <a class="link" href="libappindicator-app-i <pre class="programlisting"> "category" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre> <p> The type of indicator that this represents. Please don't use 'Other'. - Defaults to 'ApplicationStatus'. +Defaults to 'ApplicationStatus'. </p> <p>Default value: NULL</p> </div> @@ -1218,7 +1285,7 @@ The type of indicator that this represents. Please don't use 'Other'. <pre class="programlisting"> "connected" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> : Read</pre> <p> Pretty simple, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if we have a reasonable expectation of being - displayed through this object. You should hide your TrayIcon if so. +displayed through this object. You should hide your TrayIcon if so. </p> <p>Default value: FALSE</p> </div> @@ -1228,7 +1295,7 @@ Pretty simple, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standa <pre class="programlisting"> "dbus-menu-server" <a href="/usr/share/gtk-doc/html/libdbusmenu-glib/libdbusmenu-glib-DbusmenuServer.html#DbusmenuServer"><span class="type">DbusmenuServer</span></a>* : Read / Write</pre> <p> A way to get the internal dbusmenu server if it is available. - This should only be used for testing. +This should only be used for testing. </p> </div> <hr> @@ -1255,7 +1322,7 @@ The name of the regular icon that is shown for the indicator. <pre class="programlisting"> "icon-theme-path" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct</pre> <p> An additional place to look for icon names that may be installed by the - application. +application. </p> <p>Default value: NULL</p> </div> @@ -1265,7 +1332,7 @@ An additional place to look for icon names that may be installed by the <pre class="programlisting"> "id" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write / Construct Only</pre> <p> The ID for this indicator, which should be unique, but used consistently - by this program and its indicator. +by this program and its indicator. </p> <p>Default value: NULL</p> </div> @@ -1275,11 +1342,11 @@ The ID for this indicator, which should be unique, but used consistently <pre class="programlisting"> "label" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre> <p> A label that can be shown next to the string in the application - indicator. The label will not be shown unless there is an icon - as well. The label is useful for numerical and other frequently - updated information. In general, it shouldn't be shown unless a - user requests it as it can take up a significant amount of space - on the user's panel. This may not be shown in all visualizations. +indicator. The label will not be shown unless there is an icon +as well. The label is useful for numerical and other frequently +updated information. In general, it shouldn't be shown unless a +user requests it as it can take up a significant amount of space +on the user's panel. This may not be shown in all visualizations. </p> <p>Default value: NULL</p> </div> @@ -1289,12 +1356,12 @@ A label that can be shown next to the string in the application <pre class="programlisting"> "label-guide" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre> <p> An optional string to provide guidance to the panel on how big - the <a class="link" href="libappindicator-app-indicator.html#AppIndicator--label" title='The "label" property'><span class="type">"label"</span></a> string could get. If this is set correctly - then the panel should never 'jiggle' as the string adjusts through - out the range of options. For instance, if you were providing a - percentage like "54% thrust" in <a class="link" href="libappindicator-app-indicator.html#AppIndicator--label" title='The "label" property'><span class="type">"label"</span></a> you'd want to - set this string to "100% thrust" to ensure space when Scotty can - get you enough power. +the <a class="link" href="libappindicator-app-indicator.html#AppIndicator--label" title='The "label" property'><span class="type">"label"</span></a> string could get. If this is set correctly +then the panel should never 'jiggle' as the string adjusts through +out the range of options. For instance, if you were providing a +percentage like "54% thrust" in <a class="link" href="libappindicator-app-indicator.html#AppIndicator--label" title='The "label" property'><span class="type">"label"</span></a> you'd want to +set this string to "100% thrust" to ensure space when Scotty can +get you enough power. </p> <p>Default value: NULL</p> </div> @@ -1304,13 +1371,13 @@ An optional string to provide guidance to the panel on how big <pre class="programlisting"> "ordering-index" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> : Read / Write</pre> <p> The ordering index is an odd parameter, and if you think you don't need - it you're probably right. In general, the application indicator try - to place the applications in a recreatable place taking into account - which category they're in to try and group them. But, there are some - cases where you'd want to ensure indicators are next to each other. - To do that you can override the generated ordering index and replace it - with a new one. Again, you probably don't want to be doing this, but - in case you do, this is the way. +it you're probably right. In general, the application indicator try +to place the applications in a recreatable place taking into account +which category they're in to try and group them. But, there are some +cases where you'd want to ensure indicators are next to each other. +To do that you can override the generated ordering index and replace it +with a new one. Again, you probably don't want to be doing this, but +in case you do, this is the way. </p> <p>Default value: 0</p> </div> @@ -1318,10 +1385,7 @@ The ordering index is an odd parameter, and if you think you don't need <div class="refsect2"> <a name="AppIndicator--status"></a><h3>The <code class="literal">"status"</code> property</h3> <pre class="programlisting"> "status" <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a>* : Read / Write</pre> -<p> -Whether the indicator is shown or requests attention. Defaults to - 'Passive'. -</p> +<p>Whether the indicator is shown or requests attention. Defaults to 'Passive'.</p> <p>Default value: NULL</p> </div> </div> @@ -1381,7 +1445,7 @@ Emitted when <a class="link" href="libappindicator-app-indicator.html#AppIndicat <pre class="programlisting"><span class="returnvalue">void</span> user_function (<a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> *arg0, <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre> <p> -Emitted when <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> is changed +when <a class="link" href="libappindicator-app-indicator.html#AppIndicator--icon-name" title='The "icon-name" property'><span class="type">"icon-name"</span></a> is changed </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -1405,7 +1469,7 @@ Emitted when <a class="link" href="libappindicator-app-indicator.html#AppIndicat <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre> <p> Signaled when there is a new icon set for the - object. +object. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -1430,7 +1494,7 @@ Signaled when there is a new icon set for the <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre> <p> Emitted when either <a class="link" href="libappindicator-app-indicator.html#AppIndicator--label" title='The "label" property'><span class="type">"label"</span></a> or <a class="link" href="libappindicator-app-indicator.html#AppIndicator--label-guide" title='The "label-guide" property'><span class="type">"label-guide"</span></a> are - changed. +changed. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> @@ -1489,8 +1553,7 @@ Emitted when <a class="link" href="libappindicator-app-indicator.html#AppIndicat <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> arg2, <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data) : <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#G-SIGNAL-RUN-LAST:CAPS"><code class="literal">Run Last</code></a></pre> <p> -Signaled when there is a new icon set for the - object. +Signaled when the <a class="link" href="libappindicator-app-indicator.html#AppIndicator"><span class="type">AppIndicator</span></a> receives a scroll event. </p> <div class="variablelist"><table border="0"> <col align="left" valign="top"> diff --git a/docs/reference/html/libappindicator.devhelp b/docs/reference/html/libappindicator.devhelp index fe5a1ef..d1da5e2 100644 --- a/docs/reference/html/libappindicator.devhelp +++ b/docs/reference/html/libappindicator.devhelp @@ -41,6 +41,7 @@ <function name="app_indicator_set_icon_theme_path ()" link="libappindicator-app-indicator.html#app-indicator-set-icon-theme-path"/> <function name="app_indicator_set_label ()" link="libappindicator-app-indicator.html#app-indicator-set-label"/> <function name="app_indicator_set_ordering_index ()" link="libappindicator-app-indicator.html#app-indicator-set-ordering-index"/> + <function name="app_indicator_set_secondary_activate_target ()" link="libappindicator-app-indicator.html#app-indicator-set-secondary-activate-target"/> <function name="app_indicator_get_id ()" link="libappindicator-app-indicator.html#app-indicator-get-id"/> <function name="app_indicator_get_category ()" link="libappindicator-app-indicator.html#app-indicator-get-category"/> <function name="app_indicator_get_status ()" link="libappindicator-app-indicator.html#app-indicator-get-status"/> @@ -53,6 +54,7 @@ <function name="app_indicator_get_label ()" link="libappindicator-app-indicator.html#app-indicator-get-label"/> <function name="app_indicator_get_label_guide ()" link="libappindicator-app-indicator.html#app-indicator-get-label-guide"/> <function name="app_indicator_get_ordering_index ()" link="libappindicator-app-indicator.html#app-indicator-get-ordering-index"/> + <function name="app_indicator_get_secondary_activate_target ()" link="libappindicator-app-indicator.html#app-indicator-get-secondary-activate-target"/> <function name="app_indicator_build_menu_from_desktop ()" link="libappindicator-app-indicator.html#app-indicator-build-menu-from-desktop"/> <function name="The "attention-icon-desc" property" link="libappindicator-app-indicator.html#AppIndicator--attention-icon-desc"/> <function name="The "attention-icon-name" property" link="libappindicator-app-indicator.html#AppIndicator--attention-icon-name"/> diff --git a/docs/reference/html/libappindicator.devhelp2 b/docs/reference/html/libappindicator.devhelp2 index 516ae2a..be74185 100644 --- a/docs/reference/html/libappindicator.devhelp2 +++ b/docs/reference/html/libappindicator.devhelp2 @@ -41,6 +41,7 @@ <keyword type="function" name="app_indicator_set_icon_theme_path ()" link="libappindicator-app-indicator.html#app-indicator-set-icon-theme-path"/> <keyword type="function" name="app_indicator_set_label ()" link="libappindicator-app-indicator.html#app-indicator-set-label"/> <keyword type="function" name="app_indicator_set_ordering_index ()" link="libappindicator-app-indicator.html#app-indicator-set-ordering-index"/> + <keyword type="function" name="app_indicator_set_secondary_activate_target ()" link="libappindicator-app-indicator.html#app-indicator-set-secondary-activate-target"/> <keyword type="function" name="app_indicator_get_id ()" link="libappindicator-app-indicator.html#app-indicator-get-id"/> <keyword type="function" name="app_indicator_get_category ()" link="libappindicator-app-indicator.html#app-indicator-get-category"/> <keyword type="function" name="app_indicator_get_status ()" link="libappindicator-app-indicator.html#app-indicator-get-status"/> @@ -53,6 +54,7 @@ <keyword type="function" name="app_indicator_get_label ()" link="libappindicator-app-indicator.html#app-indicator-get-label"/> <keyword type="function" name="app_indicator_get_label_guide ()" link="libappindicator-app-indicator.html#app-indicator-get-label-guide"/> <keyword type="function" name="app_indicator_get_ordering_index ()" link="libappindicator-app-indicator.html#app-indicator-get-ordering-index"/> + <keyword type="function" name="app_indicator_get_secondary_activate_target ()" link="libappindicator-app-indicator.html#app-indicator-get-secondary-activate-target"/> <keyword type="function" name="app_indicator_build_menu_from_desktop ()" link="libappindicator-app-indicator.html#app-indicator-build-menu-from-desktop"/> <keyword type="property" name="The "attention-icon-desc" property" link="libappindicator-app-indicator.html#AppIndicator--attention-icon-desc"/> <keyword type="property" name="The "attention-icon-name" property" link="libappindicator-app-indicator.html#AppIndicator--attention-icon-name"/> diff --git a/docs/reference/libappindicator-docs.sgml b/docs/reference/libappindicator-docs.sgml index 75ddc0c..9d56066 100644 --- a/docs/reference/libappindicator-docs.sgml +++ b/docs/reference/libappindicator-docs.sgml @@ -8,7 +8,7 @@ <bookinfo> <title>libappindicator Reference Manual</title> <releaseinfo> - for libappindicator 0.3.90 + for libappindicator 0.3.91 </releaseinfo> </bookinfo> diff --git a/docs/reference/libappindicator-sections.txt b/docs/reference/libappindicator-sections.txt index da05f40..6f09364 100644 --- a/docs/reference/libappindicator-sections.txt +++ b/docs/reference/libappindicator-sections.txt @@ -31,6 +31,7 @@ app_indicator_set_icon_full app_indicator_set_icon_theme_path app_indicator_set_label app_indicator_set_ordering_index +app_indicator_set_secondary_activate_target app_indicator_get_id app_indicator_get_category app_indicator_get_status @@ -43,6 +44,7 @@ app_indicator_get_menu app_indicator_get_label app_indicator_get_label_guide app_indicator_get_ordering_index +app_indicator_get_secondary_activate_target app_indicator_build_menu_from_desktop </SECTION> diff --git a/docs/reference/tmpl/app-indicator.sgml b/docs/reference/tmpl/app-indicator.sgml index cebd2eb..3accdd6 100644 --- a/docs/reference/tmpl/app-indicator.sgml +++ b/docs/reference/tmpl/app-indicator.sgml @@ -408,6 +408,15 @@ AppIndicator @ordering_index: +<!-- ##### FUNCTION app_indicator_set_secondary_activate_target ##### --> +<para> + +</para> + +@self: +@menuitem: + + <!-- ##### FUNCTION app_indicator_get_id ##### --> <para> @@ -516,6 +525,15 @@ AppIndicator @Returns: +<!-- ##### FUNCTION app_indicator_get_secondary_activate_target ##### --> +<para> + +</para> + +@self: +@Returns: + + <!-- ##### FUNCTION app_indicator_build_menu_from_desktop ##### --> <para> diff --git a/docs/reference/version.xml b/docs/reference/version.xml index 3d7f615..15edd7c 100644 --- a/docs/reference/version.xml +++ b/docs/reference/version.xml @@ -1 +1 @@ -0.3.90 +0.3.91 diff --git a/docs/reference/xml/annotation-glossary.xml b/docs/reference/xml/annotation-glossary.xml index f0417a4..5b5b53b 100644 --- a/docs/reference/xml/annotation-glossary.xml +++ b/docs/reference/xml/annotation-glossary.xml @@ -7,6 +7,14 @@ <glossary id="annotation-glossary"> <title>Annotation Glossary</title> +<glossdiv><title>A</title> + <glossentry> + <glossterm><anchor id="annotation-glossterm-allow-none"/>allow-none</glossterm> + <glossdef> + <para>NULL is ok, both for passing and for returning.</para> + </glossdef> + </glossentry> +</glossdiv> <glossdiv><title>T</title> <glossentry> <glossterm><anchor id="annotation-glossterm-transfer none"/>transfer none</glossterm> diff --git a/docs/reference/xml/api-index-full.xml b/docs/reference/xml/api-index-full.xml index 1ede231..d4079d2 100644 --- a/docs/reference/xml/api-index-full.xml +++ b/docs/reference/xml/api-index-full.xml @@ -46,6 +46,7 @@ <indexentry><primaryie linkends="app-indicator-get-label-guide"><link linkend="app-indicator-get-label-guide">app_indicator_get_label_guide</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-get-menu"><link linkend="app-indicator-get-menu">app_indicator_get_menu</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-get-ordering-index"><link linkend="app-indicator-get-ordering-index">app_indicator_get_ordering_index</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> +<indexentry><primaryie linkends="app-indicator-get-secondary-activate-target"><link linkend="app-indicator-get-secondary-activate-target">app_indicator_get_secondary_activate_target</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-get-status"><link linkend="app-indicator-get-status">app_indicator_get_status</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-get-type"><link linkend="app-indicator-get-type">app_indicator_get_type</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-new"><link linkend="app-indicator-new">app_indicator_new</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> @@ -58,6 +59,7 @@ <indexentry><primaryie linkends="app-indicator-set-label"><link linkend="app-indicator-set-label">app_indicator_set_label</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-set-menu"><link linkend="app-indicator-set-menu">app_indicator_set_menu</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-set-ordering-index"><link linkend="app-indicator-set-ordering-index">app_indicator_set_ordering_index</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> +<indexentry><primaryie linkends="app-indicator-set-secondary-activate-target"><link linkend="app-indicator-set-secondary-activate-target">app_indicator_set_secondary_activate_target</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="app-indicator-set-status"><link linkend="app-indicator-set-status">app_indicator_set_status</link>, function in <link linkend="libappindicator-app-indicator">AppIndicator</link></primaryie></indexentry> <indexentry><primaryie linkends="APP-INDICATOR-SIGNAL-CONNECTION-CHANGED:CAPS"><link linkend="APP-INDICATOR-SIGNAL-CONNECTION-CHANGED:CAPS">APP_INDICATOR_SIGNAL_CONNECTION_CHANGED</link>, macro in <link linkend="libappindicator-app-indicator">app-indicator</link></primaryie></indexentry> <indexentry><primaryie linkends="APP-INDICATOR-SIGNAL-NEW-ATTENTION-ICON:CAPS"><link linkend="APP-INDICATOR-SIGNAL-NEW-ATTENTION-ICON:CAPS">APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON</link>, macro in <link linkend="libappindicator-app-indicator">app-indicator</link></primaryie></indexentry> diff --git a/docs/reference/xml/app-indicator.xml b/docs/reference/xml/app-indicator.xml index f4cc3f9..3c802dc 100644 --- a/docs/reference/xml/app-indicator.xml +++ b/docs/reference/xml/app-indicator.xml @@ -15,7 +15,7 @@ <refnamediv> <refname>AppIndicator</refname> <refpurpose>An object to put application information - into the panel.</refpurpose> + into the panel.</refpurpose> </refnamediv> <refsect1 id="libappindicator-app-indicator.stability-level"> <title>Stability Level</title> @@ -76,6 +76,9 @@ struct <link linkend="AppIndicatorClass">AppIndicatorClass</link>; <parameter>const <link linkend="gchar"><type>gchar</type></link> *guide</parameter>); <link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="app-indicator-set-ordering-index">app_indicator_set_ordering_index</link> (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>, <parameter><link linkend="guint32"><type>guint32</type></link> ordering_index</parameter>); +<link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="app-indicator-set-secondary-activate-target">app_indicator_set_secondary_activate_target</link> + (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>, + <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *menuitem</parameter>); const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> * <link linkend="app-indicator-get-id">app_indicator_get_id</link> (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>); <link linkend="AppIndicatorCategory"><returnvalue>AppIndicatorCategory</returnvalue></link> <link linkend="app-indicator-get-category">app_indicator_get_category</link> (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>); <link linkend="AppIndicatorStatus"><returnvalue>AppIndicatorStatus</returnvalue></link> <link linkend="app-indicator-get-status">app_indicator_get_status</link> (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>); @@ -94,6 +97,8 @@ const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> * const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> * <link linkend="app-indicator-get-label-guide">app_indicator_get_label_guide</link> (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>); <link linkend="guint32"><returnvalue>guint32</returnvalue></link> <link linkend="app-indicator-get-ordering-index">app_indicator_get_ordering_index</link> (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>); +<link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link> * <link linkend="app-indicator-get-secondary-activate-target">app_indicator_get_secondary_activate_target</link> + (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>); <link linkend="void"><returnvalue>void</returnvalue></link> <link linkend="app-indicator-build-menu-from-desktop">app_indicator_build_menu_from_desktop</link> (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>, <parameter>const <link linkend="gchar"><type>gchar</type></link> *desktop_file</parameter>, @@ -142,13 +147,13 @@ const <link linkend="gchar"><returnvalue>gchar</returnvalue></link> * <title role="desc.title">Description</title> <para> An application indicator is a way for an application to put - a menu into the panel on the user's screen. This allows the - user to interact with the application even though it might - not be visible to the user at the time. In most cases this - is not a good solution as there are other ways to inform the - user. It should only be use if persistence is a desired - feature for the user (not for your marketing purpose of - having your logo in the panel). +a menu into the panel on the user's screen. This allows the +user to interact with the application even though it might +not be visible to the user at the time. In most cases this +is not a good solution as there are other ways to inform the +user. It should only be use if persistence is a desired +feature for the user (not for your marketing purpose of +having your logo in the panel). </para> </refsect1> <refsect1 id="libappindicator-app-indicator.details" role="details"> @@ -285,7 +290,7 @@ String identifier for the <link linkend="AppIndicator-scroll-event"><type>"scrol </programlisting> <para> The category provides grouping for the indicators so that - users can find indicators that are similar together. +users can find indicators that are similar together. </para><variablelist role="enum"> <varlistentry id="APP-INDICATOR-CATEGORY-APPLICATION-STATUS:CAPS" role="constant"> <term><literal>APP_INDICATOR_CATEGORY_APPLICATION_STATUS</literal></term> @@ -324,9 +329,9 @@ The category provides grouping for the indicators so that </programlisting> <para> These are the states that the indicator can be on in - the user's panel. The indicator by default starts - in the state <parameter>APP_INDICATOR_STATUS_PASSIVE</parameter> and can be - shown by setting it to <parameter>APP_INDICATOR_STATUS_ACTIVE</parameter>. +the user's panel. The indicator by default starts +in the state <parameter>APP_INDICATOR_STATUS_PASSIVE</parameter> and can be +shown by setting it to <parameter>APP_INDICATOR_STATUS_ACTIVE</parameter>. </para><variablelist role="enum"> <varlistentry id="APP-INDICATOR-STATUS-PASSIVE:CAPS" role="constant"> <term><literal>APP_INDICATOR_STATUS_PASSIVE</literal></term> @@ -349,18 +354,22 @@ These are the states that the indicator can be on in <indexterm zone="AppIndicatorPrivate"><primary>AppIndicatorPrivate</primary></indexterm> <programlisting>typedef struct _AppIndicatorPrivate AppIndicatorPrivate;</programlisting> <para> -All of the private data in an instance of a - application indicator. +Private Fields +<parameter>id</parameter>: The ID of the indicator. Maps to AppIndicator:id. +<parameter>category</parameter>: Which category the indicator is. Maps to AppIndicator:category. +<parameter>status</parameter>: The status of the indicator. Maps to AppIndicator:status. +<parameter>icon_name</parameter>: The name of the icon to use. Maps to AppIndicator:icon-name. +<parameter>attention_icon_name</parameter>: The name of the attention icon to use. Maps to AppIndicator:attention-icon-name. +<parameter>menu</parameter>: The menu for this indicator. Maps to AppIndicator:menu +<parameter>watcher_proxy</parameter>: The proxy connection to the watcher we're connected to. If we're not connected to one this will be <link linkend="NULL:CAPS"><literal>NULL</literal></link>. </para></refsect2> <refsect2 id="AppIndicator-struct" role="struct"> <title>AppIndicator</title> <indexterm zone="AppIndicator-struct"><primary>AppIndicator</primary></indexterm> <programlisting>typedef struct _AppIndicator AppIndicator;</programlisting> <para> -A application indicator represents the values that are needed to show a - unique status in the panel for an application. In general, applications - should try to fit in the other indicators that are available on the - panel before using this. But, sometimes it is necissary. +Whether the indicator is shown or requests attention. Defaults to +'Passive'. </para></refsect2> <refsect2 id="AppIndicatorClass" role="struct"> <title>struct AppIndicatorClass</title> @@ -413,7 +422,7 @@ A application indicator represents the values that are needed to show a </programlisting> <para> The signals and external functions that make up the <link linkend="AppIndicator"><type>AppIndicator</type></link> - class object. +class object. </para><variablelist role="struct"> <varlistentry><term><link linkend="GObjectClass"><type>GObjectClass</type></link> <structfield id="AppIndicatorClass.parent-class">parent_class</structfield>;</term> <listitem><simpara>Mia familia</simpara></listitem> @@ -486,9 +495,8 @@ Generates or returns the unique <link linkend="GType"><type>GType</type></link> <parameter><link linkend="AppIndicatorCategory"><type>AppIndicatorCategory</type></link> category</parameter>);</programlisting> <para> Creates a new <link linkend="AppIndicator"><type>AppIndicator</type></link> setting the properties: - <link linkend="AppIndicator--id"><type>"id"</type></link> with <parameter>id</parameter>, <link linkend="AppIndicator--category"><type>"category"</type></link> - with <parameter>category</parameter> and <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> with - <parameter>icon_name</parameter>. +<link linkend="AppIndicator--id"><type>"id"</type></link> with <parameter>id</parameter>, <link linkend="AppIndicator--category"><type>"category"</type></link> with <parameter>category</parameter> +and <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> with <parameter>icon_name</parameter>. </para><variablelist role="params"> <varlistentry><term><parameter>id</parameter> :</term> <listitem><simpara>The unique id of the indicator to create.</simpara></listitem></varlistentry> @@ -507,9 +515,9 @@ Creates a new <link linkend="AppIndicator"><type>AppIndicator</type></link> sett <parameter>const <link linkend="gchar"><type>gchar</type></link> *icon_theme_path</parameter>);</programlisting> <para> Creates a new <link linkend="AppIndicator"><type>AppIndicator</type></link> setting the properties: - <link linkend="AppIndicator--id"><type>"id"</type></link> with <parameter>id</parameter>, <link linkend="AppIndicator--category"><type>"category"</type></link> - with <parameter>category</parameter>, <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> with - <parameter>icon_name</parameter> and <link linkend="AppIndicator--icon-theme-path"><type>"icon-theme-path"</type></link> with <parameter>icon_theme_path</parameter>. +<link linkend="AppIndicator--id"><type>"id"</type></link> with <parameter>id</parameter>, <link linkend="AppIndicator--category"><type>"category"</type></link> with <parameter>category</parameter>, +<link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> with <parameter>icon_name</parameter> and <link linkend="AppIndicator--icon-theme-path"><type>"icon-theme-path"</type></link> +with <parameter>icon_theme_path</parameter>. </para><variablelist role="params"> <varlistentry><term><parameter>id</parameter> :</term> <listitem><simpara>The unique id of the indicator to create.</simpara></listitem></varlistentry> @@ -542,7 +550,7 @@ Wrapper function for property <link linkend="AppIndicator--status"><type>"status <warning><para><literal>app_indicator_set_attention_icon</literal> is deprecated and should not be used in newly-written code. Use <link linkend="app-indicator-set-attention-icon-full"><function>app_indicator_set_attention_icon_full()</function></link> instead.</para></warning> <para> Wrapper for <link linkend="app-indicator-set-attention-icon-full"><function>app_indicator_set_attention_icon_full()</function></link> with a NULL - description. +description. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> @@ -573,15 +581,16 @@ Wrapper function for property <link linkend="AppIndicator--attention-icon-name"> <parameter><link linkend="GtkMenu"><type>GtkMenu</type></link> *menu</parameter>);</programlisting> <para> Sets the menu that should be shown when the Application Indicator - is clicked on in the panel. An application indicator will not - be rendered unless it has a menu. - - Wrapper function for property <link linkend="AppIndicator--menu"><type>"menu"</type></link>. +is clicked on in the panel. An application indicator will not +be rendered unless it has a menu. +</para> +<para> +Wrapper function for property <link linkend="AppIndicator--menu"><type>"menu"</type></link>. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link></simpara></listitem></varlistentry> <varlistentry><term><parameter>menu</parameter> :</term> -<listitem><simpara>A <link linkend="GtkMenu"><type>GtkMenu</type></link> to set</simpara></listitem></varlistentry> +<listitem><simpara>A <link linkend="GtkMenu"><type>GtkMenu</type></link> to set. <emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></simpara></listitem></varlistentry> </variablelist></refsect2> <refsect2 id="app-indicator-set-icon" role="function" condition="deprecated:Use app_indicator_set_icon_full()"> <title>app_indicator_set_icon ()</title> @@ -591,7 +600,7 @@ Sets the menu that should be shown when the Application Indicator <warning><para><literal>app_indicator_set_icon</literal> is deprecated and should not be used in newly-written code. Use <link linkend="app-indicator-set-icon-full"><function>app_indicator_set_icon_full()</function></link></para></warning> <para> Wrapper function for <link linkend="app-indicator-set-icon-full"><function>app_indicator_set_icon_full()</function></link> with a NULL - description. +description. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> @@ -606,12 +615,12 @@ Wrapper function for <link linkend="app-indicator-set-icon-full"><function>app_i <parameter>const <link linkend="gchar"><type>gchar</type></link> *icon_desc</parameter>);</programlisting> <para> Sets the default icon to use when the status is active but - not set to attention. In most cases, this should be the - application icon for the program. +not set to attention. In most cases, this should be the +application icon for the program. </para> <para> - Wrapper function for property <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> and - <link linkend="AppIndicator-icon-desc"><type>"icon-desc"</type></link>. +Wrapper function for property <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> and +<link linkend="AppIndicator-icon-desc"><type>"icon-desc"</type></link>. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> @@ -641,8 +650,8 @@ Sets the path to use when searching for icons. <parameter>const <link linkend="gchar"><type>gchar</type></link> *guide</parameter>);</programlisting> <para> This is a wrapper function for the <link linkend="AppIndicator--label"><type>"label"</type></link> and - <link linkend="AppIndicator--guide"><type>"guide"</type></link> properties. This function can take <link linkend="NULL:CAPS"><type>NULL</type></link> - as either <parameter>label</parameter> or <parameter>guide</parameter> and will clear the entries. +<link linkend="AppIndicator--guide"><type>"guide"</type></link> properties. This function can take <link linkend="NULL:CAPS"><type>NULL</type></link> +as either <parameter>label</parameter> or <parameter>guide</parameter> and will clear the entries. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> @@ -658,17 +667,40 @@ This is a wrapper function for the <link linkend="AppIndicator--label"><type>"la <parameter><link linkend="guint32"><type>guint32</type></link> ordering_index</parameter>);</programlisting> <para> Sets the ordering index for the app indicator which effects the - placement of it on the panel. For almost all app indicator - this is not the function you're looking for. +placement of it on the panel. For almost all app indicator +this is not the function you're looking for. </para> <para> - Wrapper function for property <link linkend="AppIndicator--ordering-index"><type>"ordering-index"</type></link>. +Wrapper function for property <link linkend="AppIndicator--ordering-index"><type>"ordering-index"</type></link>. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link></simpara></listitem></varlistentry> <varlistentry><term><parameter>ordering_index</parameter> :</term> <listitem><simpara>A value for the ordering of this app indicator</simpara></listitem></varlistentry> </variablelist></refsect2> +<refsect2 id="app-indicator-set-secondary-activate-target" role="function"> +<title>app_indicator_set_secondary_activate_target ()</title> +<indexterm zone="app-indicator-set-secondary-activate-target"><primary>app_indicator_set_secondary_activate_target</primary></indexterm> +<programlisting><link linkend="void"><returnvalue>void</returnvalue></link> app_indicator_set_secondary_activate_target + (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>, + <parameter><link linkend="GtkWidget"><type>GtkWidget</type></link> *menuitem</parameter>);</programlisting> +<para> +Set the <parameter>menuitem</parameter> to be activated when a secondary activation event (i.e. a +middle-click) is emitted over the <link linkend="AppIndicator"><type>AppIndicator</type></link> icon/label. +</para> +<para> +The <parameter>menuitem</parameter> can be also a complex <link linkend="GtkWidget"><type>GtkWidget</type></link>, but to get activated when +a secondary activation occurs in the <link linkend="Appindicator"><type>Appindicator</type></link>, it must be a visible and +active child (or inner-child) of the <link linkend="AppIndicator--menu"><type>"menu"</type></link>. +</para> +<para> +Setting <parameter>menuitem</parameter> to <link linkend="NULL:CAPS"><literal>NULL</literal></link> causes to disable this feature. +</para><variablelist role="params"> +<varlistentry><term><parameter>self</parameter> :</term> +<listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link></simpara></listitem></varlistentry> +<varlistentry><term><parameter>menuitem</parameter> :</term> +<listitem><simpara>A <link linkend="GtkWidget"><type>GtkWidget</type></link> to be activated on secondary activation. <emphasis role="annotation">[<acronym>allow-none</acronym>]</emphasis></simpara></listitem></varlistentry> +</variablelist></refsect2> <refsect2 id="app-indicator-get-id" role="function"> <title>app_indicator_get_id ()</title> <indexterm zone="app-indicator-get-id"><primary>app_indicator_get_id</primary></indexterm> @@ -767,7 +799,7 @@ Wrapper function for property <link linkend="AppIndicator--attention-icon-desc"> <programlisting><link linkend="GtkMenu"><returnvalue>GtkMenu</returnvalue></link> * app_indicator_get_menu (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>);</programlisting> <para> Gets the menu being used for this application indicator. - Wrapper function for property <link linkend="AppIndicator--menu"><type>"menu"</type></link>. +Wrapper function for property <link linkend="AppIndicator--menu"><type>"menu"</type></link>. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> @@ -808,6 +840,18 @@ Wrapper function for property <link linkend="AppIndicator--ordering-index"><type <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> <varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>The current ordering index.</simpara></listitem></varlistentry> </variablelist></refsect2> +<refsect2 id="app-indicator-get-secondary-activate-target" role="function"> +<title>app_indicator_get_secondary_activate_target ()</title> +<indexterm zone="app-indicator-get-secondary-activate-target"><primary>app_indicator_get_secondary_activate_target</primary></indexterm> +<programlisting><link linkend="GtkWidget"><returnvalue>GtkWidget</returnvalue></link> * app_indicator_get_secondary_activate_target + (<parameter><link linkend="AppIndicator"><type>AppIndicator</type></link> *self</parameter>);</programlisting> +<para> +Gets the menuitem being called on secondary-activate event. +</para><variablelist role="params"> +<varlistentry><term><parameter>self</parameter> :</term> +<listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> +<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>A <link linkend="GtkWidget"><type>GtkWidget</type></link> object or <link linkend="NULL:CAPS"><literal>NULL</literal></link> if none has been set. <emphasis role="annotation">[<acronym>transfer none</acronym>]</emphasis></simpara></listitem></varlistentry> +</variablelist></refsect2> <refsect2 id="app-indicator-build-menu-from-desktop" role="function"> <title>app_indicator_build_menu_from_desktop ()</title> <indexterm zone="app-indicator-build-menu-from-desktop"><primary>app_indicator_build_menu_from_desktop</primary></indexterm> @@ -817,7 +861,7 @@ Wrapper function for property <link linkend="AppIndicator--ordering-index"><type <parameter>const <link linkend="gchar"><type>gchar</type></link> *desktop_profile</parameter>);</programlisting> <para> This function allows for building the Application Indicator menu - from a static desktop file. +from a static desktop file. </para><variablelist role="params"> <varlistentry><term><parameter>self</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object to use</simpara></listitem></varlistentry> @@ -835,7 +879,7 @@ This function allows for building the Application Indicator menu <programlisting> "attention-icon-desc" <link linkend="gchar"><type>gchar</type></link>* : Read / Write</programlisting> <para> If the indicator sets it's status to <link linkend="APP-INDICATOR-STATUS-ATTENTION:CAPS"><literal>APP_INDICATOR_STATUS_ATTENTION</literal></link> - then this textual description of the icon shown. +then this textual description of the icon shown. </para><para>Default value: NULL</para> </refsect2> <refsect2 id="AppIndicator--attention-icon-name" role="property"><title>The <literal>"attention-icon-name"</literal> property</title> @@ -843,7 +887,7 @@ If the indicator sets it's status to <link linkend="APP-INDICATOR-STATUS-ATTENTI <programlisting> "attention-icon-name" <link linkend="gchar"><type>gchar</type></link>* : Read / Write</programlisting> <para> If the indicator sets it's status to <link linkend="APP-INDICATOR-STATUS-ATTENTION:CAPS"><literal>APP_INDICATOR_STATUS_ATTENTION</literal></link> - then this icon is shown. +then this icon is shown. </para><para>Default value: NULL</para> </refsect2> <refsect2 id="AppIndicator--category" role="property"><title>The <literal>"category"</literal> property</title> @@ -851,7 +895,7 @@ If the indicator sets it's status to <link linkend="APP-INDICATOR-STATUS-ATTENTI <programlisting> "category" <link linkend="gchar"><type>gchar</type></link>* : Read / Write / Construct Only</programlisting> <para> The type of indicator that this represents. Please don't use 'Other'. - Defaults to 'ApplicationStatus'. +Defaults to 'ApplicationStatus'. </para><para>Default value: NULL</para> </refsect2> <refsect2 id="AppIndicator--connected" role="property"><title>The <literal>"connected"</literal> property</title> @@ -859,7 +903,7 @@ The type of indicator that this represents. Please don't use 'Other'. <programlisting> "connected" <link linkend="gboolean"><type>gboolean</type></link> : Read</programlisting> <para> Pretty simple, <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if we have a reasonable expectation of being - displayed through this object. You should hide your TrayIcon if so. +displayed through this object. You should hide your TrayIcon if so. </para><para>Default value: FALSE</para> </refsect2> <refsect2 id="AppIndicator--dbus-menu-server" role="property"><title>The <literal>"dbus-menu-server"</literal> property</title> @@ -867,7 +911,7 @@ Pretty simple, <link linkend="TRUE:CAPS"><literal>TRUE</literal></link> if we ha <programlisting> "dbus-menu-server" <link linkend="DbusmenuServer"><type>DbusmenuServer</type></link>* : Read / Write</programlisting> <para> A way to get the internal dbusmenu server if it is available. - This should only be used for testing. +This should only be used for testing. </para></refsect2> <refsect2 id="AppIndicator--icon-desc" role="property"><title>The <literal>"icon-desc"</literal> property</title> <indexterm zone="AppIndicator--icon-desc"><primary>AppIndicator:icon-desc</primary></indexterm> @@ -888,7 +932,7 @@ The name of the regular icon that is shown for the indicator. <programlisting> "icon-theme-path" <link linkend="gchar"><type>gchar</type></link>* : Read / Write / Construct</programlisting> <para> An additional place to look for icon names that may be installed by the - application. +application. </para><para>Default value: NULL</para> </refsect2> <refsect2 id="AppIndicator--id" role="property"><title>The <literal>"id"</literal> property</title> @@ -896,7 +940,7 @@ An additional place to look for icon names that may be installed by the <programlisting> "id" <link linkend="gchar"><type>gchar</type></link>* : Read / Write / Construct Only</programlisting> <para> The ID for this indicator, which should be unique, but used consistently - by this program and its indicator. +by this program and its indicator. </para><para>Default value: NULL</para> </refsect2> <refsect2 id="AppIndicator--label" role="property"><title>The <literal>"label"</literal> property</title> @@ -904,11 +948,11 @@ The ID for this indicator, which should be unique, but used consistently <programlisting> "label" <link linkend="gchar"><type>gchar</type></link>* : Read / Write</programlisting> <para> A label that can be shown next to the string in the application - indicator. The label will not be shown unless there is an icon - as well. The label is useful for numerical and other frequently - updated information. In general, it shouldn't be shown unless a - user requests it as it can take up a significant amount of space - on the user's panel. This may not be shown in all visualizations. +indicator. The label will not be shown unless there is an icon +as well. The label is useful for numerical and other frequently +updated information. In general, it shouldn't be shown unless a +user requests it as it can take up a significant amount of space +on the user's panel. This may not be shown in all visualizations. </para><para>Default value: NULL</para> </refsect2> <refsect2 id="AppIndicator--label-guide" role="property"><title>The <literal>"label-guide"</literal> property</title> @@ -916,12 +960,12 @@ A label that can be shown next to the string in the application <programlisting> "label-guide" <link linkend="gchar"><type>gchar</type></link>* : Read / Write</programlisting> <para> An optional string to provide guidance to the panel on how big - the <link linkend="AppIndicator--label"><type>"label"</type></link> string could get. If this is set correctly - then the panel should never 'jiggle' as the string adjusts through - out the range of options. For instance, if you were providing a - percentage like "54% thrust" in <link linkend="AppIndicator--label"><type>"label"</type></link> you'd want to - set this string to "100% thrust" to ensure space when Scotty can - get you enough power. +the <link linkend="AppIndicator--label"><type>"label"</type></link> string could get. If this is set correctly +then the panel should never 'jiggle' as the string adjusts through +out the range of options. For instance, if you were providing a +percentage like "54% thrust" in <link linkend="AppIndicator--label"><type>"label"</type></link> you'd want to +set this string to "100% thrust" to ensure space when Scotty can +get you enough power. </para><para>Default value: NULL</para> </refsect2> <refsect2 id="AppIndicator--ordering-index" role="property"><title>The <literal>"ordering-index"</literal> property</title> @@ -929,22 +973,19 @@ An optional string to provide guidance to the panel on how big <programlisting> "ordering-index" <link linkend="guint"><type>guint</type></link> : Read / Write</programlisting> <para> The ordering index is an odd parameter, and if you think you don't need - it you're probably right. In general, the application indicator try - to place the applications in a recreatable place taking into account - which category they're in to try and group them. But, there are some - cases where you'd want to ensure indicators are next to each other. - To do that you can override the generated ordering index and replace it - with a new one. Again, you probably don't want to be doing this, but - in case you do, this is the way. +it you're probably right. In general, the application indicator try +to place the applications in a recreatable place taking into account +which category they're in to try and group them. But, there are some +cases where you'd want to ensure indicators are next to each other. +To do that you can override the generated ordering index and replace it +with a new one. Again, you probably don't want to be doing this, but +in case you do, this is the way. </para><para>Default value: 0</para> </refsect2> <refsect2 id="AppIndicator--status" role="property"><title>The <literal>"status"</literal> property</title> <indexterm zone="AppIndicator--status"><primary>AppIndicator:status</primary></indexterm> <programlisting> "status" <link linkend="gchar"><type>gchar</type></link>* : Read / Write</programlisting> -<para> -Whether the indicator is shown or requests attention. Defaults to - 'Passive'. -</para><para>Default value: NULL</para> +<para>Whether the indicator is shown or requests attention. Defaults to 'Passive'.</para><para>Default value: NULL</para> </refsect2> </refsect1> @@ -980,7 +1021,7 @@ Emitted when <link linkend="AppIndicator--attention-icon-name"><type>"attention- <programlisting><link linkend="void"><returnvalue>void</returnvalue></link> user_function (<link linkend="AppIndicator"><type>AppIndicator</type></link> *arg0, <link linkend="gpointer"><type>gpointer</type></link> user_data) : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting> <para> -Emitted when <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> is changed +when <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></link> is changed </para><variablelist role="params"> <varlistentry><term><parameter>arg0</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object</simpara></listitem></varlistentry> @@ -993,7 +1034,7 @@ Emitted when <link linkend="AppIndicator--icon-name"><type>"icon-name"</type></l <link linkend="gpointer"><type>gpointer</type></link> user_data) : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting> <para> Signaled when there is a new icon set for the - object. +object. </para><variablelist role="params"> <varlistentry><term><parameter>arg0</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object</simpara></listitem></varlistentry> @@ -1007,7 +1048,7 @@ Signaled when there is a new icon set for the <link linkend="gpointer"><type>gpointer</type></link> user_data) : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting> <para> Emitted when either <link linkend="AppIndicator--label"><type>"label"</type></link> or <link linkend="AppIndicator--label-guide"><type>"label-guide"</type></link> are - changed. +changed. </para><variablelist role="params"> <varlistentry><term><parameter>arg0</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object</simpara></listitem></varlistentry> @@ -1038,8 +1079,7 @@ Emitted when <link linkend="AppIndicator--status"><type>"status"</type></link> i <link linkend="guint"><type>guint</type></link> arg2, <link linkend="gpointer"><type>gpointer</type></link> user_data) : <link linkend="G-SIGNAL-RUN-LAST:CAPS"><literal>Run Last</literal></link></programlisting> <para> -Signaled when there is a new icon set for the - object. +Signaled when the <link linkend="AppIndicator"><type>AppIndicator</type></link> receives a scroll event. </para><variablelist role="params"> <varlistentry><term><parameter>arg0</parameter> :</term> <listitem><simpara>The <link linkend="AppIndicator"><type>AppIndicator</type></link> object</simpara></listitem></varlistentry> diff --git a/example/simple-client-vala.c b/example/simple-client-vala.c index 44dca9e..fa77cb5 100644 --- a/example/simple-client-vala.c +++ b/example/simple-client-vala.c @@ -1,4 +1,4 @@ -/* simple-client-vala.c generated by valac 0.11.6, the Vala compiler +/* simple-client-vala.c generated by valac 0.12.1, the Vala compiler * generated from simple-client-vala.vala, do not modify */ /* @@ -117,20 +117,20 @@ static void _lambda1_ (Block1Data* _data1_); static void __lambda1__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); static void _lambda2_ (SimpleClient* self); static void __lambda2__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); +static void _lambda3_ (SimpleClient* self); +static void __lambda3__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); static void simple_client_label_toggle (SimpleClient* self, GtkMenuItem* item); static Block2Data* block2_data_ref (Block2Data* _data2_); static void block2_data_unref (Block2Data* _data2_); -static void _lambda3_ (gint delta, guint direction, SimpleClient* self); -static void __lambda3__app_indicator_scroll_event (AppIndicator* _sender, gint indicator, guint delta, gpointer self); -static gboolean _lambda4_ (SimpleClient* self); -static gboolean __lambda4__gsource_func (gpointer self); -static void _lambda5_ (SimpleClient* self); -static void __lambda5__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); -static void _g_object_unref0_ (gpointer var); -static void _g_slist_free__g_object_unref0_ (GSList* self); +static void _lambda4_ (gint delta, guint direction, SimpleClient* self); +static void __lambda4__app_indicator_scroll_event (AppIndicator* _sender, gint indicator, guint delta, gpointer self); +static gboolean _lambda5_ (SimpleClient* self); +static gboolean __lambda5__gsource_func (gpointer self); static void _lambda6_ (SimpleClient* self); static void __lambda6__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); -static void _lambda7_ (Block2Data* _data2_); +static void _g_object_unref0_ (gpointer var); +static void _g_slist_free__g_object_unref0_ (GSList* self); +static void _lambda7_ (SimpleClient* self); static void __lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); static void _lambda8_ (Block2Data* _data2_); static void __lambda8__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); @@ -140,6 +140,8 @@ static void _lambda10_ (Block2Data* _data2_); static void __lambda10__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); static void _lambda11_ (Block2Data* _data2_); static void __lambda11__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); +static void _lambda12_ (Block2Data* _data2_); +static void __lambda12__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self); static void simple_client_finalize (SimpleClient* obj); @@ -165,13 +167,11 @@ int main (int argc, char ** argv) { SimpleClient* simple_client_construct (GType object_type, gchar** args, int args_length1) { SimpleClient* self = NULL; AppIndicator* _tmp0_ = NULL; - AppIndicator* _tmp1_; self = (SimpleClient*) g_type_create_instance (object_type); gtk_init (&args_length1, &args); _tmp0_ = app_indicator_new ("example-simple-client", "indicator-messages", APP_INDICATOR_CATEGORY_APPLICATION_STATUS); - _tmp1_ = _tmp0_; _g_object_unref0 (self->priv->ci); - self->priv->ci = _tmp1_; + self->priv->ci = _tmp0_; app_indicator_set_status (self->priv->ci, APP_INDICATOR_STATUS_ACTIVE); app_indicator_set_attention_icon (self->priv->ci, "indicator-messages-new"); app_indicator_set_label (self->priv->ci, "1%", "100%"); @@ -247,6 +247,22 @@ static void __lambda2__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer se } +static void _lambda3_ (SimpleClient* self) { + AppIndicatorStatus _tmp0_; + _tmp0_ = app_indicator_get_status (self->priv->ci); + if (_tmp0_ == APP_INDICATOR_STATUS_ATTENTION) { + app_indicator_set_status (self->priv->ci, APP_INDICATOR_STATUS_ACTIVE); + } else { + app_indicator_set_status (self->priv->ci, APP_INDICATOR_STATUS_ATTENTION); + } +} + + +static void __lambda3__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda3_ (self); +} + + static void simple_client_append_submenu (SimpleClient* self, GtkMenuItem* item) { Block1Data* _data1_; GtkMenu* _tmp0_ = NULL; @@ -254,11 +270,9 @@ static void simple_client_append_submenu (SimpleClient* self, GtkMenuItem* item) GtkMenuItem* mi = NULL; GtkMenuItem* _tmp1_ = NULL; GtkMenuItem* _tmp2_; - GtkMenuItem* _tmp3_; + GtkMenuItem* _tmp3_ = NULL; GtkMenuItem* _tmp4_ = NULL; - GtkMenuItem* _tmp5_; - GtkMenuItem* _tmp6_ = NULL; - GtkMenuItem* _tmp7_; + GtkMenuItem* _tmp5_ = NULL; g_return_if_fail (self != NULL); g_return_if_fail (item != NULL); _data1_ = g_slice_new0 (Block1Data); @@ -267,25 +281,28 @@ static void simple_client_append_submenu (SimpleClient* self, GtkMenuItem* item) _tmp0_ = (GtkMenu*) gtk_menu_new (); menu = g_object_ref_sink (_tmp0_); _tmp1_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Sub 1"); - _tmp2_ = g_object_ref_sink (_tmp1_); _g_object_unref0 (mi); - mi = _tmp2_; + mi = g_object_ref_sink (_tmp1_); gtk_menu_shell_append ((GtkMenuShell*) menu, (GtkWidget*) mi); g_signal_connect (mi, "activate", (GCallback) __lambda0__gtk_menu_item_activate, self); - _tmp3_ = _g_object_ref0 (mi); - _data1_->prev_mi = _tmp3_; - _tmp4_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Sub 2"); - _tmp5_ = g_object_ref_sink (_tmp4_); + _tmp2_ = _g_object_ref0 (mi); + _data1_->prev_mi = _tmp2_; + _tmp3_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Sub 2"); _g_object_unref0 (mi); - mi = _tmp5_; + mi = g_object_ref_sink (_tmp3_); gtk_menu_shell_append ((GtkMenuShell*) menu, (GtkWidget*) mi); g_signal_connect_data (mi, "activate", (GCallback) __lambda1__gtk_menu_item_activate, block1_data_ref (_data1_), (GClosureNotify) block1_data_unref, 0); - _tmp6_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Sub 3"); - _tmp7_ = g_object_ref_sink (_tmp6_); + _tmp4_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Sub 3"); _g_object_unref0 (mi); - mi = _tmp7_; + mi = g_object_ref_sink (_tmp4_); gtk_menu_shell_append ((GtkMenuShell*) menu, (GtkWidget*) mi); g_signal_connect (mi, "activate", (GCallback) __lambda2__gtk_menu_item_activate, self); + _tmp5_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Toggle Attention"); + _g_object_unref0 (mi); + mi = g_object_ref_sink (_tmp5_); + gtk_menu_shell_append ((GtkMenuShell*) menu, (GtkWidget*) mi); + g_signal_connect (mi, "activate", (GCallback) __lambda3__gtk_menu_item_activate, self); + app_indicator_set_secondary_activate_target (self->priv->ci, (GtkWidget*) mi); gtk_widget_show_all ((GtkWidget*) menu); gtk_menu_item_set_submenu (item, (GtkWidget*) menu); _g_object_unref0 (mi); @@ -326,7 +343,7 @@ static void block2_data_unref (Block2Data* _data2_) { } -static void _lambda3_ (gint delta, guint direction, SimpleClient* self) { +static void _lambda4_ (gint delta, guint direction, SimpleClient* self) { gchar* _tmp0_ = NULL; gchar* _tmp1_; gchar* _tmp2_ = NULL; @@ -346,12 +363,12 @@ static void _lambda3_ (gint delta, guint direction, SimpleClient* self) { } -static void __lambda3__app_indicator_scroll_event (AppIndicator* _sender, gint indicator, guint delta, gpointer self) { - _lambda3_ (indicator, delta, self); +static void __lambda4__app_indicator_scroll_event (AppIndicator* _sender, gint indicator, guint delta, gpointer self) { + _lambda4_ (indicator, delta, self); } -static gboolean _lambda4_ (SimpleClient* self) { +static gboolean _lambda5_ (SimpleClient* self) { gboolean result = FALSE; self->priv->percentage = (self->priv->percentage + 1) % 100; if (self->priv->can_haz_label) { @@ -374,20 +391,20 @@ static gboolean _lambda4_ (SimpleClient* self) { } -static gboolean __lambda4__gsource_func (gpointer self) { +static gboolean __lambda5__gsource_func (gpointer self) { gboolean result; - result = _lambda4_ (self); + result = _lambda5_ (self); return result; } -static void _lambda5_ (SimpleClient* self) { +static void _lambda6_ (SimpleClient* self) { g_print ("1\n"); } -static void __lambda5__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { - _lambda5_ (self); +static void __lambda6__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda6_ (self); } @@ -402,29 +419,29 @@ static void _g_slist_free__g_object_unref0_ (GSList* self) { } -static void _lambda6_ (SimpleClient* self) { +static void _lambda7_ (SimpleClient* self) { g_print ("2\n"); } -static void __lambda6__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { - _lambda6_ (self); +static void __lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda7_ (self); } -static void _lambda7_ (Block2Data* _data2_) { +static void _lambda8_ (Block2Data* _data2_) { SimpleClient * self; self = _data2_->self; simple_client_toggle_sensitivity (self, (GtkWidget*) _data2_->submenu); } -static void __lambda7__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { - _lambda7_ (self); +static void __lambda8__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda8_ (self); } -static void _lambda8_ (Block2Data* _data2_) { +static void _lambda9_ (Block2Data* _data2_) { SimpleClient * self; GtkWidget* _tmp0_ = NULL; GtkImage* _tmp1_; @@ -438,12 +455,12 @@ static void _lambda8_ (Block2Data* _data2_) { } -static void __lambda8__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { - _lambda8_ (self); +static void __lambda9__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda9_ (self); } -static void _lambda9_ (Block2Data* _data2_) { +static void _lambda10_ (Block2Data* _data2_) { SimpleClient * self; self = _data2_->self; if (self->priv->active) { @@ -458,24 +475,24 @@ static void _lambda9_ (Block2Data* _data2_) { } -static void __lambda9__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { - _lambda9_ (self); +static void __lambda10__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda10_ (self); } -static void _lambda10_ (Block2Data* _data2_) { +static void _lambda11_ (Block2Data* _data2_) { SimpleClient * self; self = _data2_->self; simple_client_label_toggle (self, _data2_->show); } -static void __lambda10__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { - _lambda10_ (self); +static void __lambda11__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda11_ (self); } -static void _lambda11_ (Block2Data* _data2_) { +static void _lambda12_ (Block2Data* _data2_) { SimpleClient * self; gboolean _tmp0_; self = _data2_->self; @@ -488,78 +505,78 @@ static void _lambda11_ (Block2Data* _data2_) { } -static void __lambda11__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { - _lambda11_ (self); +static void __lambda12__gtk_menu_item_activate (GtkMenuItem* _sender, gpointer self) { + _lambda12_ (self); } void simple_client_run (SimpleClient* self) { Block2Data* _data2_; GtkMenu* _tmp0_ = NULL; - GtkMenu* _tmp1_; - GtkCheckMenuItem* _tmp2_ = NULL; + GtkCheckMenuItem* _tmp1_ = NULL; GtkCheckMenuItem* chk; - GSList* _tmp3_; - GtkRadioMenuItem* _tmp4_ = NULL; - GtkRadioMenuItem* _tmp5_; + GSList* _tmp2_; + GtkRadioMenuItem* _tmp3_ = NULL; + GtkRadioMenuItem* _tmp4_; GtkRadioMenuItem* radio; + GtkMenuItem* _tmp5_ = NULL; GtkMenuItem* _tmp6_ = NULL; - GtkMenuItem* _tmp7_ = NULL; GtkMenuItem* toggle_item; - GtkImageMenuItem* _tmp8_ = NULL; + GtkImageMenuItem* _tmp7_ = NULL; + GtkMenuItem* _tmp8_ = NULL; GtkMenuItem* _tmp9_ = NULL; - GtkMenuItem* _tmp10_ = NULL; - GtkCheckMenuItem* _tmp11_ = NULL; + GtkCheckMenuItem* _tmp10_ = NULL; g_return_if_fail (self != NULL); _data2_ = g_slice_new0 (Block2Data); _data2_->_ref_count_ = 1; _data2_->self = simple_client_ref (self); - g_signal_connect (self->priv->ci, "scroll-event", (GCallback) __lambda3__app_indicator_scroll_event, self); - g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, __lambda4__gsource_func, simple_client_ref (self), simple_client_unref); + g_signal_connect (self->priv->ci, "scroll-event", (GCallback) __lambda4__app_indicator_scroll_event, self); + g_timeout_add_seconds_full (G_PRIORITY_DEFAULT, (guint) 1, __lambda5__gsource_func, simple_client_ref (self), simple_client_unref); _tmp0_ = (GtkMenu*) gtk_menu_new (); - _tmp1_ = g_object_ref_sink (_tmp0_); _g_object_unref0 (self->priv->menu); - self->priv->menu = _tmp1_; - _tmp2_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label ("1"); - chk = g_object_ref_sink (_tmp2_); - g_signal_connect ((GtkMenuItem*) chk, "activate", (GCallback) __lambda5__gtk_menu_item_activate, self); + self->priv->menu = g_object_ref_sink (_tmp0_); + _tmp1_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label ("1"); + chk = g_object_ref_sink (_tmp1_); + g_signal_connect ((GtkMenuItem*) chk, "activate", (GCallback) __lambda6__gtk_menu_item_activate, self); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) ((GtkMenuItem*) chk)); gtk_widget_show ((GtkWidget*) chk); - _tmp3_ = NULL; - _tmp4_ = (GtkRadioMenuItem*) gtk_radio_menu_item_new_with_label (_tmp3_, "2"); - radio = (_tmp5_ = g_object_ref_sink (_tmp4_), __g_slist_free__g_object_unref0_0 (_tmp3_), _tmp5_); - g_signal_connect ((GtkMenuItem*) radio, "activate", (GCallback) __lambda6__gtk_menu_item_activate, self); + _tmp2_ = NULL; + _tmp3_ = (GtkRadioMenuItem*) gtk_radio_menu_item_new_with_label (_tmp2_, "2"); + _tmp4_ = g_object_ref_sink (_tmp3_); + __g_slist_free__g_object_unref0_0 (_tmp2_); + radio = _tmp4_; + g_signal_connect ((GtkMenuItem*) radio, "activate", (GCallback) __lambda7__gtk_menu_item_activate, self); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) ((GtkMenuItem*) radio)); gtk_widget_show ((GtkWidget*) radio); - _tmp6_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("3"); - _data2_->submenu = g_object_ref_sink (_tmp6_); + _tmp5_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("3"); + _data2_->submenu = g_object_ref_sink (_tmp5_); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) _data2_->submenu); simple_client_append_submenu (self, _data2_->submenu); gtk_widget_show ((GtkWidget*) _data2_->submenu); - _tmp7_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Toggle 3"); - toggle_item = g_object_ref_sink (_tmp7_); - g_signal_connect_data (toggle_item, "activate", (GCallback) __lambda7__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); + _tmp6_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Toggle 3"); + toggle_item = g_object_ref_sink (_tmp6_); + g_signal_connect_data (toggle_item, "activate", (GCallback) __lambda8__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) toggle_item); gtk_widget_show ((GtkWidget*) toggle_item); - _tmp8_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_NEW, NULL); - _data2_->imgitem = g_object_ref_sink (_tmp8_); - g_signal_connect_data ((GtkMenuItem*) _data2_->imgitem, "activate", (GCallback) __lambda8__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); + _tmp7_ = (GtkImageMenuItem*) gtk_image_menu_item_new_from_stock (GTK_STOCK_NEW, NULL); + _data2_->imgitem = g_object_ref_sink (_tmp7_); + g_signal_connect_data ((GtkMenuItem*) _data2_->imgitem, "activate", (GCallback) __lambda9__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) ((GtkMenuItem*) _data2_->imgitem)); gtk_widget_show ((GtkWidget*) _data2_->imgitem); - _tmp9_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Get Attention"); - _data2_->att = g_object_ref_sink (_tmp9_); - g_signal_connect_data (_data2_->att, "activate", (GCallback) __lambda9__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); + _tmp8_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Get Attention"); + _data2_->att = g_object_ref_sink (_tmp8_); + g_signal_connect_data (_data2_->att, "activate", (GCallback) __lambda10__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) _data2_->att); gtk_widget_show ((GtkWidget*) _data2_->att); - _tmp10_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Show Label"); - _data2_->show = g_object_ref_sink (_tmp10_); + _tmp9_ = (GtkMenuItem*) gtk_menu_item_new_with_label ("Show Label"); + _data2_->show = g_object_ref_sink (_tmp9_); simple_client_label_toggle (self, _data2_->show); - g_signal_connect_data (_data2_->show, "activate", (GCallback) __lambda10__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); + g_signal_connect_data (_data2_->show, "activate", (GCallback) __lambda11__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) _data2_->show); gtk_widget_show ((GtkWidget*) _data2_->show); - _tmp11_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label ("Set Local Icon"); - _data2_->icon = g_object_ref_sink (_tmp11_); - g_signal_connect_data ((GtkMenuItem*) _data2_->icon, "activate", (GCallback) __lambda11__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); + _tmp10_ = (GtkCheckMenuItem*) gtk_check_menu_item_new_with_label ("Set Local Icon"); + _data2_->icon = g_object_ref_sink (_tmp10_); + g_signal_connect_data ((GtkMenuItem*) _data2_->icon, "activate", (GCallback) __lambda12__gtk_menu_item_activate, block2_data_ref (_data2_), (GClosureNotify) block2_data_unref, 0); gtk_menu_shell_append ((GtkMenuShell*) self->priv->menu, (GtkWidget*) ((GtkMenuItem*) _data2_->icon)); gtk_widget_show ((GtkWidget*) _data2_->icon); app_indicator_set_menu (self->priv->ci, self->priv->menu); diff --git a/example/simple-client-vala.vala b/example/simple-client-vala.vala index 61e0c2f..8d661ce 100644 --- a/example/simple-client-vala.vala +++ b/example/simple-client-vala.vala @@ -72,6 +72,17 @@ class SimpleClient { menu.append(mi); mi.activate.connect(() => { print("Sub3\n"); }); + mi = new MenuItem.with_label("Toggle Attention"); + menu.append(mi); + mi.activate.connect(() => { + if (ci.get_status() == IndicatorStatus.ATTENTION) + ci.set_status(IndicatorStatus.ACTIVE); + else + ci.set_status(IndicatorStatus.ATTENTION); + }); + + ci.set_secondary_activate_target(mi); + menu.show_all(); item.set_submenu(menu); } @@ -109,7 +120,7 @@ class SimpleClient { chk.show(); var radio = new RadioMenuItem.with_label(new SList<RadioMenuItem>(), "2"); - radio.activate.connect(() => { print("2\n"); }); + radio.activate.connect(() => { print("2\n"); }); menu.append(radio); radio.show(); diff --git a/example/simple-client.c b/example/simple-client.c index 9e63e14..dcee81b 100644 --- a/example/simple-client.c +++ b/example/simple-client.c @@ -31,46 +31,46 @@ static gboolean can_haz_label = TRUE; static void label_toggle_cb (GtkWidget * widget, gpointer data) { - can_haz_label = !can_haz_label; + can_haz_label = !can_haz_label; - if (can_haz_label) { - gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "Hide label"); - } else { - gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "Show label"); - } + if (can_haz_label) { + gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "Hide label"); + } else { + gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "Show label"); + } - return; + return; } static void activate_clicked_cb (GtkWidget *widget, gpointer data) { - AppIndicator * ci = APP_INDICATOR(data); - - if (active) { - app_indicator_set_status (ci, APP_INDICATOR_STATUS_ATTENTION); - gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "I'm okay now"); - active = FALSE; - } else { - app_indicator_set_status (ci, APP_INDICATOR_STATUS_ACTIVE); - gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "Get Attention"); - active = TRUE; - } + AppIndicator * ci = APP_INDICATOR(data); + + if (active) { + app_indicator_set_status (ci, APP_INDICATOR_STATUS_ATTENTION); + gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "I'm okay now"); + active = FALSE; + } else { + app_indicator_set_status (ci, APP_INDICATOR_STATUS_ACTIVE); + gtk_menu_item_set_label(GTK_MENU_ITEM(widget), "Get Attention"); + active = TRUE; + } } static void local_icon_toggle_cb (GtkWidget *widget, gpointer data) { - AppIndicator * ci = APP_INDICATOR(data); + AppIndicator * ci = APP_INDICATOR(data); - if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { - app_indicator_set_icon_full(ci, LOCAL_ICON, "Local Icon"); - } else { - app_indicator_set_icon_full(ci, "indicator-messages", "System Icon"); - } + if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { + app_indicator_set_icon_full(ci, LOCAL_ICON, "Local Icon"); + } else { + app_indicator_set_icon_full(ci, "indicator-messages", "System Icon"); + } - return; + return; } static void @@ -98,9 +98,9 @@ image_clicked_cb (GtkWidget *widget, gpointer data) } static void -scroll_event_cb (AppIndicator * ci, gint delta, guint direction) +scroll_event_cb (AppIndicator * ci, gint delta, guint direction, gpointer data) { - g_print("Got scroll event! delta: %d, direction: %d\n", delta, direction); + g_print("Got scroll event! delta: %d, direction: %d\n", delta, direction); } static void @@ -138,15 +138,15 @@ guint percentage = 0; static gboolean percent_change (gpointer user_data) { - percentage = (percentage + 1) % 100; - if (can_haz_label) { - gchar * percentstr = g_strdup_printf("%d%%", percentage + 1); - app_indicator_set_label (APP_INDICATOR(user_data), percentstr, "100%"); - g_free(percentstr); - } else { - app_indicator_set_label (APP_INDICATOR(user_data), NULL, NULL); - } - return TRUE; + percentage = (percentage + 1) % 100; + if (can_haz_label) { + gchar * percentstr = g_strdup_printf("%d%%", percentage + 1); + app_indicator_set_label (APP_INDICATOR(user_data), percentstr, "100%"); + g_free(percentstr); + } else { + app_indicator_set_label (APP_INDICATOR(user_data), NULL, NULL); + } + return TRUE; } int @@ -161,17 +161,17 @@ main (int argc, char ** argv) "indicator-messages", APP_INDICATOR_CATEGORY_APPLICATION_STATUS); - g_assert (IS_APP_INDICATOR (ci)); + g_assert (IS_APP_INDICATOR (ci)); g_assert (G_IS_OBJECT (ci)); - app_indicator_set_status (ci, APP_INDICATOR_STATUS_ACTIVE); - app_indicator_set_attention_icon_full(ci, "indicator-messages-new", "System Messages Icon Highlighted"); - app_indicator_set_label (ci, "1%", "100%"); + app_indicator_set_status (ci, APP_INDICATOR_STATUS_ACTIVE); + app_indicator_set_attention_icon_full(ci, "indicator-messages-new", "System Messages Icon Highlighted"); + app_indicator_set_label (ci, "1%", "100%"); - g_signal_connect (ci, "scroll-event", + g_signal_connect (ci, "scroll-event", G_CALLBACK (scroll_event_cb), NULL); - g_timeout_add_seconds(1, percent_change, ci); + g_timeout_add_seconds(1, percent_change, ci); menu = gtk_menu_new (); GtkWidget *item = gtk_check_menu_item_new_with_label ("1"); @@ -195,37 +195,38 @@ main (int argc, char ** argv) g_signal_connect (toggle_item, "activate", G_CALLBACK (toggle_sensitivity_cb), item); gtk_menu_shell_append (GTK_MENU_SHELL (menu), toggle_item); - gtk_widget_show(toggle_item); + gtk_widget_show(toggle_item); item = gtk_image_menu_item_new_from_stock (GTK_STOCK_NEW, NULL); g_signal_connect (item, "activate", G_CALLBACK (image_clicked_cb), NULL); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - gtk_widget_show(item); + gtk_widget_show(item); item = gtk_menu_item_new_with_label ("Get Attention"); g_signal_connect (item, "activate", G_CALLBACK (activate_clicked_cb), ci); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - gtk_widget_show(item); + gtk_widget_show(item); + app_indicator_set_secondary_activate_target(ci, item); item = gtk_menu_item_new_with_label ("Show label"); - label_toggle_cb(item, ci); + label_toggle_cb(item, ci); g_signal_connect (item, "activate", G_CALLBACK (label_toggle_cb), ci); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - gtk_widget_show(item); + gtk_widget_show(item); item = gtk_check_menu_item_new_with_label ("Set Local Icon"); g_signal_connect (item, "activate", G_CALLBACK (local_icon_toggle_cb), ci); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); - gtk_widget_show(item); + gtk_widget_show(item); app_indicator_set_menu (ci, GTK_MENU (menu)); - mainloop = g_main_loop_new(NULL, FALSE); - g_main_loop_run(mainloop); + mainloop = g_main_loop_new(NULL, FALSE); + g_main_loop_run(mainloop); - return 0; + return 0; } diff --git a/src/Makefile.am b/src/Makefile.am index 8a74d66..a4bd27a 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -148,6 +148,7 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) if HAVE_INTROSPECTION introspection_sources = \ + $(addprefix $(srcdir)/,app-indicator.c) \ $(addprefix $(srcdir)/,$(libappindicator_headers)) AppIndicator$(VER)-0.1.gir: libappindicator$(VER).la diff --git a/src/Makefile.in b/src/Makefile.in index d420133..b9e2457 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -466,6 +466,7 @@ INTROSPECTION_GIRS = $(am__append_1) INTROSPECTION_COMPILER_ARGS = --includedir=$(builddir) @HAVE_INTROSPECTION_TRUE@introspection_sources = \ +@HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/,app-indicator.c) \ @HAVE_INTROSPECTION_TRUE@ $(addprefix $(srcdir)/,$(libappindicator_headers)) @HAVE_INTROSPECTION_TRUE@AppIndicator_0_1_gir_INCLUDES = \ diff --git a/src/app-indicator.c b/src/app-indicator.c index bc08eea..c2f0f69 100644 --- a/src/app-indicator.c +++ b/src/app-indicator.c @@ -51,20 +51,18 @@ License version 3 and version 2.1 along with this program. If not, see #define PANEL_ICON_SUFFIX "panel" /** - AppIndicatorPrivate: - - All of the private data in an instance of a - application indicator. -*/ -/* Private Fields - @id: The ID of the indicator. Maps to AppIndicator:id. - @category: Which category the indicator is. Maps to AppIndicator:category. - @status: The status of the indicator. Maps to AppIndicator:status. - @icon_name: The name of the icon to use. Maps to AppIndicator:icon-name. - @attention_icon_name: The name of the attention icon to use. Maps to AppIndicator:attention-icon-name. - @menu: The menu for this indicator. Maps to AppIndicator:menu - @watcher_proxy: The proxy connection to the watcher we're connected to. If we're not connected to one this will be %NULL. -*/ + * AppIndicatorPrivate: + * All of the private data in an instance of an application indicator. + * + * Private Fields + * @id: The ID of the indicator. Maps to AppIndicator:id. + * @category: Which category the indicator is. Maps to AppIndicator:category. + * @status: The status of the indicator. Maps to AppIndicator:status. + * @icon_name: The name of the icon to use. Maps to AppIndicator:icon-name. + * @attention_icon_name: The name of the attention icon to use. Maps to AppIndicator:attention-icon-name. + * @menu: The menu for this indicator. Maps to AppIndicator:menu + * @watcher_proxy: The proxy connection to the watcher we're connected to. If we're not connected to one this will be %NULL. + */ struct _AppIndicatorPrivate { /*< Private >*/ /* Properties */ @@ -77,6 +75,8 @@ struct _AppIndicatorPrivate { gchar *icon_theme_path; DbusmenuServer *menuservice; GtkWidget *menu; + GtkWidget *sec_activate_target; + gboolean sec_activate_enabled; guint32 ordering_index; gchar * label; gchar * label_guide; @@ -104,8 +104,8 @@ enum { NEW_STATUS, NEW_LABEL, CONNECTION_CHANGED, - NEW_ICON_THEME_PATH, - SCROLL_EVENT, + NEW_ICON_THEME_PATH, + SCROLL_EVENT, LAST_SIGNAL }; @@ -178,6 +178,7 @@ static gboolean fallback_timer_expire (gpointer data); static GtkStatusIcon * fallback (AppIndicator * self); static void status_icon_status_wrapper (AppIndicator * self, const gchar * status, gpointer data); static gboolean scroll_event_wrapper(GtkWidget *status_icon, GdkEventScroll *event, gpointer user_data); +static gboolean middle_click_wrapper(GtkWidget *status_icon, GdkEventButton *event, gpointer user_data); static void status_icon_changes (AppIndicator * self, gpointer data); static void status_icon_activate (GtkStatusIcon * icon, gpointer data); static void status_icon_menu_activate (GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data); @@ -185,6 +186,7 @@ static void unfallback (AppIndicator * self, GtkStatusIcon * status_icon); static gchar * append_panel_icon_suffix (const gchar * icon_name); static void watcher_owner_changed (GObject * obj, GParamSpec * pspec, gpointer user_data); static void theme_changed_cb (GtkIconTheme * theme, gpointer user_data); +static void sec_activate_target_parent_changed(GtkWidget *menuitem, GtkWidget *old_parent, gpointer user_data); static GVariant * bus_get_prop (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * property, GError ** error, gpointer user_data); static void bus_method_call (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * method, GVariant * params, GDBusMethodInvocation * invocation, gpointer user_data); static void bus_creation (GObject * obj, GAsyncResult * res, gpointer user_data); @@ -221,11 +223,11 @@ app_indicator_class_init (AppIndicatorClass *klass) /* Properties */ /** - AppIndicator:id: - - The ID for this indicator, which should be unique, but used consistently - by this program and its indicator. - */ + * AppIndicator:id: + * + * The ID for this indicator, which should be unique, but used consistently + * by this program and its indicator. + */ g_object_class_install_property (object_class, PROP_ID, g_param_spec_string(PROP_ID_S, @@ -235,11 +237,11 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); /** - AppIndicator:category: - - The type of indicator that this represents. Please don't use 'Other'. - Defaults to 'ApplicationStatus'. - */ + * AppIndicator:category: + * + * The type of indicator that this represents. Please don't use 'Other'. + * Defaults to 'ApplicationStatus'. + */ g_object_class_install_property (object_class, PROP_CATEGORY, g_param_spec_string (PROP_CATEGORY_S, @@ -249,11 +251,11 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT_ONLY)); /** - AppIndicator:status: - - Whether the indicator is shown or requests attention. Defaults to - 'Passive'. - */ + * AppIndicator: + * + * Whether the indicator is shown or requests attention. Defaults to + * 'Passive'. + */ g_object_class_install_property (object_class, PROP_STATUS, g_param_spec_string (PROP_STATUS_S, @@ -263,10 +265,10 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:icon-name: - - The name of the regular icon that is shown for the indicator. - */ + * AppIndicator:icon-name: + * + * The name of the regular icon that is shown for the indicator. + */ g_object_class_install_property(object_class, PROP_ICON_NAME, g_param_spec_string (PROP_ICON_NAME_S, @@ -275,10 +277,10 @@ app_indicator_class_init (AppIndicatorClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:icon-desc: - - The description of the regular icon that is shown for the indicator. - */ + * AppIndicator:icon-desc: + * + * The description of the regular icon that is shown for the indicator. + */ g_object_class_install_property(object_class, PROP_ICON_DESC, g_param_spec_string (PROP_ICON_DESC_S, @@ -288,11 +290,11 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:attention-icon-name: - - If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION - then this icon is shown. - */ + * AppIndicator:attention-icon-name: + * + * If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION + * then this icon is shown. + */ g_object_class_install_property (object_class, PROP_ATTENTION_ICON_NAME, g_param_spec_string (PROP_ATTENTION_ICON_NAME_S, @@ -301,11 +303,11 @@ app_indicator_class_init (AppIndicatorClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:attention-icon-desc: - - If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION - then this textual description of the icon shown. - */ + * AppIndicator:attention-icon-desc: + * + * If the indicator sets it's status to %APP_INDICATOR_STATUS_ATTENTION + * then this textual description of the icon shown. + */ g_object_class_install_property (object_class, PROP_ATTENTION_ICON_DESC, g_param_spec_string (PROP_ATTENTION_ICON_DESC_S, @@ -314,11 +316,11 @@ app_indicator_class_init (AppIndicatorClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:icon-theme-path: - - An additional place to look for icon names that may be installed by the - application. - */ + * AppIndicator:icon-theme-path: + * + * An additional place to look for icon names that may be installed by the + * application. + */ g_object_class_install_property(object_class, PROP_ICON_THEME_PATH, g_param_spec_string (PROP_ICON_THEME_PATH_S, @@ -328,11 +330,11 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_CONSTRUCT)); /** - AppIndicator:connected: - - Pretty simple, %TRUE if we have a reasonable expectation of being - displayed through this object. You should hide your TrayIcon if so. - */ + * AppIndicator:connected: + * + * Pretty simple, %TRUE if we have a reasonable expectation of being + * displayed through this object. You should hide your TrayIcon if so. + */ g_object_class_install_property (object_class, PROP_CONNECTED, g_param_spec_boolean (PROP_CONNECTED_S, @@ -341,15 +343,15 @@ app_indicator_class_init (AppIndicatorClass *klass) FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:label: - - A label that can be shown next to the string in the application - indicator. The label will not be shown unless there is an icon - as well. The label is useful for numerical and other frequently - updated information. In general, it shouldn't be shown unless a - user requests it as it can take up a significant amount of space - on the user's panel. This may not be shown in all visualizations. - */ + * AppIndicator:label: + * + * A label that can be shown next to the string in the application + * indicator. The label will not be shown unless there is an icon + * as well. The label is useful for numerical and other frequently + * updated information. In general, it shouldn't be shown unless a + * user requests it as it can take up a significant amount of space + * on the user's panel. This may not be shown in all visualizations. + */ g_object_class_install_property(object_class, PROP_LABEL, g_param_spec_string (PROP_LABEL_S, @@ -358,16 +360,16 @@ app_indicator_class_init (AppIndicatorClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:label-guide: - - An optional string to provide guidance to the panel on how big - the #AppIndicator:label string could get. If this is set correctly - then the panel should never 'jiggle' as the string adjusts through - out the range of options. For instance, if you were providing a - percentage like "54% thrust" in #AppIndicator:label you'd want to - set this string to "100% thrust" to ensure space when Scotty can - get you enough power. - */ + * AppIndicator:label-guide: + * + * An optional string to provide guidance to the panel on how big + * the #AppIndicator:label string could get. If this is set correctly + * then the panel should never 'jiggle' as the string adjusts through + * out the range of options. For instance, if you were providing a + * percentage like "54% thrust" in #AppIndicator:label you'd want to + * set this string to "100% thrust" to ensure space when Scotty can + * get you enough power. + */ g_object_class_install_property(object_class, PROP_LABEL_GUIDE, g_param_spec_string (PROP_LABEL_GUIDE_S, @@ -376,17 +378,17 @@ app_indicator_class_init (AppIndicatorClass *klass) NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:ordering-index: - - The ordering index is an odd parameter, and if you think you don't need - it you're probably right. In general, the application indicator try - to place the applications in a recreatable place taking into account - which category they're in to try and group them. But, there are some - cases where you'd want to ensure indicators are next to each other. - To do that you can override the generated ordering index and replace it - with a new one. Again, you probably don't want to be doing this, but - in case you do, this is the way. - */ + * AppIndicator:ordering-index: + * + * The ordering index is an odd parameter, and if you think you don't need + * it you're probably right. In general, the application indicator try + * to place the applications in a recreatable place taking into account + * which category they're in to try and group them. But, there are some + * cases where you'd want to ensure indicators are next to each other. + * To do that you can override the generated ordering index and replace it + * with a new one. Again, you probably don't want to be doing this, but + * in case you do, this is the way. + */ g_object_class_install_property(object_class, PROP_ORDERING_INDEX, g_param_spec_uint (PROP_ORDERING_INDEX_S, @@ -396,11 +398,11 @@ app_indicator_class_init (AppIndicatorClass *klass) G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); /** - AppIndicator:dbus-menu-server: - - A way to get the internal dbusmenu server if it is available. - This should only be used for testing. - */ + * AppIndicator:dbus-menu-server: + * + * A way to get the internal dbusmenu server if it is available. + * This should only be used for testing. + */ g_object_class_install_property(object_class, PROP_DBUS_MENU_SERVER, g_param_spec_object (PROP_DBUS_MENU_SERVER_S, @@ -412,11 +414,11 @@ app_indicator_class_init (AppIndicatorClass *klass) /* Signals */ /** - AppIndicator::new-icon: - @arg0: The #AppIndicator object - - Emitted when #AppIndicator:icon-name is changed - */ + * AppIndicator::new-icon: + * @arg0: The #AppIndicator object + * + * when #AppIndicator:icon-name is changed + */ signals[NEW_ICON] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_ICON, G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -426,11 +428,11 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_NONE, 0, G_TYPE_NONE); /** - AppIndicator::new-attention-icon: - @arg0: The #AppIndicator object - - Emitted when #AppIndicator:attention-icon-name is changed - */ + * AppIndicator::new-attention-icon: + * @arg0: The #AppIndicator object + * + * Emitted when #AppIndicator:attention-icon-name is changed + */ signals[NEW_ATTENTION_ICON] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON, G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -440,12 +442,12 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_NONE, 0, G_TYPE_NONE); /** - AppIndicator::new-status: - @arg0: The #AppIndicator object - @arg1: The string value of the #AppIndicatorStatus enum. - - Emitted when #AppIndicator:status is changed - */ + * AppIndicator::new-status: + * @arg0: The #AppIndicator object + * @arg1: The string value of the #AppIndicatorStatus enum. + * + * Emitted when #AppIndicator:status is changed + */ signals[NEW_STATUS] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_STATUS, G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -456,13 +458,13 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_STRING); /** - AppIndicator::new-label: - @arg0: The #AppIndicator object - @arg1: The string for the label - @arg1: The string for the guide - - Emitted when either #AppIndicator:label or #AppIndicator:label-guide are - changed. + * AppIndicator::new-label: + * @arg0: The #AppIndicator object + * @arg1: The string for the label + * @arg1: The string for the guide + * + * Emitted when either #AppIndicator:label or #AppIndicator:label-guide are + * changed. */ signals[NEW_LABEL] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_LABEL, G_TYPE_FROM_CLASS(klass), @@ -473,12 +475,12 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_NONE, 2, G_TYPE_STRING, G_TYPE_STRING); /** - AppIndicator::connection-changed: - @arg0: The #AppIndicator object - @arg1: Whether we're connected or not - - Signaled when we connect to a watcher, or when it drops away. - */ + * AppIndicator::connection-changed: + * @arg0: The #AppIndicator object + * @arg1: Whether we're connected or not + * + * Signaled when we connect to a watcher, or when it drops away. + */ signals[CONNECTION_CHANGED] = g_signal_new (APP_INDICATOR_SIGNAL_CONNECTION_CHANGED, G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -488,12 +490,12 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_NONE, 1, G_TYPE_BOOLEAN, G_TYPE_NONE); /** - AppIndicator::new-icon-theme-path: - @arg0: The #AppIndicator object - - Signaled when there is a new icon set for the - object. - */ + * AppIndicator::new-icon-theme-path: + * @arg0: The #AppIndicator object + * + * Signaled when there is a new icon set for the + * object. + */ signals[NEW_ICON_THEME_PATH] = g_signal_new (APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH, G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -503,14 +505,13 @@ app_indicator_class_init (AppIndicatorClass *klass) G_TYPE_NONE, 1, G_TYPE_STRING); /** - AppIndicator::scroll-event: - @arg0: The #AppIndicator object - @arg1: How many steps the scroll wheel has taken - @arg2: (type Gdk.ScrollDirection) Which direction the wheel went in - - Signaled when there is a new icon set for the - object. - */ + * AppIndicator::scroll-event: + * @arg0: The #AppIndicator object + * @arg1: How many steps the scroll wheel has taken + * @arg2: (type Gdk.ScrollDirection) Which direction the wheel went in + * + * Signaled when the #AppIndicator receives a scroll event. + */ signals[SCROLL_EVENT] = g_signal_new (APP_INDICATOR_SIGNAL_SCROLL_EVENT, G_TYPE_FROM_CLASS(klass), G_SIGNAL_RUN_LAST, @@ -588,6 +589,9 @@ app_indicator_init (AppIndicator *self) priv->shorties = NULL; + priv->sec_activate_target = NULL; + priv->sec_activate_enabled = FALSE; + /* Start getting the session bus */ g_object_ref(self); /* ref for the bus creation callback */ g_bus_get(G_BUS_TYPE_SESSION, NULL, bus_creation, self); @@ -663,6 +667,12 @@ app_indicator_dispose (GObject *object) priv->connection = NULL; } + if (priv->sec_activate_target != NULL) { + g_signal_handlers_disconnect_by_func (priv->sec_activate_target, sec_activate_target_parent_changed, self); + g_object_unref(G_OBJECT(priv->sec_activate_target)); + priv->sec_activate_target = NULL; + } + g_signal_handlers_disconnect_by_func(gtk_icon_theme_get_default(), G_CALLBACK(theme_changed_cb), self); G_OBJECT_CLASS (app_indicator_parent_class)->dispose (object); @@ -990,6 +1000,7 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, g_return_if_fail(IS_APP_INDICATOR(user_data)); AppIndicator * app = APP_INDICATOR(user_data); + AppIndicatorPrivate * priv = app->priv; GVariant * retval = NULL; if (g_strcmp0(method, "Scroll") == 0) { @@ -1011,6 +1022,16 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, delta = ABS(delta); g_signal_emit(app, signals[SCROLL_EVENT], 0, delta, direction); + } else if (g_strcmp0(method, "SecondaryActivate") == 0 || + g_strcmp0(method, "XAyatanaSecondaryActivate") == 0) { + GtkWidget *menuitem = priv->sec_activate_target; + + if (priv->sec_activate_enabled && menuitem && + gtk_widget_get_visible (menuitem) && + gtk_widget_get_sensitive (menuitem)) + { + gtk_widget_activate (menuitem); + } } else { g_warning("Calling method '%s' on the app-indicator and it's unknown", method); } @@ -1442,6 +1463,7 @@ fallback (AppIndicator * self) g_signal_connect(G_OBJECT(icon), "activate", G_CALLBACK(status_icon_activate), self); g_signal_connect(G_OBJECT(icon), "popup-menu", G_CALLBACK(status_icon_menu_activate), self); g_signal_connect(G_OBJECT(icon), "scroll-event", G_CALLBACK(scroll_event_wrapper), self); + g_signal_connect(G_OBJECT(icon), "button-release-event", G_CALLBACK(middle_click_wrapper), self); return icon; } @@ -1457,12 +1479,39 @@ status_icon_status_wrapper (AppIndicator * self, const gchar * status, gpointer /* A wrapper for redirecting the scroll events to the app-indicator from status icon widget. */ static gboolean -scroll_event_wrapper(GtkWidget *status_icon, GdkEventScroll *event, gpointer data) +scroll_event_wrapper (GtkWidget *status_icon, GdkEventScroll *event, gpointer data) { g_return_val_if_fail(IS_APP_INDICATOR(data), FALSE); AppIndicator * app = APP_INDICATOR(data); g_signal_emit(app, signals[SCROLL_EVENT], 0, 1, event->direction); + return TRUE; +} + +static gboolean +middle_click_wrapper (GtkWidget *status_icon, GdkEventButton *event, gpointer data) +{ + g_return_val_if_fail(IS_APP_INDICATOR(data), FALSE); + AppIndicator * app = APP_INDICATOR(data); + AppIndicatorPrivate *priv = app->priv; + + if (event->button == 2 && event->type == GDK_BUTTON_RELEASE) { + GtkAllocation alloc; + gint px = event->x; + gint py = event->y; + gtk_widget_get_allocation (status_icon, &alloc); + GtkWidget *menuitem = priv->sec_activate_target; + + if (px >= 0 && px < alloc.width && py >= 0 && py < alloc.height && + priv->sec_activate_enabled && menuitem && + gtk_widget_get_visible (menuitem) && + gtk_widget_get_sensitive (menuitem)) + { + gtk_widget_activate (menuitem); + return TRUE; + } + } + return FALSE; } @@ -1535,6 +1584,7 @@ unfallback (AppIndicator * self, GtkStatusIcon * status_icon) g_signal_handlers_disconnect_by_func(G_OBJECT(self), status_icon_status_wrapper, status_icon); g_signal_handlers_disconnect_by_func(G_OBJECT(self), status_icon_changes, status_icon); g_signal_handlers_disconnect_by_func(G_OBJECT(self), scroll_event_wrapper, status_icon); + g_signal_handlers_disconnect_by_func(G_OBJECT(self), middle_click_wrapper, status_icon); gtk_status_icon_set_visible(status_icon, FALSE); g_object_unref(G_OBJECT(status_icon)); return; @@ -1557,23 +1607,54 @@ append_panel_icon_suffix (const gchar *icon_name) return long_name; } +static gboolean +widget_is_menu_child(AppIndicator * self, GtkWidget *child) +{ + g_return_val_if_fail(IS_APP_INDICATOR(self), FALSE); + + if (!self->priv->menu) return FALSE; + if (!child) return FALSE; + + GtkWidget *parent; + + while ((parent = gtk_widget_get_parent(child))) { + if (parent == self->priv->menu) + return TRUE; + + if (GTK_IS_MENU(parent)) + child = gtk_menu_get_attach_widget(GTK_MENU(parent)); + else + child = parent; + } + + return FALSE; +} + +static void +sec_activate_target_parent_changed(GtkWidget *menuitem, GtkWidget *old_parent, + gpointer data) +{ + g_return_if_fail(IS_APP_INDICATOR(data)); + AppIndicator *self = data; + self->priv->sec_activate_enabled = widget_is_menu_child(self, menuitem); +} + /* ************************* */ /* Public Functions */ /* ************************* */ /** - app_indicator_new: - @id: The unique id of the indicator to create. - @icon_name: The icon name for this indicator - @category: The category of indicator. - - Creates a new #AppIndicator setting the properties: - #AppIndicator:id with @id, #AppIndicator:category - with @category and #AppIndicator:icon-name with - @icon_name. - - Return value: A pointer to a new #AppIndicator object. + * app_indicator_new: + * @id: The unique id of the indicator to create. + * @icon_name: The icon name for this indicator + * @category: The category of indicator. + * + * Creates a new #AppIndicator setting the properties: + * #AppIndicator:id with @id, #AppIndicator:category with @category + * and #AppIndicator:icon-name with @icon_name. + * + * Return value: A pointer to a new #AppIndicator object. */ AppIndicator * app_indicator_new (const gchar *id, @@ -1590,18 +1671,18 @@ app_indicator_new (const gchar *id, } /** - app_indicator_new_with_path: - @id: The unique id of the indicator to create. - @icon_name: The icon name for this indicator - @category: The category of indicator. - @icon_theme_path: A custom path for finding icons. - - Creates a new #AppIndicator setting the properties: - #AppIndicator:id with @id, #AppIndicator:category - with @category, #AppIndicator:icon-name with - @icon_name and #AppIndicator:icon-theme-path with @icon_theme_path. - - Return value: A pointer to a new #AppIndicator object. + * app_indicator_new_with_path: + * @id: The unique id of the indicator to create. + * @icon_name: The icon name for this indicator + * @category: The category of indicator. + * @icon_theme_path: A custom path for finding icons. + + * Creates a new #AppIndicator setting the properties: + * #AppIndicator:id with @id, #AppIndicator:category with @category, + * #AppIndicator:icon-name with @icon_name and #AppIndicator:icon-theme-path + * with @icon_theme_path. + * + * Return value: A pointer to a new #AppIndicator object. */ AppIndicator * app_indicator_new_with_path (const gchar *id, @@ -1620,20 +1701,20 @@ app_indicator_new_with_path (const gchar *id, } /** - app_indicator_get_type: - - Generates or returns the unique #GType for #AppIndicator. - - Return value: A unique #GType for #AppIndicator objects. -*/ + * app_indicator_get_type: + * + * Generates or returns the unique #GType for #AppIndicator. + * + * Return value: A unique #GType for #AppIndicator objects. + */ /** - app_indicator_set_status: - @self: The #AppIndicator object to use - @status: The status to set for this indicator - - Wrapper function for property #AppIndicator:status. -*/ + * app_indicator_set_status: + * @self: The #AppIndicator object to use + * @status: The status to set for this indicator + * + * Wrapper function for property #AppIndicator:status. + */ void app_indicator_set_status (AppIndicator *self, AppIndicatorStatus status) { @@ -1667,15 +1748,15 @@ app_indicator_set_status (AppIndicator *self, AppIndicatorStatus status) } /** - app_indicator_set_attention_icon: - @self: The #AppIndicator object to use - @icon_name: The name of the attention icon to set for this indicator - - Wrapper for app_indicator_set_attention_icon_full() with a NULL - description. - - Deprecated: Use app_indicator_set_attention_icon_full() instead. -*/ + * app_indicator_set_attention_icon: + * @self: The #AppIndicator object to use + * @icon_name: The name of the attention icon to set for this indicator + * + * Wrapper for app_indicator_set_attention_icon_full() with a NULL + * description. + * + * Deprecated: Use app_indicator_set_attention_icon_full() instead. + */ void app_indicator_set_attention_icon (AppIndicator *self, const gchar *icon_name) { @@ -1683,13 +1764,13 @@ app_indicator_set_attention_icon (AppIndicator *self, const gchar *icon_name) } /** - app_indicator_set_attention_icon_full: - @self: The #AppIndicator object to use - @icon_name: The name of the attention icon to set for this indicator - @icon_desc: A textual description of the icon - - Wrapper function for property #AppIndicator:attention-icon-name. -*/ + * app_indicator_set_attention_icon_full: + * @self: The #AppIndicator object to use + * @icon_name: The name of the attention icon to set for this indicator + * @icon_desc: A textual description of the icon + * + * Wrapper function for property #AppIndicator:attention-icon-name. + */ void app_indicator_set_attention_icon_full (AppIndicator *self, const gchar *icon_name, const gchar * icon_desc) { @@ -1740,15 +1821,15 @@ app_indicator_set_attention_icon_full (AppIndicator *self, const gchar *icon_nam } /** - app_indicator_set_icon: - @self: The #AppIndicator object to use - @icon_name: The icon name to set. - - Wrapper function for app_indicator_set_icon_full() with a NULL - description. - - Deprecated: Use app_indicator_set_icon_full() -**/ + * app_indicator_set_icon: + * @self: The #AppIndicator object to use + * @icon_name: The icon name to set. + * + * Wrapper function for app_indicator_set_icon_full() with a NULL + * description. + * + * Deprecated: Use app_indicator_set_icon_full() + */ void app_indicator_set_icon (AppIndicator *self, const gchar *icon_name) { @@ -1756,18 +1837,18 @@ app_indicator_set_icon (AppIndicator *self, const gchar *icon_name) } /** - app_indicator_set_icon_full: - @self: The #AppIndicator object to use - @icon_name: The icon name to set. - @icon_desc: A textual description of the icon for accessibility - - Sets the default icon to use when the status is active but - not set to attention. In most cases, this should be the - application icon for the program. - - Wrapper function for property #AppIndicator:icon-name and - #AppIndicator::icon-desc. -**/ + * app_indicator_set_icon_full: + * @self: The #AppIndicator object to use + * @icon_name: The icon name to set. + * @icon_desc: A textual description of the icon for accessibility + * + * Sets the default icon to use when the status is active but + * not set to attention. In most cases, this should be the + * application icon for the program. + * + * Wrapper function for property #AppIndicator:icon-name and + * #AppIndicator::icon-desc. + */ void app_indicator_set_icon_full (AppIndicator *self, const gchar *icon_name, const gchar * icon_desc) { @@ -1818,14 +1899,14 @@ app_indicator_set_icon_full (AppIndicator *self, const gchar *icon_name, const g } /** - app_indicator_set_label: - @self: The #AppIndicator object to use - @label: The label to show next to the icon. - @guide: A guide to size the label correctly. - - This is a wrapper function for the #AppIndicator:label and - #AppIndicator:guide properties. This function can take #NULL - as either @label or @guide and will clear the entries. + * app_indicator_set_label: + * @self: The #AppIndicator object to use + * @label: The label to show next to the icon. + * @guide: A guide to size the label correctly. + * + * This is a wrapper function for the #AppIndicator:label and + * #AppIndicator:guide properties. This function can take #NULL + * as either @label or @guide and will clear the entries. */ void app_indicator_set_label (AppIndicator *self, const gchar * label, const gchar * guide) @@ -1843,12 +1924,12 @@ app_indicator_set_label (AppIndicator *self, const gchar * label, const gchar * } /** - app_indicator_set_icon_theme_path: - @self: The #AppIndicator object to use - @icon_theme_path: The icon theme path to set. - - Sets the path to use when searching for icons. -**/ + * app_indicator_set_icon_theme_path: + * @self: The #AppIndicator object to use + * @icon_theme_path: The icon theme path to set. + * + * Sets the path to use when searching for icons. + */ void app_indicator_set_icon_theme_path (AppIndicator *self, const gchar *icon_theme_path) { @@ -1915,16 +1996,16 @@ setup_dbusmenu (AppIndicator *self) } /** - app_indicator_set_menu: - @self: The #AppIndicator - @menu: A #GtkMenu to set - - Sets the menu that should be shown when the Application Indicator - is clicked on in the panel. An application indicator will not - be rendered unless it has a menu. - - Wrapper function for property #AppIndicator:menu. -**/ + * app_indicator_set_menu: + * @self: The #AppIndicator + * @menu: (allow-none): A #GtkMenu to set + * + * Sets the menu that should be shown when the Application Indicator + * is clicked on in the panel. An application indicator will not + * be rendered unless it has a menu. + * + * Wrapper function for property #AppIndicator:menu. + */ void app_indicator_set_menu (AppIndicator *self, GtkMenu *menu) { @@ -1946,22 +2027,24 @@ app_indicator_set_menu (AppIndicator *self, GtkMenu *menu) setup_dbusmenu (self); + priv->sec_activate_enabled = widget_is_menu_child (self, priv->sec_activate_target); + check_connect (self); return; } /** - app_indicator_set_ordering_index: - @self: The #AppIndicator - @ordering_index: A value for the ordering of this app indicator - - Sets the ordering index for the app indicator which effects the - placement of it on the panel. For almost all app indicator - this is not the function you're looking for. - - Wrapper function for property #AppIndicator:ordering-index. -**/ + * app_indicator_set_ordering_index: + * @self: The #AppIndicator + * @ordering_index: A value for the ordering of this app indicator + * + * Sets the ordering index for the app indicator which effects the + * placement of it on the panel. For almost all app indicator + * this is not the function you're looking for. + * + * Wrapper function for property #AppIndicator:ordering-index. + */ void app_indicator_set_ordering_index (AppIndicator *self, guint32 ordering_index) { @@ -1973,13 +2056,52 @@ app_indicator_set_ordering_index (AppIndicator *self, guint32 ordering_index) } /** - app_indicator_get_id: - @self: The #AppIndicator object to use + * app_indicator_set_secondary_activate_target: + * @self: The #AppIndicator + * @menuitem: (allow-none): A #GtkWidget to be activated on secondary activation + * + * Set the @menuitem to be activated when a secondary activation event (i.e. a + * middle-click) is emitted over the #AppIndicator icon/label. + * + * The @menuitem can be also a complex #GtkWidget, but to get activated when + * a secondary activation occurs in the #Appindicator, it must be a visible and + * active child (or inner-child) of the #AppIndicator:menu. + * + * Setting @menuitem to %NULL causes to disable this feature. + */ +void +app_indicator_set_secondary_activate_target (AppIndicator *self, GtkWidget *menuitem) +{ + g_return_if_fail (IS_APP_INDICATOR (self)); + AppIndicatorPrivate *priv = self->priv; - Wrapper function for property #AppIndicator:id. + if (priv->sec_activate_target) { + g_signal_handlers_disconnect_by_func (priv->sec_activate_target, + sec_activate_target_parent_changed, + self); + g_object_unref(G_OBJECT(priv->sec_activate_target)); + priv->sec_activate_target = NULL; + } - Return value: The current ID -*/ + if (menuitem == NULL) { + return; + } + + g_return_if_fail (GTK_IS_WIDGET (menuitem)); + + priv->sec_activate_target = g_object_ref(G_OBJECT(menuitem)); + priv->sec_activate_enabled = widget_is_menu_child(self, menuitem); + g_signal_connect(menuitem, "parent-set", G_CALLBACK(sec_activate_target_parent_changed), self); +} + +/** + * app_indicator_get_id: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:id. + * + * Return value: The current ID + */ const gchar * app_indicator_get_id (AppIndicator *self) { @@ -1989,13 +2111,13 @@ app_indicator_get_id (AppIndicator *self) } /** - app_indicator_get_category: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:category. - - Return value: The current category. -*/ + * app_indicator_get_category: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:category. + * + * Return value: The current category. + */ AppIndicatorCategory app_indicator_get_category (AppIndicator *self) { @@ -2005,13 +2127,13 @@ app_indicator_get_category (AppIndicator *self) } /** - app_indicator_get_status: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:status. - - Return value: The current status. -*/ + * app_indicator_get_status: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:status. + * + * Return value: The current status. + */ AppIndicatorStatus app_indicator_get_status (AppIndicator *self) { @@ -2021,13 +2143,13 @@ app_indicator_get_status (AppIndicator *self) } /** - app_indicator_get_icon: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:icon-name. - - Return value: The current icon name. -*/ + * app_indicator_get_icon: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:icon-name. + * + * Return value: The current icon name. + */ const gchar * app_indicator_get_icon (AppIndicator *self) { @@ -2037,12 +2159,12 @@ app_indicator_get_icon (AppIndicator *self) } /** - app_indicator_get_icon_desc: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:icon-desc. - - Return value: The current icon description. + * app_indicator_get_icon_desc: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:icon-desc. + * + * Return value: The current icon description. */ const gchar * app_indicator_get_icon_desc (AppIndicator *self) @@ -2053,13 +2175,13 @@ app_indicator_get_icon_desc (AppIndicator *self) } /** - app_indicator_get_icon_theme_path: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:icon-theme-path. - - Return value: The current icon theme path. -*/ + * app_indicator_get_icon_theme_path: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:icon-theme-path. + * + * Return value: The current icon theme path. + */ const gchar * app_indicator_get_icon_theme_path (AppIndicator *self) { @@ -2069,13 +2191,13 @@ app_indicator_get_icon_theme_path (AppIndicator *self) } /** - app_indicator_get_attention_icon: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:attention-icon-name. - - Return value: The current attention icon name. -*/ + * app_indicator_get_attention_icon: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:attention-icon-name. + * + * Return value: The current attention icon name. + */ const gchar * app_indicator_get_attention_icon (AppIndicator *self) { @@ -2085,13 +2207,13 @@ app_indicator_get_attention_icon (AppIndicator *self) } /** - app_indicator_get_attention_icon_desc: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:attention-icon-desc. - - Return value: The current attention icon description. -*/ + * app_indicator_get_attention_icon_desc: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:attention-icon-desc. + * + * Return value: The current attention icon description. + */ const gchar * app_indicator_get_attention_icon_desc (AppIndicator *self) { @@ -2101,14 +2223,14 @@ app_indicator_get_attention_icon_desc (AppIndicator *self) } /** - app_indicator_get_menu: - @self: The #AppIndicator object to use - - Gets the menu being used for this application indicator. - Wrapper function for property #AppIndicator:menu. - - Return value: (transfer none): A #GtkMenu object or %NULL if one hasn't been set. -*/ + * app_indicator_get_menu: + * @self: The #AppIndicator object to use + * + * Gets the menu being used for this application indicator. + * Wrapper function for property #AppIndicator:menu. + * + * Returns: (transfer none): A #GtkMenu object or %NULL if one hasn't been set. + */ GtkMenu * app_indicator_get_menu (AppIndicator *self) { @@ -2122,13 +2244,13 @@ app_indicator_get_menu (AppIndicator *self) } /** - app_indicator_get_label: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:label. - - Return value: The current label. -*/ + * app_indicator_get_label: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:label. + * + * Return value: The current label. + */ const gchar * app_indicator_get_label (AppIndicator *self) { @@ -2138,13 +2260,13 @@ app_indicator_get_label (AppIndicator *self) } /** - app_indicator_get_label_guide: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:label-guide. - - Return value: The current label guide. -*/ + * app_indicator_get_label_guide: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:label-guide. + * + * Return value: The current label guide. + */ const gchar * app_indicator_get_label_guide (AppIndicator *self) { @@ -2154,13 +2276,13 @@ app_indicator_get_label_guide (AppIndicator *self) } /** - app_indicator_get_ordering_index: - @self: The #AppIndicator object to use - - Wrapper function for property #AppIndicator:ordering-index. - - Return value: The current ordering index. -*/ + * app_indicator_get_ordering_index: + * @self: The #AppIndicator object to use + * + * Wrapper function for property #AppIndicator:ordering-index. + * + * Return value: The current ordering index. + */ guint32 app_indicator_get_ordering_index (AppIndicator *self) { @@ -2173,6 +2295,22 @@ app_indicator_get_ordering_index (AppIndicator *self) } } +/** + * app_indicator_get_secondary_activate_target: + * @self: The #AppIndicator object to use + * + * Gets the menuitem being called on secondary-activate event. + * + * Returns: (transfer none): A #GtkWidget object or %NULL if none has been set. + */ +GtkWidget * +app_indicator_get_secondary_activate_target (AppIndicator *self) +{ + g_return_val_if_fail (IS_APP_INDICATOR (self), NULL); + + return GTK_WIDGET(self->priv->sec_activate_target); +} + #define APP_INDICATOR_SHORTY_NICK "app-indicator-shorty-nick" /* Callback when an item from the desktop shortcuts gets @@ -2195,14 +2333,14 @@ shorty_activated_cb (DbusmenuMenuitem * mi, guint timestamp, gpointer user_data) } /** - app_indicator_build_menu_from_desktop: - @self: The #AppIndicator object to use - @desktop_file: A path to the desktop file to build the menu from - @desktop_profile: Which entries should be used from the desktop file - - This function allows for building the Application Indicator menu - from a static desktop file. -*/ + * app_indicator_build_menu_from_desktop: + * @self: The #AppIndicator object to use + * @desktop_file: A path to the desktop file to build the menu from + * @desktop_profile: Which entries should be used from the desktop file + * + * This function allows for building the Application Indicator menu + * from a static desktop file. + */ void app_indicator_build_menu_from_desktop (AppIndicator * self, const gchar * desktop_file, const gchar * desktop_profile) { diff --git a/src/app-indicator.h b/src/app-indicator.h index f96212d..6922248 100644 --- a/src/app-indicator.h +++ b/src/app-indicator.h @@ -35,40 +35,40 @@ License version 3 and version 2.1 along with this program. If not, see G_BEGIN_DECLS /** - APP_INDICATOR_TYPE: - - Get the #GType for a #AppIndicator. -*/ + * APP_INDICATOR_TYPE: + * + * Get the #GType for a #AppIndicator. + */ /** - APP_INDICATOR: - @obj: The object to convert - - Safely convert a #GObject into an #AppIndicator. -*/ + * APP_INDICATOR: + * @obj: The object to convert + * + * Safely convert a #GObject into an #AppIndicator. + */ /** - APP_INDICATOR_CLASS: - @klass: #GObjectClass based class to convert. - - Safely convert a #GObjectClass into a #AppIndicatorClass. -*/ + * APP_INDICATOR_CLASS: + * @klass: #GObjectClass based class to convert. + * + * Safely convert a #GObjectClass into a #AppIndicatorClass. + */ /** - IS_APP_INDICATOR: - @obj: An #GObject to check - - Checks to see if @obj is in the object hierarchy of #AppIndicator. -*/ + * IS_APP_INDICATOR: + * @obj: An #GObject to check + * + * Checks to see if @obj is in the object hierarchy of #AppIndicator. + */ /** - IS_APP_INDICATOR_CLASS: - @klass: An #GObjectClass to check - - Checks to see if @klass is in the object class hierarchy of #AppIndicatorClass. -*/ + * IS_APP_INDICATOR_CLASS: + * @klass: An #GObjectClass to check + * + * Checks to see if @klass is in the object class hierarchy of #AppIndicatorClass. + */ /** - APP_INDICATOR_GET_CLASS: - @obj: A #GObject in the class hierarchy of #AppIndicator. - - Gets a pointer to the #AppIndicatorClass for the object @obj. -*/ + * APP_INDICATOR_GET_CLASS: + * @obj: A #GObject in the class hierarchy of #AppIndicator. + * + * Gets a pointer to the #AppIndicatorClass for the object @obj. + */ #define APP_INDICATOR_TYPE (app_indicator_get_type ()) #define APP_INDICATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), APP_INDICATOR_TYPE, AppIndicator)) @@ -78,40 +78,40 @@ G_BEGIN_DECLS #define APP_INDICATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), APP_INDICATOR_TYPE, AppIndicatorClass)) /** - APP_INDICATOR_SIGNAL_NEW_ICON: - - String identifier for the #AppIndicator::new-icon signal. -*/ + * APP_INDICATOR_SIGNAL_NEW_ICON: + * + * String identifier for the #AppIndicator::new-icon signal. + */ /** - APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON: - - String identifier for the #AppIndicator::new-attention-icon signal. -*/ + * APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON: + * + * String identifier for the #AppIndicator::new-attention-icon signal. + */ /** - APP_INDICATOR_SIGNAL_NEW_STATUS: - - String identifier for the #AppIndicator::new-status signal. -*/ + * APP_INDICATOR_SIGNAL_NEW_STATUS: + * + * String identifier for the #AppIndicator::new-status signal. + */ /** - APP_INDICATOR_SIGNAL_NEW_LABEL: - - String identifier for the #AppIndicator::new-label signal. -*/ + * APP_INDICATOR_SIGNAL_NEW_LABEL: + * + * String identifier for the #AppIndicator::new-label signal. + */ /** - APP_INDICATOR_SIGNAL_CONNECTION_CHANGED: - - String identifier for the #AppIndicator::connection-changed signal. -*/ + * APP_INDICATOR_SIGNAL_CONNECTION_CHANGED: + * + * String identifier for the #AppIndicator::connection-changed signal. + */ /** - APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: - - String identifier for the #AppIndicator::new-icon-theme-path signal. -*/ + * APP_INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: + * + * String identifier for the #AppIndicator::new-icon-theme-path signal. + */ /** - APP_INDICATOR_SIGNAL_SCROLL_EVENT: - - String identifier for the #AppIndicator::scroll-event signal. -*/ + * APP_INDICATOR_SIGNAL_SCROLL_EVENT: + * + * String identifier for the #AppIndicator::scroll-event signal. + */ #define APP_INDICATOR_SIGNAL_NEW_ICON "new-icon" #define APP_INDICATOR_SIGNAL_NEW_ATTENTION_ICON "new-attention-icon" #define APP_INDICATOR_SIGNAL_NEW_STATUS "new-status" @@ -121,16 +121,16 @@ G_BEGIN_DECLS #define APP_INDICATOR_SIGNAL_SCROLL_EVENT "scroll-event" /** - AppIndicatorCategory: - @APP_INDICATOR_CATEGORY_APPLICATION_STATUS: The indicator is used to display the status of the application. - @APP_INDICATOR_CATEGORY_COMMUNICATIONS: The application is used for communication with other people. - @APP_INDICATOR_CATEGORY_SYSTEM_SERVICES: A system indicator relating to something in the user's system. - @APP_INDICATOR_CATEGORY_HARDWARE: An indicator relating to the user's hardware. - @APP_INDICATOR_CATEGORY_OTHER: Something not defined in this enum, please don't use unless you really need it. - - The category provides grouping for the indicators so that - users can find indicators that are similar together. -*/ + * AppIndicatorCategory: + * @APP_INDICATOR_CATEGORY_APPLICATION_STATUS: The indicator is used to display the status of the application. + * @APP_INDICATOR_CATEGORY_COMMUNICATIONS: The application is used for communication with other people. + * @APP_INDICATOR_CATEGORY_SYSTEM_SERVICES: A system indicator relating to something in the user's system. + * @APP_INDICATOR_CATEGORY_HARDWARE: An indicator relating to the user's hardware. + * @APP_INDICATOR_CATEGORY_OTHER: Something not defined in this enum, please don't use unless you really need it. + * + * The category provides grouping for the indicators so that + * users can find indicators that are similar together. + */ typedef enum { /*< prefix=APP_INDICATOR_CATEGORY >*/ APP_INDICATOR_CATEGORY_APPLICATION_STATUS, /*< nick=ApplicationStatus >*/ APP_INDICATOR_CATEGORY_COMMUNICATIONS, /*< nick=Communications >*/ @@ -140,16 +140,16 @@ typedef enum { /*< prefix=APP_INDICATOR_CATEGORY >*/ } AppIndicatorCategory; /** - AppIndicatorStatus: - @APP_INDICATOR_STATUS_PASSIVE: The indicator should not be shown to the user. - @APP_INDICATOR_STATUS_ACTIVE: The indicator should be shown in it's default state. - @APP_INDICATOR_STATUS_ATTENTION: The indicator should show it's attention icon. - - These are the states that the indicator can be on in - the user's panel. The indicator by default starts - in the state @APP_INDICATOR_STATUS_PASSIVE and can be - shown by setting it to @APP_INDICATOR_STATUS_ACTIVE. -*/ + * AppIndicatorStatus: + * @APP_INDICATOR_STATUS_PASSIVE: The indicator should not be shown to the user. + * @APP_INDICATOR_STATUS_ACTIVE: The indicator should be shown in it's default state. + * @APP_INDICATOR_STATUS_ATTENTION: The indicator should show it's attention icon. + * + * These are the states that the indicator can be on in + * the user's panel. The indicator by default starts + * in the state @APP_INDICATOR_STATUS_PASSIVE and can be + * shown by setting it to @APP_INDICATOR_STATUS_ACTIVE. + */ typedef enum { /*< prefix=APP_INDICATOR_STATUS >*/ APP_INDICATOR_STATUS_PASSIVE, /*< nick=Passive >*/ APP_INDICATOR_STATUS_ACTIVE, /*< nick=Active >*/ @@ -161,30 +161,30 @@ typedef struct _AppIndicatorClass AppIndicatorClass; typedef struct _AppIndicatorPrivate AppIndicatorPrivate; /** - AppIndicatorClass: - @parent_class: Mia familia - @new_icon: Slot for #AppIndicator::new-icon. - @new_attention_icon: Slot for #AppIndicator::new-attention-icon. - @new_status: Slot for #AppIndicator::new-status. - @new_icon_theme_path: Slot for #AppIndicator::new-icon-theme-path - @new_label: Slot for #AppIndicator::new-label. - @connection_changed: Slot for #AppIndicator::connection-changed. - @scroll_event: Slot for #AppIndicator::scroll-event - @app_indicator_reserved_ats: Reserved for future use. - @fallback: Function that gets called to make a #GtkStatusIcon when - there is no Application Indicator area available. - @unfallback: The function that gets called if an Application - Indicator area appears after the fallback has been created. - @app_indicator_reserved_1: Reserved for future use. - @app_indicator_reserved_2: Reserved for future use. - @app_indicator_reserved_3: Reserved for future use. - @app_indicator_reserved_4: Reserved for future use. - @app_indicator_reserved_5: Reserved for future use. - @app_indicator_reserved_6: Reserved for future use. - - The signals and external functions that make up the #AppIndicator - class object. -*/ + * AppIndicatorClass: + * @parent_class: Mia familia + * @new_icon: Slot for #AppIndicator::new-icon. + * @new_attention_icon: Slot for #AppIndicator::new-attention-icon. + * @new_status: Slot for #AppIndicator::new-status. + * @new_icon_theme_path: Slot for #AppIndicator::new-icon-theme-path + * @new_label: Slot for #AppIndicator::new-label. + * @connection_changed: Slot for #AppIndicator::connection-changed. + * @scroll_event: Slot for #AppIndicator::scroll-event + * @app_indicator_reserved_ats: Reserved for future use. + * @fallback: Function that gets called to make a #GtkStatusIcon when + * there is no Application Indicator area available. + * @unfallback: The function that gets called if an Application + * Indicator area appears after the fallback has been created. + * @app_indicator_reserved_1: Reserved for future use. + * @app_indicator_reserved_2: Reserved for future use. + * @app_indicator_reserved_3: Reserved for future use. + * @app_indicator_reserved_4: Reserved for future use. + * @app_indicator_reserved_5: Reserved for future use. + * @app_indicator_reserved_6: Reserved for future use. + * + * The signals and external functions that make up the #AppIndicator + * class object. + */ struct _AppIndicatorClass { /* Parent */ GObjectClass parent_class; @@ -232,19 +232,18 @@ struct _AppIndicatorClass { }; /** - AppIndicator: - - A application indicator represents the values that are needed to show a - unique status in the panel for an application. In general, applications - should try to fit in the other indicators that are available on the - panel before using this. But, sometimes it is necissary. -*/ -/* Private fields - @parent: Parent object. - @priv: Internal data. -*/ + * AppIndicator: + * + * A application indicator represents the values that are needed to show a + * unique status in the panel for an application. In general, applications + * should try to fit in the other indicators that are available on the + * panel before using this. But, sometimes it is necissary. + * + * Private fields + * @parent: Parent object. + * @priv: Internal data. + */ struct _AppIndicator { - /*< Private >*/ GObject parent; /*< Private >*/ @@ -284,6 +283,8 @@ void app_indicator_set_icon_theme_path(AppIndicator const gchar *icon_theme_path); void app_indicator_set_ordering_index (AppIndicator *self, guint32 ordering_index); +void app_indicator_set_secondary_activate_target (AppIndicator *self, + GtkWidget *menuitem); /* Get properties */ const gchar * app_indicator_get_id (AppIndicator *self); @@ -294,10 +295,12 @@ const gchar * app_indicator_get_icon_desc (AppIndic const gchar * app_indicator_get_icon_theme_path (AppIndicator *self); const gchar * app_indicator_get_attention_icon (AppIndicator *self); const gchar * app_indicator_get_attention_icon_desc (AppIndicator *self); + GtkMenu * app_indicator_get_menu (AppIndicator *self); const gchar * app_indicator_get_label (AppIndicator *self); const gchar * app_indicator_get_label_guide (AppIndicator *self); guint32 app_indicator_get_ordering_index (AppIndicator *self); +GtkWidget * app_indicator_get_secondary_activate_target (AppIndicator *self); /* Helpers */ void app_indicator_build_menu_from_desktop (AppIndicator * self, @@ -307,20 +310,20 @@ void app_indicator_build_menu_from_desktop (AppIndica G_END_DECLS /** - SECTION:app-indicator - @short_description: An object to put application information - into the panel. - @stability: Unstable - @include: libappindicator/app-indicator.h - - An application indicator is a way for an application to put - a menu into the panel on the user's screen. This allows the - user to interact with the application even though it might - not be visible to the user at the time. In most cases this - is not a good solution as there are other ways to inform the - user. It should only be use if persistence is a desired - feature for the user (not for your marketing purpose of - having your logo in the panel). -*/ + * SECTION:app-indicator + * @short_description: An object to put application information + * into the panel. + * @stability: Unstable + * @include: libappindicator/app-indicator.h + * + * An application indicator is a way for an application to put + * a menu into the panel on the user's screen. This allows the + * user to interact with the application even though it might + * not be visible to the user at the time. In most cases this + * is not a good solution as there are other ways to inform the + * user. It should only be use if persistence is a desired + * feature for the user (not for your marketing purpose of + * having your logo in the panel). + */ #endif diff --git a/src/application-service-marshal.c b/src/application-service-marshal.c index fb940b7..d077981 100644 --- a/src/application-service-marshal.c +++ b/src/application-service-marshal.c @@ -286,3 +286,40 @@ _application_service_marshal_VOID__INT_UINT (GClosure *closure, data2); } +/* VOID:INT,INT (./application-service-marshal.list:25) */ +void +_application_service_marshal_VOID__INT_INT (GClosure *closure, + GValue *return_value G_GNUC_UNUSED, + guint n_param_values, + const GValue *param_values, + gpointer invocation_hint G_GNUC_UNUSED, + gpointer marshal_data) +{ + typedef void (*GMarshalFunc_VOID__INT_INT) (gpointer data1, + gint arg_1, + gint arg_2, + gpointer data2); + register GMarshalFunc_VOID__INT_INT callback; + register GCClosure *cc = (GCClosure*) closure; + register gpointer data1, data2; + + g_return_if_fail (n_param_values == 3); + + if (G_CCLOSURE_SWAP_DATA (closure)) + { + data1 = closure->data; + data2 = g_value_peek_pointer (param_values + 0); + } + else + { + data1 = g_value_peek_pointer (param_values + 0); + data2 = closure->data; + } + callback = (GMarshalFunc_VOID__INT_INT) (marshal_data ? marshal_data : cc->callback); + + callback (data1, + g_marshal_value_peek_int (param_values + 1), + g_marshal_value_peek_int (param_values + 2), + data2); +} + diff --git a/src/application-service-marshal.list b/src/application-service-marshal.list index 39a55fe..ae3aa6f 100644 --- a/src/application-service-marshal.list +++ b/src/application-service-marshal.list @@ -22,3 +22,4 @@ VOID: INT, STRING VOID: STRING, STRING VOID: BOOL, STRING, OBJECT VOID: INT, UINT +VOID: INT, INT diff --git a/src/gen-notification-item.xml.c b/src/gen-notification-item.xml.c index aa2ee0d..0a442a8 100644 --- a/src/gen-notification-item.xml.c +++ b/src/gen-notification-item.xml.c @@ -24,6 +24,13 @@ const char * _notification_item = " <arg type=\"i\" name=\"delta\" direction=\"in\" />\n" " <arg type=\"s\" name=\"orientation\" direction=\"in\" />\n" " </method>\n" +" <method name=\"SecondaryActivate\">\n" +" <arg type=\"i\" name=\"x\" direction=\"in\" />\n" +" <arg type=\"i\" name=\"y\" direction=\"in\" />\n" +" </method>\n" +" <method name=\"XAyatanaSecondaryActivate\">\n" +" <arg type=\"u\" name=\"timestamp\" direction=\"in\" />\n" +" </method>\n" "\n" "<!-- Signals -->\n" " <signal name=\"NewIcon\">\n" diff --git a/src/notification-item.xml b/src/notification-item.xml index bbf77c5..589a438 100644 --- a/src/notification-item.xml +++ b/src/notification-item.xml @@ -23,6 +23,13 @@ <arg type="i" name="delta" direction="in" /> <arg type="s" name="orientation" direction="in" /> </method> + <method name="SecondaryActivate"> + <arg type="i" name="x" direction="in" /> + <arg type="i" name="y" direction="in" /> + </method> + <method name="XAyatanaSecondaryActivate"> + <arg type="u" name="timestamp" direction="in" /> + </method> <!-- Signals --> <signal name="NewIcon"> |