diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rwxr-xr-x | configure | 20 | ||||
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | docs/reference/libappindicator-docs.sgml | 2 | ||||
-rw-r--r-- | docs/reference/version.xml | 2 | ||||
-rw-r--r-- | example/Makefile.am | 6 | ||||
-rw-r--r-- | example/Makefile.in | 4 | ||||
-rw-r--r-- | example/simple-client-vala.vala | 170 |
8 files changed, 198 insertions, 18 deletions
@@ -2,6 +2,14 @@ 2011-02-10 Ted Gould <ted@gould.cx> + 0.2.94 + +2011-02-10 Ted Gould <ted@gould.cx> + + Make sure to pull the vala source file along with us. + +2011-02-10 Ted Gould <ted@gould.cx> + 0.2.93 2011-02-10 Ted Gould <ted@gould.cx> @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.67 for libappindicator 0.2.93. +# Generated by GNU Autoconf 2.67 for libappindicator 0.2.94. # # Report bugs to <ted@canonical.com>. # @@ -763,8 +763,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libappindicator' PACKAGE_TARNAME='libappindicator' -PACKAGE_VERSION='0.2.93' -PACKAGE_STRING='libappindicator 0.2.93' +PACKAGE_VERSION='0.2.94' +PACKAGE_STRING='libappindicator 0.2.94' PACKAGE_BUGREPORT='ted@canonical.com' PACKAGE_URL='' @@ -1581,7 +1581,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.2.93 to adapt to many kinds of systems. +\`configure' configures libappindicator 0.2.94 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1651,7 +1651,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libappindicator 0.2.93:";; + short | recursive ) echo "Configuration of libappindicator 0.2.94:";; esac cat <<\_ACEOF @@ -1793,7 +1793,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libappindicator configure 0.2.93 +libappindicator configure 0.2.94 generated by GNU Autoconf 2.67 Copyright (C) 2010 Free Software Foundation, Inc. @@ -2073,7 +2073,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.2.93, which was +It was created by libappindicator $as_me 0.2.94, which was generated by GNU Autoconf 2.67. Invocation command line was $ $0 $@ @@ -2894,7 +2894,7 @@ fi # Define the identity of the package. PACKAGE=libappindicator - VERSION=0.2.93 + VERSION=0.2.94 cat >>confdefs.h <<_ACEOF @@ -14120,7 +14120,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.2.93, which was +This file was extended by libappindicator $as_me 0.2.94, which was generated by GNU Autoconf 2.67. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14186,7 +14186,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.2.93 +libappindicator config.status 0.2.94 configured by $0, generated by GNU Autoconf 2.67, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 24ef4e8..12fcb74 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,11 @@ -AC_INIT(libappindicator, 0.2.93, ted@canonical.com) +AC_INIT(libappindicator, 0.2.94, ted@canonical.com) AC_COPYRIGHT([Copyright 2009, 2010 Canonical]) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(libappindicator, 0.2.93) +AM_INIT_AUTOMAKE(libappindicator, 0.2.94) AM_MAINTAINER_MODE diff --git a/docs/reference/libappindicator-docs.sgml b/docs/reference/libappindicator-docs.sgml index 999432e..7c5fc38 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.2.93 + for libappindicator 0.2.94 </releaseinfo> </bookinfo> diff --git a/docs/reference/version.xml b/docs/reference/version.xml index b50a1f4..cd47fa2 100644 --- a/docs/reference/version.xml +++ b/docs/reference/version.xml @@ -1 +1 @@ -0.2.93 +0.2.94 diff --git a/example/Makefile.am b/example/Makefile.am index 606317c..dbea724 100644 --- a/example/Makefile.am +++ b/example/Makefile.am @@ -5,6 +5,7 @@ VER= endif CLEANFILES = +EXTRA_DIST = check_PROGRAMS = \ simple-client \ @@ -27,7 +28,7 @@ simple_client_LDADD = \ $(LIBRARY_LIBS) \ $(top_builddir)/src/libappindicator$(VER).la -EXTRA_DIST = \ +EXTRA_DIST += \ simple-client-test-icon.png ######################################### @@ -54,3 +55,6 @@ simple_client_vala_LDADD = $(simple_client_LDADD) CLEANFILES += *.stamp *-vala.c endif + +EXTRA_DIST += \ + simple-client-vala.vala diff --git a/example/Makefile.in b/example/Makefile.in index c848ea3..7b73757 100644 --- a/example/Makefile.in +++ b/example/Makefile.in @@ -271,6 +271,7 @@ top_srcdir = @top_srcdir@ @USE_GTK3_FALSE@VER = @USE_GTK3_TRUE@VER = 3 CLEANFILES = $(am__append_1) +EXTRA_DIST = simple-client-test-icon.png simple-client-vala.vala ######################################### ######################################### @@ -287,9 +288,6 @@ simple_client_LDADD = \ $(LIBRARY_LIBS) \ $(top_builddir)/src/libappindicator$(VER).la -EXTRA_DIST = \ - simple-client-test-icon.png - ######################################### ######################################### diff --git a/example/simple-client-vala.vala b/example/simple-client-vala.vala new file mode 100644 index 0000000..61e0c2f --- /dev/null +++ b/example/simple-client-vala.vala @@ -0,0 +1,170 @@ +/* +A small piece of sample code demonstrating a very simple application +with an indicator. + +Copyright 2011 Canonical Ltd. + +Authors: + Marco Trevisan <mail@3v1n0.net> + +This program is free software: you can redistribute it and/or modify it +under the terms of the GNU General Public License version 3, as published +by the Free Software Foundation. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranties of +MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR +PURPOSE. See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License along +with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +using Gtk; +using AppIndicator; + +static int main(string[] args) { + var sc = new SimpleClient(args); + sc.run(); + return 0; +} + +class SimpleClient { + Menu menu; + Indicator ci; + int percentage; + bool active; + bool can_haz_label; + + public SimpleClient(string[] args) { + Gtk.init(ref args); + + ci = new Indicator("example-simple-client", + "indicator-messages", + IndicatorCategory.APPLICATION_STATUS); + + ci.set_status(IndicatorStatus.ACTIVE); + ci.set_attention_icon("indicator-messages-new"); + ci.set_label("1%", "100%"); + + active = true; + can_haz_label = true; + } + + private void toggle_sensitivity(Widget widget) { + widget.set_sensitive(!widget.is_sensitive()); + } + + private void append_submenu(MenuItem item) { + var menu = new Menu(); + MenuItem mi; + + mi = new MenuItem.with_label("Sub 1"); + menu.append(mi); + mi.activate.connect(() => { print("Sub1\n"); }); + + MenuItem prev_mi = mi; + mi = new MenuItem.with_label("Sub 2"); + menu.append(mi); + mi.activate.connect(() => { toggle_sensitivity(prev_mi); }); + + mi = new MenuItem.with_label("Sub 3"); + menu.append(mi); + mi.activate.connect(() => { print("Sub3\n"); }); + + menu.show_all(); + item.set_submenu(menu); + } + + private void label_toggle(MenuItem item) { + can_haz_label = !can_haz_label; + + if (can_haz_label) { + item.set_label("Hide label"); + } else { + item.set_label("Show label"); + } + } + + public void run() { + + ci.scroll_event.connect((delta, direction) => { + print(@"Got scroll event! delta: $delta, direction: $direction\n"); + }); + + Timeout.add_seconds(1, () => { + percentage = (percentage + 1) % 100; + if (can_haz_label) { + ci.set_label(@"$(percentage+1)%", ""); + } else { + ci.set_label("", ""); + } + return true; + }); + + menu = new Menu(); + var chk = new CheckMenuItem.with_label("1"); + chk.activate.connect(() => { print("1\n"); }); + menu.append(chk); + chk.show(); + + var radio = new RadioMenuItem.with_label(new SList<RadioMenuItem>(), "2"); + radio.activate.connect(() => { print("2\n"); }); + menu.append(radio); + radio.show(); + + var submenu = new MenuItem.with_label("3"); + menu.append(submenu); + append_submenu(submenu); + submenu.show(); + + var toggle_item = new MenuItem.with_label("Toggle 3"); + toggle_item.activate.connect(() => { toggle_sensitivity(submenu); }); + menu.append(toggle_item); + toggle_item.show(); + + var imgitem = new ImageMenuItem.from_stock(Stock.NEW, null); + imgitem.activate.connect(() => { + Image img = (Image) imgitem.get_image(); + img.set_from_stock(Stock.OPEN, IconSize.MENU); + }); + menu.append(imgitem); + imgitem.show(); + + var att = new MenuItem.with_label("Get Attention"); + att.activate.connect(() => { + if (active) { + ci.set_status(IndicatorStatus.ATTENTION); + att.set_label("I'm okay now"); + active = false; + } else { + ci.set_status(IndicatorStatus.ACTIVE); + att.set_label("Get Attention"); + active = false; + } + }); + menu.append(att); + att.show(); + + var show = new MenuItem.with_label("Show Label"); + label_toggle(show); + show.activate.connect(() => { label_toggle(show); }); + menu.append(show); + show.show(); + + var icon = new CheckMenuItem.with_label("Set Local Icon"); + icon.activate.connect(() => { + if (icon.get_active()) { + ci.set_icon("simple-client-test-icon.png"); + } else { + ci.set_icon("indicator-messages"); + } + }); + menu.append(icon); + icon.show(); + + ci.set_menu(menu); + + Gtk.main(); + } +} |