Merge lp:~larsu/indicator-messages/notify-stopped-running into lp:indicator-messages/0.5

Proposed by Lars Karlitski
Status: Superseded
Proposed branch: lp:~larsu/indicator-messages/notify-stopped-running
Merge into: lp:indicator-messages/0.5
Diff against target: 16308 lines (+8289/-7135)
98 files modified
.bzr-builddeb/default.conf (+2/-0)
.bzrignore (+65/-49)
Makefile.am (+21/-1)
Makefile.am.coverage (+48/-0)
NEWS (+42/-0)
autogen.sh (+5/-11)
configure.ac (+72/-60)
data/Makefile.am (+6/-1)
data/com.canonical.indicator.messages.gschema.xml (+12/-0)
data/icons/16x16/categories/Makefile.am (+1/-1)
data/icons/16x16/status/Makefile.am (+1/-1)
data/icons/22x22/categories/Makefile.am (+1/-1)
data/icons/22x22/status/Makefile.am (+1/-1)
data/icons/24x24/status/Makefile.am (+1/-1)
data/icons/32x32/categories/Makefile.am (+1/-1)
data/icons/32x32/status/Makefile.am (+1/-1)
data/icons/48x48/status/Makefile.am (+1/-1)
data/icons/Makefile.am (+1/-1)
data/icons/scalable/categories/Makefile.am (+1/-1)
data/icons/scalable/status/Makefile.am (+1/-1)
debian/changelog (+856/-0)
debian/compat (+1/-0)
debian/control (+86/-0)
debian/copyright (+19/-0)
debian/gir1.2-messagingmenu-1.0.install (+1/-0)
debian/indicator-messages.install (+5/-0)
debian/libmessaging-menu-dev.install (+5/-0)
debian/libmessaging-menu0.install (+1/-0)
debian/libmessaging-menu0.symbols (+23/-0)
debian/rules (+17/-0)
debian/watch (+2/-0)
doc/Makefile.am (+1/-0)
doc/reference/Makefile.am (+20/-0)
doc/reference/messaging-menu-docs.xml.in (+38/-0)
libmessaging-menu/Makefile.am (+66/-0)
libmessaging-menu/gtupleaction.c (+354/-0)
libmessaging-menu/gtupleaction.h (+40/-0)
libmessaging-menu/messaging-menu.c (+1199/-0)
libmessaging-menu/messaging-menu.h (+148/-0)
libmessaging-menu/messaging-menu.pc.in (+11/-0)
m4/ax_python_module.m4 (+49/-0)
m4/gcov.m4 (+86/-0)
m4/gtest.m4 (+63/-0)
po/POTFILES.in (+0/-6)
po/indicator-messages.pot (+46/-0)
src/Makefile.am (+41/-223)
src/app-section.c (+771/-534)
src/app-section.h (+46/-45)
src/dbus-data.h (+0/-12)
src/default-applications.c (+0/-116)
src/default-applications.h (+0/-34)
src/dirs.h (+0/-4)
src/gactionmuxer.c (+485/-0)
src/gactionmuxer.h (+44/-0)
src/gmenuutils.c (+87/-0)
src/gmenuutils.h (+38/-0)
src/gsettingsstrv.c (+106/-0)
src/gsettingsstrv.h (+33/-0)
src/ido-detail-label.c (+396/-0)
src/ido-detail-label.h (+59/-0)
src/ido-menu-item.c (+425/-0)
src/ido-menu-item.h (+54/-0)
src/im-app-menu-item.c (+351/-0)
src/im-app-menu-item.h (+54/-0)
src/im-menu-item.c (+0/-538)
src/im-menu-item.h (+0/-67)
src/im-source-menu-item.c (+407/-0)
src/im-source-menu-item.h (+54/-0)
src/indicator-messages-status-provider-0.5.pc.in.in (+0/-15)
src/indicator-messages.c (+254/-690)
src/launcher-menu-item.c (+0/-392)
src/launcher-menu-item.h (+0/-68)
src/messages-service-dbus.c (+0/-267)
src/messages-service-dbus.h (+0/-62)
src/messages-service.c (+631/-1469)
src/messages-service.xml (+20/-15)
src/seen-db.c (+0/-177)
src/seen-db.h (+0/-31)
src/status-items.c (+0/-314)
src/status-items.h (+0/-38)
src/status-provider-emesene.c (+0/-348)
src/status-provider-emesene.h (+0/-56)
src/status-provider-mc5.c (+0/-308)
src/status-provider-mc5.h (+0/-56)
src/status-provider-mc5.list (+0/-1)
src/status-provider-pidgin.c (+0/-433)
src/status-provider-pidgin.h (+0/-56)
src/status-provider-pidgin.list (+0/-1)
src/status-provider-telepathy.c (+0/-385)
src/status-provider-telepathy.h (+0/-56)
src/status-provider-telepathy.list (+0/-1)
src/status-provider.c (+0/-101)
src/status-provider.h (+0/-81)
test/Makefile.am (+78/-0)
test/applications/test.desktop (+2/-0)
test/indicator-messages-service-activate.c (+0/-2)
test/test-client.py (+75/-0)
test/test-gactionmuxer.cpp (+357/-0)
To merge this branch: bzr merge lp:~larsu/indicator-messages/notify-stopped-running
Reviewer Review Type Date Requested Status
Mathieu Trudel-Lapierre Pending
PS Jenkins bot continuous-integration Pending
Review via email: mp+168201@code.launchpad.net

This proposal supersedes a proposal from 2013-02-20.

This proposal has been superseded by a proposal from 2013-06-07.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote : Posted in a previous version of this proposal

Can we add some kind of automated test for this?

review: Needs Information
Revision history for this message
Lars Karlitski (larsu) wrote : Posted in a previous version of this proposal

You're right of course. I didn't add them originally because the client lib wasn't tested at all.

Added testing for registration in r338.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Approve (continuous-integration)
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote : Posted in a previous version of this proposal

Look fine, however both autoconf-archive and python3-dbusmock are in universe and are going to need to get to main for indicator-messages to be buildable once released with this changeset.

Can you please follow the steps in the wiki for the Main Inclusion Process and file the appropriate two bugs for this?

https://wiki.ubuntu.com/MainInclusionProcess

review: Needs Information

Unmerged revisions

343. By Lars Karlitski

Remove autoconf-archive dependency (copied ax_python_module into m4/)

342. By Lars Karlitski

Use glib mainloop in dbusmock test

341. By Lars Karlitski

test-client: wait a bit longer until checking that mock methods were called

340. By Lars Karlitski

Use a special desktop file for testing

339. By Lars Karlitski

debian/control: add autoconf-archive as an explicit build dep

Needed for AC_PYTHON_MODULE

338. By Lars Karlitski

Test libmessaging-menu

Use dbusmock to test whether libmessaging-menu calls the right functions on
registration and deregistration.

337. By Lars Karlitski

Notify the service when an app unrefs its MessagingMenuApp

Prior to this patch, the messaging menu only marked apps as "not running" when
they quit (i.e. disappeared from the bus). This was okay, since most
applications only ever release the ref to their MessagingMenuApp when they
quit, or after calling _unregister explicitely (which removes them from the
menu entirely).

However, this is according to libmessagingmenu's documentation, and at least
indicator-telepathy relies on it.

336. By PS Jenkins bot

Releasing 12.10.6daily13.01.25-0ubuntu1 to ubuntu.

Approved by .

335. By Charles Kerr

remove g_type_init() calls, bump glib requirement to 2.35.4. Fixes: https://bugs.launchpad.net/bugs/1103087.

Approved by Lars Uebernickel, PS Jenkins bot.

334. By Didier Roche-Tolomelli

manual merge Releasing 12.10.6daily12.11.22-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory '.bzr-builddeb'
=== added file '.bzr-builddeb/default.conf'
--- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000
+++ .bzr-builddeb/default.conf 2013-06-07 21:39:23 +0000
@@ -0,0 +1,2 @@
1[BUILDDEB]
2split = True
03
=== modified file '.bzrignore'
--- .bzrignore 2011-07-13 15:41:33 +0000
+++ .bzrignore 2013-06-07 21:39:23 +0000
@@ -1,49 +1,65 @@
1compile1Makefile
2m42Makefile.in
3po3Makefile.in.in
4src/libmessaging.la4*.o
5src/libmessaging_la-indicator-messages.lo5*.lo
6config.guess.cdbs-orig6*.la
7config.sub.cdbs-orig7*.pot
8debian/compat8.deps
9debian/files9.libs
10debian/indicator-messages10*.valid
11debian/indicator-messages.debhelper.log11stamp-*
12debian/indicator-messages.postinst.debhelper12*.gcno
13debian/indicator-messages.postrm.debhelper13*.gcda
14debian/indicator-messages.substvars14*.stamp
15debian/stamp-autotools-files15*.gir
16debian/stamp-makefile-build16*.typelib
17libmessaging_la-im-menu-item.lo17
18src/libmessaging_la-app-menu-item.lo18/COPYING
19data/indicator-messages.service19/INSTALL
20indicator-messages-service20/compile
21indicator-messages-service-activate21/libtool
22src/messages-service-client.h22/config.*
23src/messages-service-server.h23/configure
24po/indicator-messages.pot24/aclocal.m4
25src/libmessaging_la-app-gtk-menu-item.lo25/ltmain.sh
26src/gen-messages-service.xml.c26/install-sh
27src/gen-messages-service.xml.h27/missing
28src/libemesene.la28/autom4te.cache
29src/libemesene_la-status-provider-emesene.lo29/depcomp
30src/libmc5.la30/mkinstalldirs
31src/libmc5_la-status-provider-mc5-marshal.lo31/coverage.info
32src/libmc5_la-status-provider-mc5.lo32/coveragereport
33src/libmessaging_la-gen-messages-service.xml.lo33/gtk-doc.make
34src/libpidgin.la34/indicator-messages-*.tar.gz
35src/libpidgin_la-status-provider-pidgin-marshal.lo35
36src/libpidgin_la-status-provider-pidgin.lo36/m4/*
37src/libtelepathy.la37/po/POTFILES
38src/libtelepathy_la-status-provider-telepathy-marshal.lo38/data/indicator-messages.service
39src/libtelepathy_la-status-provider-telepathy.lo39/src/indicator-messages-service
40src/status-provider-mc5-marshal.c40/src/indicator-messages-service.c
41src/status-provider-mc5-marshal.h41/src/indicator-messages-service.h
42src/status-provider-pidgin-marshal.c42
43src/status-provider-pidgin-marshal.h43/libmessaging-menu/messaging-menu.pc
44src/status-provider-telepathy-marshal.c44/libmessaging-menu/indicator-messages-service.c
45src/status-provider-telepathy-marshal.h45/libmessaging-menu/indicator-messages-service.h
46src/libindicator-messages-status-provider.la46
47src/libindicator_messages_status_provider_la-status-provider.lo47/doc/reference/html
48indicator-messages-status-provider-0.5.pc48/doc/reference/xml
49indicator-messages-status-provider-0.5.pc.in49/doc/reference/messaging-menu-decl-list.txt
50/doc/reference/messaging-menu-decl.txt
51/doc/reference/messaging-menu-docs.sgml
52/doc/reference/messaging-menu-docs.xml
53/doc/reference/messaging-menu-overrides.txt
54/doc/reference/messaging-menu-sections.txt
55/doc/reference/messaging-menu-undeclared.txt
56/doc/reference/messaging-menu-undocumented.txt
57/doc/reference/messaging-menu-unused.txt
58/doc/reference/messaging-menu.args
59/doc/reference/messaging-menu.hierarchy
60/doc/reference/messaging-menu.interfaces
61/doc/reference/messaging-menu.prerequisites
62/doc/reference/messaging-menu.signals
63/doc/reference/messaging-menu.types
64
65/test/test-gactionmuxer
5066
=== modified file 'Makefile.am'
--- Makefile.am 2010-10-08 22:13:11 +0000
+++ Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,10 +1,27 @@
11
2SUBDIRS = \2SUBDIRS = \
3 src \3 src \
4 libmessaging-menu \
4 data \5 data \
5 po6 po
67
7DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall --enable-deprecations8if ENABLE_GTK_DOC
9SUBDIRS += doc
10endif
11
12if BUILD_TESTS
13SUBDIRS += \
14 test
15
16# build src first
17test: src
18
19endif
20
21
22
23
24DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall --enable-deprecations --enable-introspection --enable-gtk-doc
825
9dist-hook:26dist-hook:
10 @if test -d "$(top_srcdir)/.bzr"; \27 @if test -d "$(top_srcdir)/.bzr"; \
@@ -31,3 +48,6 @@
31 else \48 else \
32 echo Failed to generate AUTHORS: not a branch >&2; \49 echo Failed to generate AUTHORS: not a branch >&2; \
33 fi50 fi
51
52
53include $(top_srcdir)/Makefile.am.coverage
3454
=== added file 'Makefile.am.coverage'
--- Makefile.am.coverage 1970-01-01 00:00:00 +0000
+++ Makefile.am.coverage 2013-06-07 21:39:23 +0000
@@ -0,0 +1,48 @@
1
2# Coverage targets
3
4.PHONY: clean-gcno clean-gcda \
5 coverage-html generate-coverage-html clean-coverage-html \
6 coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
7
8clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
9
10if HAVE_GCOV
11
12clean-gcno:
13 @echo Removing old coverage instrumentation
14 -find -name '*.gcno' -print | xargs -r rm
15
16clean-gcda:
17 @echo Removing old coverage results
18 -find -name '*.gcda' -print | xargs -r rm
19
20coverage-html: clean-gcda
21 -$(MAKE) $(AM_MAKEFLAGS) -k check
22 $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
23
24generate-coverage-html:
25 @echo Collecting coverage data
26 $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
27 LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
28
29clean-coverage-html: clean-gcda
30 -$(LCOV) --directory $(top_builddir) -z
31 -rm -rf coverage.info coveragereport
32
33if HAVE_GCOVR
34
35coverage-gcovr: clean-gcda
36 -$(MAKE) $(AM_MAKEFLAGS) -k check
37 $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
38
39generate-coverage-gcovr:
40 @echo Generating coverage GCOVR report
41 $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
42
43clean-coverage-gcovr: clean-gcda
44 -rm -rf $(top_builddir)/coverage.xml
45
46endif # HAVE_GCOVR
47
48endif # HAVE_GCOV
049
=== modified file 'NEWS'
--- NEWS 2008-12-05 03:13:41 +0000
+++ NEWS 2013-06-07 21:39:23 +0000
@@ -0,0 +1,42 @@
1
212.10.5
3
4* fix crash caused by GError not being cleared (lp #1064314)
5* fix crash when registering an app that was previously unregistered (lp #1065169)
6* remove the icon if NULL is passed to source_set_icon (lp #1070421)
7* call gtk-update-icon-cache (lp #1060618)
8
912.10.4
10
11* specify fallback icons for the ones with status emblem (lp #1056595)
12* make icon size consistent with the other indicators (lp #1055966)
13* libmessaging-menu: fix crash when receiving a invalid desktop id (lp #1058386)
14
15
1612.10.3
17
18* hide indicator when no application shows in the menu (lp #661059)
19* remove apps as soon as they are uninstalled (lp #864545)
20* make generated .gir compatible with vala (lp #104496)
21* draw counts as lozenges (lp #1046331)
22* show separators (lp #1048245)
23* show chat presence in the panel (lp #859905)
24* improve documentation
25
26
2712.10.2
28
29* libmessaging-menu:
30 - expand source documentation and add gtk-doc to the build system
31 - added new API: messaging_menu_app_set_source_{label,icon}
32 - fix bug: only one MessagingMenuApp was exported to the messaging menu
33
34
3512.10.1
36
37* presence icons are shown again
38* the icon is changed when a source draws attention
39* the time in source menu items is always kep current
40* fixed all g-ir-scanner warnings
41* libmessaging-menu now removes sources when they are activated
42* fixed several bugs
043
=== modified file 'autogen.sh'
--- autogen.sh 2009-04-05 11:03:12 +0000
+++ autogen.sh 2013-06-07 21:39:23 +0000
@@ -1,11 +1,5 @@
1#!/bin/sh1#!/bin/sh -e
22
3PKG_NAME="indicator-messages"3gtkdocize
44autoreconf -i -f
5which gnome-autogen.sh || {5intltoolize
6 echo "You need gnome-common from GNOME SVN"
7 exit 1
8}
9
10USE_GNOME2_MACROS=1 \
11. gnome-autogen.sh
126
=== modified file 'configure.ac'
--- configure.ac 2011-09-28 15:33:24 +0000
+++ configure.ac 2013-06-07 21:39:23 +0000
@@ -1,10 +1,10 @@
11
2AC_INIT(src/indicator-messages.c)2AC_INIT(indicator-messages, 12.10.5)
33
4AC_PREREQ(2.53)4AC_PREREQ(2.62)
55
6AM_CONFIG_HEADER(config.h)6AM_CONFIG_HEADER(config.h)
7AM_INIT_AUTOMAKE(indicator-messages, 0.5.0)7AM_INIT_AUTOMAKE([check-news])
88
9AM_MAINTAINER_MODE9AM_MAINTAINER_MODE
1010
@@ -31,64 +31,73 @@
31 [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"]31 [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"]
32)32)
3333
34# the Google Test targets are cpp
35AC_PROG_CXX
36
34###########################37###########################
35# Dependencies 38# Dependencies
36###########################39###########################
3740
38GTK_REQUIRED_VERSION=2.1241GTK_REQUIRED_VERSION=3.5.18
39GTK3_REQUIRED_VERSION=3.042GIO_UNIX_REQUIRED_VERSION=2.33.10
40GIO_UNIX_REQUIRED_VERSION=2.18
41PANEL_REQUIRED_VERSION=2.0.0
42INDICATE_REQUIRED_VERSION=0.4.90
43INDICATOR_REQUIRED_VERSION=0.3.1943INDICATOR_REQUIRED_VERSION=0.3.19
44DBUSMENUGTK_REQUIRED_VERSION=0.3.9444GLIB_REQUIRED_VERSION=2.35.4
4545INTROSPECTION_REQUIRED_VERSION=1.32.0
46AC_ARG_WITH([gtk],46
47 [AS_HELP_STRING([--with-gtk],47PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK_REQUIRED_VERSION
48 [Which version of gtk to use for the indicator @<:@default=3@:>@])],48 gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
49 [],49 indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
50 [with_gtk=3])50 glib-2.0 >= $GLIB_REQUIRED_VERSION
5151 gmodule-2.0 >= $GLIB_REQUIRED_VERSION)
52AS_IF([test "x$with_gtk" = x3],52
53 [PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK3_REQUIRED_VERSION53PKG_CHECK_MODULES(GIO, gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION)
54 gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION54
55 indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
56 indicate-0.6 >= $INDICATE_REQUIRED_VERSION
57 dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
58 ],
59 [test "x$with_gtk" = x2],
60 [PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
61 gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
62 indicator-0.4 >= $INDICATOR_REQUIRED_VERSION
63 indicate-0.6 >= $INDICATE_REQUIRED_VERSION
64 dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
65 ],
66 [AC_MSG_FAILURE([Value for --with-indicator-gtk was neither 2 nor 3])]
67)
68AC_SUBST(APPLET_CFLAGS)55AC_SUBST(APPLET_CFLAGS)
69AC_SUBST(APPLET_LIBS)56AC_SUBST(APPLET_LIBS)
7057
71###########################58GLIB_GSETTINGS
72# Status Provider Deps59
73###########################60GTK_DOC_CHECK([1.18], [--flavour no-tmpl])
7461
75PKG_CHECK_MODULES(STATUS_PROVIDER_PIDGIN, dbus-glib-1)62GOBJECT_INTROSPECTION_CHECK([$INTROSPECTION_REQUIRED_VERSION])
76AC_SUBST(STATUS_PROVIDER_PIDGIN_CFLAGS)63
77AC_SUBST(STATUS_PROVIDER_PIDGIN_LIBS)64###########################
7865# gcov coverage reporting
79PKG_CHECK_MODULES(STATUS_PROVIDER_TELEPATHY, dbus-glib-1)66###########################
80AC_SUBST(STATUS_PROVIDER_TELEPATHY_CFLAGS)67
81AC_SUBST(STATUS_PROVIDER_TELEPATHY_LIBS)68m4_include([m4/gcov.m4])
8269AC_TDD_GCOV
83TELEPATHYGLIB_REQUIRED_VERSION=0.9.070AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
84PKG_CHECK_MODULES(STATUS_PROVIDER_MC5, dbus-glib-171AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
85 telepathy-glib >= $TELEPATHYGLIB_REQUIRED_VERSION)72AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
86AC_SUBST(STATUS_PROVIDER_MC5_CFLAGS)73AC_SUBST(COVERAGE_CFLAGS)
87AC_SUBST(STATUS_PROVIDER_MC5_LIBS)74AC_SUBST(COVERAGE_CXXFLAGS)
8875AC_SUBST(COVERAGE_LDFLAGS)
89PKG_CHECK_MODULES(STATUS_PROVIDER_EMESENE, dbus-glib-1)76
90AC_SUBST(STATUS_PROVIDER_EMESENE_CFLAGS)77###########################
91AC_SUBST(STATUS_PROVIDER_EMESENE_LIBS)78# Tests
79###########################
80
81AC_ARG_ENABLE([tests],
82 [AS_HELP_STRING([--disable-tests], [Disable test scripts and tools (default=auto)])],
83 [enable_tests=${enableval}],
84 [enable_tests=auto])
85if test "x$enable_tests" != "xno"; then
86 m4_include([m4/gtest.m4])
87 CHECK_GTEST
88 AM_PATH_PYTHON(3.0,, [:])
89 AC_PYTHON_MODULE(dbusmock)
90 if test "x$have_gtest" = "xyes" -a "x$HAVE_PYMOD_DBUSMOCK" = "xyes"; then
91 enable_tests="yes"
92 else
93 if test "x$enable_tests" = "xyes"; then
94 AC_MSG_ERROR([tests were requested but gtest or dbusmock are not installed.])
95 else
96 enable_tests="no"
97 fi
98 fi
99fi
100AM_CONDITIONAL([BUILD_TESTS],[test "x$enable_tests" = "xyes"])
92101
93###########################102###########################
94# Check to see if we're local103# Check to see if we're local
@@ -103,16 +112,10 @@
103112
104if test "x$with_localinstall" = "xyes"; then113if test "x$with_localinstall" = "xyes"; then
105 INDICATORDIR="${libdir}/indicators/2/"114 INDICATORDIR="${libdir}/indicators/2/"
106 INDICATORICONSDIR="${datadir}/libindicate/icons/"
107elif test "x$with_gtk" = x2; then
108 INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4`
109 INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4`
110else115else
111 INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`116 INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`
112 INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3-0.4`
113fi117fi
114AC_SUBST(INDICATORDIR)118AC_SUBST(INDICATORDIR)
115AC_SUBST(INDICATORICONSDIR)
116119
117###########################120###########################
118# DBus Service Info121# DBus Service Info
@@ -159,7 +162,6 @@
159AC_OUTPUT([162AC_OUTPUT([
160Makefile163Makefile
161src/Makefile164src/Makefile
162src/indicator-messages-status-provider-0.5.pc.in
163data/Makefile165data/Makefile
164data/icons/Makefile166data/icons/Makefile
165data/icons/16x16/Makefile167data/icons/16x16/Makefile
@@ -179,6 +181,12 @@
179data/icons/scalable/status/Makefile181data/icons/scalable/status/Makefile
180data/icons/scalable/categories/Makefile182data/icons/scalable/categories/Makefile
181po/Makefile.in183po/Makefile.in
184test/Makefile
185libmessaging-menu/Makefile
186libmessaging-menu/messaging-menu.pc
187doc/Makefile
188doc/reference/Makefile
189doc/reference/messaging-menu-docs.xml
182])190])
183191
184###########################192###########################
@@ -191,4 +199,8 @@
191199
192 Prefix: $prefix200 Prefix: $prefix
193 Indicator Dir: $INDICATORDIR201 Indicator Dir: $INDICATORDIR
202 tests: $enable_tests
203 gcov: $use_gcov
204 introspecion: $enable_introspection
205 documentation: $enable_gtk_doc
194])206])
195207
=== modified file 'data/Makefile.am'
--- data/Makefile.am 2009-09-09 18:58:33 +0000
+++ data/Makefile.am 2013-06-07 21:39:23 +0000
@@ -6,6 +6,11 @@
6%.service: %.service.in6%.service: %.service.in
7 sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@7 sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
88
9EXTRA_DIST = indicator-messages.service.in9gsettings_SCHEMAS = com.canonical.indicator.messages.gschema.xml
10@GSETTINGS_RULES@
11
12EXTRA_DIST = \
13 $(gsettings_SCHEMAS) \
14 indicator-messages.service.in
1015
11CLEANFILES = indicator-messages.service16CLEANFILES = indicator-messages.service
1217
=== added file 'data/com.canonical.indicator.messages.gschema.xml'
--- data/com.canonical.indicator.messages.gschema.xml 1970-01-01 00:00:00 +0000
+++ data/com.canonical.indicator.messages.gschema.xml 2013-06-07 21:39:23 +0000
@@ -0,0 +1,12 @@
1<schemalist>
2 <schema id="com.canonical.indicator.messages" path="/com/canonical/indicator/messages/" gettext-domain="indicator-messages">
3 <key name="applications" type="as">
4 <summary>List of applications that are shown in the messaging menu</summary>
5 <description>
6 Applications corresponding to the desktop file ids in this list are shown in the messaging menu.
7 </description>
8 <default>[]</default>
9 </key>
10 </schema>
11</schemalist>
12
013
=== modified file 'data/icons/16x16/categories/Makefile.am'
--- data/icons/16x16/categories/Makefile.am 2010-03-04 20:23:07 +0000
+++ data/icons/16x16/categories/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/categories2iconsdir = $(datadir)/icons/hicolor/16x16/categories
33
4icons_DATA = \4icons_DATA = \
5 applications-email-panel.png \5 applications-email-panel.png \
66
=== modified file 'data/icons/16x16/status/Makefile.am'
--- data/icons/16x16/status/Makefile.am 2010-02-18 04:59:43 +0000
+++ data/icons/16x16/status/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/status2iconsdir = $(datadir)/icons/hicolor/16x16/status
33
4icons_DATA = \4icons_DATA = \
5 application-running.png \5 application-running.png \
66
=== modified file 'data/icons/22x22/categories/Makefile.am'
--- data/icons/22x22/categories/Makefile.am 2010-03-04 20:23:07 +0000
+++ data/icons/22x22/categories/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/categories2iconsdir = $(datadir)/icons/hicolor/22x22/categories
33
4icons_DATA = \4icons_DATA = \
5 applications-email-panel.png5 applications-email-panel.png
66
=== modified file 'data/icons/22x22/status/Makefile.am'
--- data/icons/22x22/status/Makefile.am 2009-09-25 01:28:38 +0000
+++ data/icons/22x22/status/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/status2iconsdir = $(datadir)/icons/hicolor/22x22/status
33
4icons_DATA = \4icons_DATA = \
5 indicator-messages.png \5 indicator-messages.png \
66
=== modified file 'data/icons/24x24/status/Makefile.am'
--- data/icons/24x24/status/Makefile.am 2010-02-18 04:59:43 +0000
+++ data/icons/24x24/status/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/24x24/status2iconsdir = $(datadir)/icons/hicolor/24x24/status
33
4icons_DATA = \4icons_DATA = \
5 application-running.png \5 application-running.png \
66
=== modified file 'data/icons/32x32/categories/Makefile.am'
--- data/icons/32x32/categories/Makefile.am 2010-03-04 20:23:07 +0000
+++ data/icons/32x32/categories/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/categories2iconsdir = $(datadir)/icons/hicolor/32x32/categories
33
4icons_DATA = \4icons_DATA = \
5 applications-email-panel.png \5 applications-email-panel.png \
66
=== modified file 'data/icons/32x32/status/Makefile.am'
--- data/icons/32x32/status/Makefile.am 2010-02-18 04:59:43 +0000
+++ data/icons/32x32/status/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/status2iconsdir = $(datadir)/icons/hicolor/32x32/status
33
4icons_DATA = \4icons_DATA = \
5 application-running.png \5 application-running.png \
66
=== modified file 'data/icons/48x48/status/Makefile.am'
--- data/icons/48x48/status/Makefile.am 2010-02-18 04:59:43 +0000
+++ data/icons/48x48/status/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/48x48/status2iconsdir = $(datadir)/icons/hicolor/48x48/status
33
4icons_DATA = \4icons_DATA = \
5 application-running.png \5 application-running.png \
66
=== modified file 'data/icons/Makefile.am'
--- data/icons/Makefile.am 2009-02-04 16:01:51 +0000
+++ data/icons/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,6 +1,6 @@
1SUBDIRS = scalable 16x16 22x22 24x24 32x32 48x481SUBDIRS = scalable 16x16 22x22 24x24 32x32 48x48
22
3gtk_update_icon_cache = gtk-update-icon-cache -f -t $(pkgdatadir)/icons/hicolor3gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
44
5install-data-hook: update-icon-cache5install-data-hook: update-icon-cache
6uninstall-hook: update-icon-cache6uninstall-hook: update-icon-cache
77
=== modified file 'data/icons/scalable/categories/Makefile.am'
--- data/icons/scalable/categories/Makefile.am 2010-03-04 20:23:07 +0000
+++ data/icons/scalable/categories/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/categories2iconsdir = $(datadir)/icons/hicolor/scalable/categories
33
4icons_DATA = \4icons_DATA = \
5 applications-email-panel.svg \5 applications-email-panel.svg \
66
=== modified file 'data/icons/scalable/status/Makefile.am'
--- data/icons/scalable/status/Makefile.am 2010-02-18 04:59:43 +0000
+++ data/icons/scalable/status/Makefile.am 2013-06-07 21:39:23 +0000
@@ -1,5 +1,5 @@
11
2iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/status2iconsdir = $(datadir)/icons/hicolor/scalable/status
33
4icons_DATA = \4icons_DATA = \
5 application-running.svg \5 application-running.svg \
66
=== added directory 'debian'
=== added file 'debian/changelog'
--- debian/changelog 1970-01-01 00:00:00 +0000
+++ debian/changelog 2013-06-07 21:39:23 +0000
@@ -0,0 +1,856 @@
1indicator-messages (12.10.6daily13.01.25-0ubuntu1) raring; urgency=low
2
3 [ Charles Kerr ]
4 * indicators call deprecated glib function g_type_init() (LP:
5 #1103087)
6
7 [ Automatic PS uploader ]
8 * Automatic snapshot from revision 335
9
10 -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Fri, 25 Jan 2013 02:01:11 +0000
11
12indicator-messages (12.10.6daily12.11.22-0ubuntu1) raring; urgency=low
13
14 [ Lars Uebernickel ]
15 * Crash in g_variant_valist_get_leaf when highlighted (LP: #1081754)
16
17 [ Automatic PS uploader ]
18 * Automatic snapshot from revision 333
19
20 -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Thu, 22 Nov 2012 10:02:35 +0000
21
22indicator-messages (12.10.6daily12.11.21.1-0ubuntu1) raring; urgency=low
23
24 [ Mathieu Trudel-Lapierre ]
25 * debian/rules:
26 - Use autogen.sh for dh_autoreconf.
27 - Drop the override for dh_makeshlibs.
28 - Add DPKG_GENSYMBOLS_CHECK_LEVEL=4.
29 * debian/control:
30 - Fix styling: add trailing commas at the end of lists.
31 - Update Vcs-Bzr, Vcs-Browser fields and add a notice for developers.
32 - Add libgtest-dev to Build-Depends.
33 * Automatic snapshot from revision 329 (bootstrap):
34 - Clear the detail (count or time) of a source when another type of detail
35 is set. (LP: #1071640)
36
37 [ Automatic PS uploader ]
38 * Automatic snapshot from revision 331
39
40 -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Wed, 21 Nov 2012 10:41:37 +0000
41
42indicator-messages (12.10.5-0ubuntu2) raring; urgency=low
43
44 * Upload to raring
45
46 -- Sebastien Bacher <seb128@ubuntu.com> Wed, 07 Nov 2012 15:16:08 +0100
47
48indicator-messages (12.10.5-0ubuntu1) quantal-proposed; urgency=low
49
50 * New upstream release:
51 - fix crash caused by GError not being cleared (lp #1064314)
52 - fix crash when registering an app that was previously unregistered
53 (lp #1065169)
54 - remove the icon if NULL is passed to source_set_icon (lp #1070421)
55
56 -- Sebastien Bacher <seb128@ubuntu.com> Wed, 24 Oct 2012 17:30:45 +0200
57
58indicator-messages (12.10.4-0ubuntu1) quantal; urgency=low
59
60 * New upstream release:
61 - don't segfault if .desktop file is not installed (lp: #1058386)
62 - Use fallback icon names (without status emblems).
63 (lp: #1056595)
64
65 -- Sebastien Bacher <seb128@ubuntu.com> Tue, 02 Oct 2012 23:20:19 +0200
66
67indicator-messages (12.10.2-0ubuntu1) quantal; urgency=low
68
69 * New upstream release, includes apis to allow changing the label and
70 the icon of sources and add documentation
71 * debian/libmessaging-menu0.symbols:
72 - new version update
73 * debian/libmessaging-menu-dev.install:
74 - install the documentation
75 * debian/rules:
76 - build the documentation
77 - updated shlibs version
78 - use --with gir so gir:Depends work as it should
79 (lp: #1044125)
80
81 -- Sebastien Bacher <seb128@ubuntu.com> Sat, 01 Sep 2012 12:36:35 +0200
82
83indicator-messages (12.10.1-0ubuntu1) quantal-proposed; urgency=low
84
85 * New upstream version
86 * debian/control:
87 - breaks on version of ported clients using libindicate
88 - set some conflicts on the old deprecated status provider binaries
89 - updated Build-Depends
90 * debian/control, debian/*.install:
91 - drop indicator-status-provider-*, those are deprecated
92 - new binaries for the libmessaging-menu library
93 * debian/libmessaging-menu0.symbols:
94 - symbol file for the new library
95 * Updated packaging to dh9, current standards
96 * Drop gtk2 build from the packaging since support for it was
97 dropped in trunk, thanks Lars Uebernickel
98
99 -- Sebastien Bacher <seb128@ubuntu.com> Mon, 27 Aug 2012 18:56:59 +0200
100
101indicator-messages (0.6.0-0ubuntu1) precise; urgency=low
102
103 * New upstream release.
104 * Handle blank icons properly (LP: #956147)
105 * Fix telepathy offline/disconnected state bug
106
107 -- Charles Kerr <charles.kerr@canonical.com> Wed, 11 Apr 2012 11:09:46 -0500
108
109indicator-messages (0.5.95-0ubuntu1) precise; urgency=low
110
111 [ Charles Kerr ]
112 * New upstream release.
113 * Fix 0.5.94 blacklist regression.
114
115 [ Ken VanDine ]
116 * src/indicator-messages.c
117 * revert fix for the broken images in indicator-messages-service, it
118 caused the service to build against gtk and we can't parallel install
119 the service anyway
120
121 -- Ken VanDine <ken.vandine@canonical.com> Thu, 05 Apr 2012 16:47:19 -0400
122
123indicator-messages (0.5.94-0ubuntu1) precise; urgency=low
124
125 [ Ted Gould ]
126 * New upstream release.
127 * Fix for missing icons in the messaging menu (LP: #960553)
128 * Fix i18n for description (LP: #957525)
129 * Implementing initial testing
130 * Fixing blacklists (LP: #939258)
131 * debian/control: Adding dep on libgtest-dev
132
133 [ Ken VanDine ]
134 * debian/control: Don't build depend on libgtest-dev, it isn't in main
135 * debian/rules: disable tests, they require libgtest-dev
136
137 -- Ken VanDine <ken.vandine@canonical.com> Wed, 21 Mar 2012 17:00:10 -0400
138
139indicator-messages (0.5.93-0ubuntu2) precise; urgency=low
140
141 * src/im-menu-item.c
142 - cherry picked fix for missing icons in the messaging menu (LP: #960553)
143
144 -- Ken VanDine <ken.vandine@canonical.com> Tue, 20 Mar 2012 16:41:13 -0400
145
146indicator-messages (0.5.93-0ubuntu1) precise; urgency=low
147
148 * debian/control:
149 - drop build-depends on gnome-doc-utils and scrollkeeper, not required
150
151 [ Ted Gould ]
152 * New upstream release.
153 * Fixing alignment of menu items (LP: #939953)
154 * Vertically centering alignment of double high items (LP: #770486)
155 * Fixing setting of status on telepathy (LP: #943757)
156
157 -- Sebastien Bacher <seb128@ubuntu.com> Thu, 08 Mar 2012 22:11:24 +0100
158
159indicator-messages (0.5.92-0ubuntu1) precise; urgency=low
160
161 [ Ted Gould ]
162 * New upstream release.
163 * Fix goto handling (by removing) (LP: #937441, LP: #937438)
164 * Tell accountsservice when user has messages for the benefit of
165 LightDM.
166 * Dropping debian/patches: Merged upstream
167
168 [ Ken VanDine ]
169 * debian/source/format
170 - dropped "3.0 (quilt), it doesn't play well with bzr maintained packages
171
172 -- Ken VanDine <ken.vandine@canonical.com> Thu, 23 Feb 2012 02:48:09 -0500
173
174indicator-messages (0.5.91-0ubuntu3) precise; urgency=low
175
176 * debian/source/format:
177 - Make "3.0 (quilt)"
178 * debian/patches/tell-accounts-service.patch:
179 - Tell accountsservice when user has messages for the benefit of
180 LightDM.
181
182 -- Michael Terry <mterry@ubuntu.com> Wed, 15 Feb 2012 15:32:16 -0500
183
184indicator-messages (0.5.91-0ubuntu2) precise; urgency=low
185
186 * debian/control: build-depends on dh-autoreconf as well
187
188 -- Sebastien Bacher <seb128@ubuntu.com> Tue, 14 Feb 2012 23:50:15 +0100
189
190indicator-messages (0.5.91-0ubuntu1) precise; urgency=low
191
192 * New upstream release.
193 * Better lozenges that look nice
194 * debian/rules: Adding autoreconf and running make check
195 * debian/compat: 5
196 * debian/source/format: Dropping
197
198 -- Ted Gould <ted@ubuntu.com> Tue, 14 Feb 2012 15:29:52 -0600
199
200indicator-messages (0.5.90-0ubuntu1) precise; urgency=low
201
202 [ Ted Gould ]
203 * New upstream release.
204 * Adding code coverage targets
205 * Match libindicate 0.6.90
206 * Updating for Dbusmenu 0.5.90
207 * Plug leak in launcher_menu_item_new
208 * Fix memory leak: Free path string.
209 * Compare server and path for multi-server clients
210 * Using the new GTK3 box API to avoid deprecations
211 * Adding a name hint
212 * debian/control: Requiring libindicate 0.6.90 and dbusmenu 0.5.90
213
214 [ Ken VanDine ]
215 * debian/rules
216 - drop no-error=deprecated-declarations from CFLAGS
217
218 -- Ken VanDine <ken.vandine@canonical.com> Fri, 10 Feb 2012 14:29:59 -0500
219
220indicator-messages (0.5.0-1ubuntu1) precise; urgency=low
221
222 * rebuild for libindicator7
223 * debian/rules
224 - build with no-error=deprecated-declarations
225 * debian/control
226 - set ubuntu-desktop VCS and maintainer
227
228 -- Ken VanDine <ken.vandine@canonical.com> Wed, 25 Jan 2012 09:56:59 -0500
229
230indicator-messages (0.5.0-1) experimental; urgency=low
231
232 * Merge new upstream from Ubuntu.
233
234 -- Evgeni Golov <evgeni@debian.org> Wed, 19 Oct 2011 13:36:00 +0200
235
236indicator-messages (0.5.0-0ubuntu1) oneiric; urgency=low
237
238 * New upstream release.
239 * Fix memory leak (LP: #690668)
240 * Drop debian/patches/lp_690668.patch: Merged upstream
241
242 -- Ted Gould <ted@ubuntu.com> Wed, 28 Sep 2011 10:39:26 -0500
243
244indicator-messages (0.4.95-0ubuntu1) oneiric; urgency=low
245
246 * New upstream release.
247 * Fix naming of "Clear" item
248 * Fix alignment of items to there is a consistent gutter
249 * debian/patches/lp_690668.patch: Updating
250
251 -- Ted Gould <ted@ubuntu.com> Thu, 25 Aug 2011 09:09:20 -0500
252
253indicator-messages (0.4.94-0ubuntu1) oneiric; urgency=low
254
255 * New upstream release.
256 ∘ Fix drawing of triangles and capsules in GTK3
257 ∘ Fix Emesene statuses (LP: #817504)
258
259 -- Ted Gould <ted@ubuntu.com> Thu, 18 Aug 2011 10:57:40 -0500
260
261indicator-messages (0.4.93-0ubuntu2) oneiric; urgency=low
262
263 * debian/rules
264 - run intltool-update to update the translations template
265
266 -- Ken VanDine <ken.vandine@canonical.com> Fri, 12 Aug 2011 10:05:01 -0400
267
268indicator-messages (0.4.93-0ubuntu1) oneiric; urgency=low
269
270 [ Ted Gould ]
271 * New upstream release.
272 * Add an item to clear the alert
273 * Choose mail applications based on the default application
274 * Clear based on middle click
275
276 [ Ken VanDine ]
277 * debian/control
278 - Bumped build depends for libindicate to >= 0.5.90
279 * debian/rules
280 - Fixed configure arg for gtk version
281
282 -- Ken VanDine <ken.vandine@canonical.com> Thu, 11 Aug 2011 14:18:05 -0400
283
284indicator-messages (0.4.92-0ubuntu4) oneiric; urgency=low
285
286 * debian/control
287 - Dropped recommends for gwibber now that it is seeded
288 * cherry picked r220 from trunk
289 - Make sure to insert in the right locations
290 * cherry picked r221 from trunk
291 - Making mail applications based on the default mail client not a
292 hardcoded desktop file.
293
294 -- Ken VanDine <ken.vandine@canonical.com> Fri, 05 Aug 2011 14:33:39 -0400
295
296indicator-messages (0.4.92-0ubuntu3) oneiric; urgency=low
297
298 * debian/control
299 - Added recommends for gwibber, it got missed when we dropped indicator-me
300 should get removed after we get it seeded properly
301
302 -- Ken VanDine <ken.vandine@canonical.com> Sun, 31 Jul 2011 16:36:09 -0400
303
304indicator-messages (0.4.92-0ubuntu2) oneiric; urgency=low
305
306 * debian/control:
307 - use conflicts against indicator-me
308
309 -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 29 Jul 2011 15:49:40 +0200
310
311indicator-messages (0.4.92-0ubuntu1) oneiric; urgency=low
312
313 * New upstream release.
314 * debian/control
315 - Added Replaces indicator-me
316 - Added build depends for libtelepathy-glib-dev
317 - Added new binary packages, libindicator-messages-status-provider-dev,
318 libindicator-messages-status-provider1, and each provider
319 - Make indicator-messages recommend indicator-status-provider-mc5
320 * debian/libindicator-messages-status-provider1.symbols
321 - Added symbols file
322
323 -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Jul 2011 16:28:23 -0400
324
325indicator-messages (0.4.91-0ubuntu1) oneiric; urgency=low
326
327 [ Ted Gould ]
328 * New upstream release.
329 * Update for libindicator 0.4
330
331 [ Ken VanDine ]
332 * debian/control
333 - Bumped build depends for libindicator to >= 0.3.90
334
335 -- Ken VanDine <ken.vandine@canonical.com> Fri, 08 Jul 2011 11:23:58 -0400
336
337indicator-messages (0.4.90-0ubuntu2) oneiric; urgency=low
338
339 * Rebuild for libdbusmenu-gtk3-4
340 * debian/control
341 - Removed duplicate build depends
342 - Dropped build depends on indicator-messages-gtk2
343
344 -- Ken VanDine <ken.vandine@canonical.com> Tue, 28 Jun 2011 09:01:12 -0400
345
346indicator-messages (0.4.90-0ubuntu1) oneiric; urgency=low
347
348 [ Ted Gould ]
349 * New upstream release.
350 * GTK 3
351
352 [ Ken VanDine ]
353 * debian/control
354 - Bumped standards version to 3.9.2
355 - Add new binary for indicator-messages-gtk2
356 - Make indicator-messages recommend indicator-messages-gtk2 (until unity
357 can load gtk3 indicators)
358 - indicator-messages-gtk2 replaces indicator-messages << 0.4.90
359 - Added build depends for libdbusmenu-gtk3-dev and libindicator3-dev
360 * debian/rules
361 - build for both gtk2 and gtk3
362
363 -- Ken VanDine <ken.vandine@canonical.com> Wed, 22 Jun 2011 12:34:43 -0400
364
365indicator-messages (0.4.0-1) unstable; urgency=low
366
367 * Merge new upstream from Ubuntu.
368 * Standards-Version: 3.9.2
369
370 -- Evgeni Golov <evgeni@debian.org> Sun, 05 Jun 2011 13:16:03 +0200
371
372indicator-messages (0.4.0-0ubuntu1) natty; urgency=low
373
374 * New upstream release.
375 ∘ Set the type before other variables to get default handling more
376 reliable (LP: #723873)
377 ∘ Add support for overriding the default icon with a specific one
378 for the messaging menu (LP: #741068)
379
380 -- Ted Gould <ted@ubuntu.com> Thu, 07 Apr 2011 12:35:36 -0500
381
382indicator-messages (0.3.92-1) unstable; urgency=low
383
384 * Merge new upstream from Ubuntu.
385 * Fix 0.3.11-0ubuntu3 changelog entry (missed a space), so that
386 bzr builddeb won't go crazy (see Debian Bug #620242)
387 * Fix debian/copyright, was refering to libdbusmenu by mistake.
388
389 -- Evgeni Golov <evgeni@debian.org> Sun, 03 Apr 2011 13:37:33 +0200
390
391indicator-messages (0.3.92-0ubuntu3) natty; urgency=low
392
393 * debian/patches/lp_690668.patch
394 - Memory leak fixes (LP: #690668)
395 * debian/control
396 - Bump standards version to 3.9.1
397 * debian/source/format
398 - Use source format 3.0 (quilt)
399
400 -- Ken VanDine <ken.vandine@canonical.com> Thu, 24 Feb 2011 12:13:33 -0500
401
402indicator-messages (0.3.92-0ubuntu2) natty; urgency=low
403
404 * src/launcher-menu-item.c
405 - Make sure menu entries are displayed for launchers that aren't running (LP: #723873)
406
407 -- Ken VanDine <ken.vandine@canonical.com> Wed, 23 Feb 2011 16:06:37 -0500
408
409indicator-messages (0.3.92-0ubuntu1) natty; urgency=low
410
411 * New upstream release.
412 * Adding in accessible description support
413 * debian/control: libindicator version 0.3.19
414
415 -- Ted Gould <ted@ubuntu.com> Thu, 17 Feb 2011 12:18:32 -0600
416
417indicator-messages (0.3.91-0ubuntu1) natty; urgency=low
418
419 * New upstream release.
420 * Fixing the service file
421 * Adding a log domain
422 * Fixing type handler for dbusmenu 0.3.94
423 * debian/control: dbusmenu to 0.3.94
424
425 -- Ted Gould <ted@ubuntu.com> Thu, 27 Jan 2011 17:01:34 -0600
426
427indicator-messages (0.3.90-0ubuntu1) natty; urgency=low
428
429 [ Ted Gould ]
430 * New upstream release.
431 * GDBus Port
432 * New libindicate and dbusmenu
433
434 [ Ken VanDine ]
435 * debian/control
436 - Build depends on libindicate-dev to 0.4.91
437 - Build depends on dbusmenu to 0.3.91
438 - Set Vcs to ~ubuntu-desktop
439 * data/indicator-messages.service.in
440 - Fixed dbus interface name
441
442 -- Ken VanDine <ken.vandine@canonical.com> Fri, 14 Jan 2011 14:50:30 -0600
443
444indicator-messages (0.3.11-0ubuntu4) natty; urgency=low
445
446 * debian/control
447 - Bump build depends for libdbusmenu-* to >= 0.3.90
448
449 -- Ken VanDine <ken.vandine@canonical.com> Thu, 09 Dec 2010 11:39:40 -0500
450
451indicator-messages (0.3.11-0ubuntu3) UNRELEASED; urgency=low
452
453 * debian/control: package description spelling (LP: #658096)
454
455 -- Greg Auger <gregory.auger@googlemail.com> Tue, 09 Nov 2010 18:49:38 +0000
456
457indicator-messages (0.3.11-0ubuntu2) maverick; urgency=low
458
459 * Rebuild for libindicator ABI change (LP: #637692)
460 * debian/control: depends on latest libindicator-dev
461
462 -- Didier Roche <didrocks@ubuntu.com> Wed, 22 Sep 2010 18:39:27 +0200
463
464indicator-messages (0.3.11-0ubuntu1) maverick; urgency=low
465
466 * New upstream release.
467 * Fixing triangles by passing data to callback (LP: #623453)
468
469 -- Ted Gould <ted@ubuntu.com> Thu, 09 Sep 2010 13:24:13 -0500
470
471indicator-messages (0.3.10-0ubuntu1) maverick; urgency=low
472
473 * New upstream release.
474 * Shifting icons into the gutter and adjusting the arrow
475 padding.
476
477 -- Ted Gould <ted@ubuntu.com> Thu, 26 Aug 2010 15:08:31 -0500
478
479indicator-messages (0.3.9-0ubuntu1) maverick; urgency=low
480
481 * New upstream release.
482 * Remove parens from counts
483
484 -- Ted Gould <ted@ubuntu.com> Thu, 12 Aug 2010 13:10:10 -0500
485
486indicator-messages (0.3.8-0ubuntu1) maverick; urgency=low
487
488 * New upstream release.
489 - running apps triangle indicator overlay
490 - message counters are now rendered with a nice rounded background
491
492 -- Ken VanDine <ken.vandine@canonical.com> Thu, 29 Jul 2010 13:33:14 -0400
493
494indicator-messages (0.3.7-1) unstable; urgency=low
495
496 * Merge from Ubuntu.
497 Closes: #586132
498 * debian/control:
499 - Homepage is at LP/indicator-messages, not -applet.
500 - Update package description.
501 - Update Vcs-* fields.
502 - Standards-Version: 3.8.4.
503 * debian/copyright:
504 - Convert to DEP5 format.
505 - Add missing copyright holders of debian/.
506
507 -- Evgeni Golov <evgeni@debian.org> Thu, 17 Jun 2010 13:02:37 +0200
508
509indicator-messages (0.3.7-0ubuntu1~ppa1) lucid; urgency=low
510
511 * New upstream release.
512 * When loading desktop files check to see if they've
513 already been eclipsed by an app. (LP: #549096)
514 * Track better application shortcuts and ensure that they
515 get removed when the application is. (LP: #539167)
516 * Track blacklisted apps to ensure that the messaging menu
517 hides when there is no app. (LP: #533021)
518
519 -- Ted Gould <ted@ubuntu.com> Fri, 21 May 2010 15:02:16 -0500
520
521indicator-messages (0.3.6-0ubuntu2) lucid; urgency=low
522
523 * Upstream Merge
524 * When loading desktop files check to see if they've
525 already been eclipsed by an app. (LP: #549096)
526 * Track better application shortcuts and ensure that they
527 get removed when the application is. (LP: #539167)
528
529 -- Ted Gould <ted@ubuntu.com> Sat, 17 Apr 2010 13:10:42 -0500
530
531indicator-messages (0.3.6-0ubuntu1) lucid; urgency=low
532
533 * New upstream release.
534 * Fixing several bugs with regards to visibility and placement
535 if items and separators in the menu. (LP: #446914)
536 * Changing the service management over to using libindicator
537 services and service manager for robustness.
538
539 -- Ted Gould <ted@ubuntu.com> Thu, 01 Apr 2010 10:13:38 -0500
540
541indicator-messages (0.3.5-0ubuntu2) lucid; urgency=low
542
543 * debian/control:
544 - change the indicator-applet depends to a recommends to let other
545 desktops use other options rather than having to trigger GNOME
546
547 -- Sebastien Bacher <seb128@ubuntu.com> Tue, 30 Mar 2010 10:35:59 +0200
548
549indicator-messages (0.3.5-0ubuntu1) lucid; urgency=low
550
551 * Upstream release 0.3.5
552 * Show which applications are running with a small icon
553 next to their entry. (LP: #438526)
554 * Shift command items to line up with application names.
555 (LP: #537312)
556 * Track applications we've seen so that we can show "Set Up"
557 text if we've not seen the app before.
558 * Fix avatar spacing to match other menu items
559 * Use standard libindicator icon handling in panel
560 * Fix translation of non-running applications (LP: #540148)
561 * Handling bools for requesting attention from apps
562 * Changing microblogging to broadcast to match Me Menu (LP: #534952)
563 * debian/control:
564 - Updating requirement to libindicator 0.3.5
565 - Increasing dbusmenu-glib dep to 0.2.8
566
567 -- Ted Gould <ted@ubuntu.com> Thu, 25 Mar 2010 10:53:01 -0500
568
569indicator-messages (0.3.4-0ubuntu1~ppa1) lucid; urgency=low
570
571 * Upstream release 0.3.4
572 * Fix avatar spacing to match other menu items
573 * Use standard libindicator icon handling in panel
574 * Fix translation of non-running applications (LP: #540148)
575 * Handling bools for requesting attention from apps
576 * Changing microblogging to broadcast to match Me Menu (LP: #534952)
577 * debian/control: Updating requirement to libindicator 0.3.5
578
579 -- Ted Gould <ted@ubuntu.com> Thu, 18 Mar 2010 13:45:19 -0500
580
581indicator-messages (0.3.3-0ubuntu2) lucid; urgency=low
582
583 * src/default-applications.c
584 - string change for consistency (LP: #534952)
585
586 -- Ken VanDine <ken.vandine@canonical.com> Fri, 12 Mar 2010 11:44:46 -0500
587
588indicator-messages (0.3.3-0ubuntu1) lucid; urgency=low
589
590 * Upstream release 0.3.3
591 * Changing names of default applications to generic names
592 * Making icons of default applications match panel theme
593
594 -- Ted Gould <ted@ubuntu.com> Thu, 04 Mar 2010 16:02:11 -0600
595
596indicator-messages (0.3.2-0ubuntu1) lucid; urgency=low
597
598 * Upstream release 0.3.2
599 * Removing extra ref
600 * Moving locally defined variable to use the one defined in
601 the function to fix a NULL pointer. (lp: #518547)
602 * Disconnect the count changed signal property
603 * Adding static desktop shortcuts to application items
604 * Adding dynamic application menuitems
605 * Switching application menu items to remove descriptions
606 and add in application icons
607 * debian/control:
608 * libindicator build dependency to 0.3.3
609 * dbusmenu build dependency to 0.2.5
610
611 -- Ted Gould <ted@ubuntu.com> Thu, 18 Feb 2010 12:23:29 -0600
612
613indicator-messages (0.3.1-0ubuntu2) lucid; urgency=low
614
615 * Upstream Merge
616 * Removing extra ref
617 * Moving locally defined variable to use the one defined in
618 the function to fix a NULL pointer. (lp: #518547)
619
620 -- Ted Gould <ted@ubuntu.com> Tue, 09 Feb 2010 09:30:10 -0600
621
622indicator-messages (0.3.1-0ubuntu1) lucid; urgency=low
623
624 * Upstream release 0.3.1
625 * Updates for dbusmenu 0.2.2
626 * Updates for libindicate 0.3.0
627 * debian/control:
628 * dbusmenu* depends to 0.2.2
629 * libindicate* depends to 0.3.0
630
631 -- Ted Gould <ted@ubuntu.com> Thu, 04 Feb 2010 18:23:34 -0800
632
633indicator-messages (0.3.0-0ubuntu1) lucid; urgency=low
634
635 * Upstream release 0.3.0
636 - Disabling static builds.
637 - Porting to libindicator 0.3.0
638 - Adding translator comments from hours and minutes strings.
639 (LP: #456437)
640 - Upgrading to dbusmenu 0.2.0
641 * debian/control: Updating dbusmenu dependency to 0.2.0
642 * debian/control: Increasing libindicator-dev dependency to
643 0.3.0
644
645 -- Ted Gould <ted@ubuntu.com> Fri, 08 Jan 2010 12:05:25 -0600
646
647indicator-messages (0.2.6+r156-0ubuntu2) lucid; urgency=low
648
649 * debian/control
650 - add a Breaks for indicator-applet (<< 0.3.0)
651
652 -- Ken VanDine <ken.vandine@canonical.com> Tue, 15 Dec 2009 11:57:42 -0500
653
654indicator-messages (0.2.6+r156-0ubuntu1) lucid; urgency=low
655
656 * New snapshot for libindicator 0.3.0
657 * debian/control
658 - Build-Depends on libindicator >= 0.3.0
659
660 -- Ken VanDine <ken.vandine@canonical.com> Thu, 10 Dec 2009 14:35:46 -0500
661
662indicator-messages (0.2.6-0ubuntu1) karmic; urgency=low
663
664 * Upstream release 0.2.6 (LP: #446629)
665 * Building the menu after checking the blacklist so that the
666 separators are all correct.
667 * Small fix for a perspective memory leak.
668
669 -- Ted Gould <ted@ubuntu.com> Fri, 09 Oct 2009 08:14:27 +0200
670
671indicator-messages (0.2.5-0ubuntu1) karmic; urgency=low
672
673 * Upstream release 0.2.5 (LP: #440217)
674 * Adding a check on addition of launchers to ensure icon is correctly
675 visible. (LP: #433274)
676 * Making it so that if applications don't set the time on an indicator
677 the time isn't shown in the menu. (LP: #438237)
678 * Putting icons in the right places. (LP: #436460)
679
680 -- Ted Gould <ted@ubuntu.com> Thu, 01 Oct 2009 23:34:28 +0200
681
682indicator-messages (0.2.4-0ubuntu1) karmic; urgency=low
683
684 * Upstream release 0.2.4 (LP: #436093)
685 - Merging in the min menu width feature (LP: #428292)
686 - Merging in icon scaling branch from trunk. Now better icons (LP: #433143)
687 - Merging in updated trunk (LP: #434097 and LP: #435184)
688 - add i18n support
689 - Prevent null entries (LP: #435184)
690 - add a path for indicators in /usr/share (LP: #434097)
691
692 -- Ted Gould <ted@ubuntu.com> Thu, 24 Sep 2009 13:07:46 -0500
693
694indicator-messages (0.2.2-0ubuntu2) karmic; urgency=low
695
696 * src/messages-service.c: initialise the translations
697
698 -- Sebastien Bacher <seb128@ubuntu.com> Tue, 15 Sep 2009 16:41:03 +0200
699
700indicator-messages (0.2.2-0ubuntu1) karmic; urgency=low
701
702 * New release (LP: #427357)
703 * Adds in separators between application groups
704 * Merging in v2-api stuff which will become 0.2.1
705 * debian/control:
706 - Requiring > 0.2.0 of libindicate-*
707 - bump dbusmenu dependencies.
708
709 -- Ted Gould <ted@ubuntu.com> Thu, 10 Sep 2009 09:11:57 -0500
710
711indicator-messages (0.2.0-0ubuntu2) karmic; urgency=low
712
713 * debian/control
714 - Bump build depends on dbusmenu to 0.1.0
715
716 -- Ken VanDine <ken.vandine@canonical.com> Thu, 27 Aug 2009 21:14:46 +0200
717
718indicator-messages (0.2.0-0ubuntu1) karmic; urgency=low
719
720 [ Ted Gould ]
721 * Upstream version 0.2.0
722 * debian/control: Adding dependency information for libdbusmenu
723 to say >= 0.0.2 to match upstream build system.
724 * debian/watch: Changing to use indicator-messages project.
725
726 [ Martin Pitt ]
727 * debian/control: Update Vcs-Bzr: for new branch location.
728
729 -- Ted Gould <ted@ubuntu.com> Thu, 27 Aug 2009 20:46:27 +0200
730
731indicator-messages (0.2.0~bzr124-0ubuntu1) karmic; urgency=low
732
733 * Update to fix build issue
734
735 -- Sebastien Bacher <seb128@ubuntu.com> Fri, 07 Aug 2009 17:12:40 +0100
736
737indicator-messages (0.2.0~bzr121-0ubuntu3) karmic; urgency=low
738
739 * Fix to dereference the application menu items correctly so that
740 the signal handlers are dropped as well. (lp: #410251)
741
742 -- Ted Gould <ted@ubuntu.com> Wed, 05 Aug 2009 19:00:31 +0100
743
744indicator-messages (0.2.0~bzr121-0ubuntu2) karmic; urgency=low
745
746 * Run autogen.sh before upload
747
748 -- Jonathan Riddell <jriddell@ubuntu.com> Wed, 05 Aug 2009 00:42:39 +0100
749
750indicator-messages (0.2.0~bzr121-0ubuntu1) karmic; urgency=low
751
752 [ Ted Gould ]
753 * debian/control: Adding in a build dep on libindicate-gtk-dev
754 * Changes for the changing libindicate stuff.
755 * Merge in the dbusmenu changes from the dbusmenu branch
756 * debian/control: Adding in a build dependency on libdbusmenu-glib and
757 libdbusmenu-gtk to catch up with the merge.
758
759 -- Jonathan Riddell <jriddell@ubuntu.com> Wed, 05 Aug 2009 00:21:50 +0100
760
761indicator-messages (0.2.0~bzr120-0ubuntu1) jaunty; urgency=low
762
763 * Fix to track the timer. (LP: #365187)
764
765 -- Ted Gould <ted@ubuntu.com> Wed, 13 May 2009 09:56:20 -0500
766
767indicator-messages (0.2.0~bzr119-0ubuntu1) jaunty; urgency=low
768
769 * Upstream update
770
771 -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 23:34:21 -0500
772
773indicator-messages (0.2.0~bzr116-0ubuntu3) jaunty; urgency=low
774
775 * debian/rules: Adding a rule to remove the .la/.a clutter
776
777 -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 16:46:59 -0500
778
779indicator-messages (0.2.0~bzr116-0ubuntu2) jaunty; urgency=low
780
781 * debian/control: libindicator-dev to ~bzr301
782
783 -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 15:58:45 -0500
784
785indicator-messages (0.2.0~bzr116-0ubuntu1) jaunty; urgency=low
786
787 * Upstream release
788 * Bug fixes
789 * Update API to new libindicator
790 * debian/control: Adding new dependency on libindicator-dev
791
792 -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 15:45:21 -0500
793
794indicator-messages (0.1.6-0ubuntu1) jaunty; urgency=low
795
796 * New upstream version
797 * Patch from Cody Russell to fix LP: #359018 by correctly implementing
798 the finalize functions.
799
800 -- Ted Gould <ted@ubuntu.com> Tue, 14 Apr 2009 11:32:00 +0200
801
802indicator-messages (0.1.5-0ubuntu1) jaunty; urgency=low
803
804 * New upstream version
805 * Fixes the lifecycle of the various structures tracking the messages
806 and applications. Fixing bugs like (LP: #355616) (LP: #352881)
807 * Fixes the visual appearance by setting the widget name to grab the
808 style settings from the main applet. (LP: #351979)
809 * debian/control: Upgrading dependency on libindicate-dev to 0.1.5 or
810 higher as the new version requires that.
811
812 -- Ted Gould <ted@ubuntu.com> Fri, 03 Apr 2009 16:32:49 -0500
813
814indicator-messages (0.1.4-0ubuntu1) jaunty; urgency=low
815
816 * New upstream version
817 * Adding the display of indicators that are login messages coming from
818 other applications. (LP: #345494)
819 * Making all times displayed for IM messages relative instead of
820 absolute. (LP: #346345)
821 * Cleaning up the server removal code. May fix (LP: #345599), I can't
822 recreate it anymore afterwards.
823
824 -- Ted Gould <ted@ubuntu.com> Mon, 30 Mar 2009 09:40:40 +0200
825
826indicator-messages (0.1.3-0ubuntu1) jaunty; urgency=low
827
828 [ Ted Gould ]
829 * New upstream version.
830 - Now changes the icon based on non-IM indicators so that Evolution
831 works much better. (LP: #342480)
832 - Now the menu items are in a predictable order, alphabetical.
833 - The Messages for a particular client (i.e. Pidgin) are grouped with
834 the client they're associated with.
835 - Adjusting the icon size to match the new one in the Human theme.
836 - Adjusting the build so that all the different libraries are not
837 built in a versioned manner. Now it's just one .so, which is
838 what it should have been originally.
839
840 [ Martin Pitt ]
841 * Add debian/watch.
842 * Add bzr-builddeb configuration.
843 * debian/copyright: Fix download location.
844
845 -- Martin Pitt <martin.pitt@ubuntu.com> Thu, 19 Mar 2009 12:23:17 +0100
846
847indicator-messages (0.1-0ubuntu1) jaunty; urgency=low
848
849 * Initial release, based on DX team's PPA packaging branch.
850 (lp:~indicator-applet-developers/indicator-applet/messages-packaging)
851 * debian/control: Add Homepage:, Vcs-Bzr:, and fix package
852 description.
853 * debian/copyright: Properly describe license.
854
855 -- Martin Pitt <martin.pitt@ubuntu.com> Tue, 17 Feb 2009 11:35:38 +0100
856
0857
=== added file 'debian/compat'
--- debian/compat 1970-01-01 00:00:00 +0000
+++ debian/compat 2013-06-07 21:39:23 +0000
@@ -0,0 +1,1 @@
19
02
=== added file 'debian/control'
--- debian/control 1970-01-01 00:00:00 +0000
+++ debian/control 2013-06-07 21:39:23 +0000
@@ -0,0 +1,86 @@
1Source: indicator-messages
2Section: gnome
3Priority: optional
4Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
5XSBC-Original-Maintainer: The Ayatana Packagers <pkg-ayatana-devel@lists.alioth.debian.org>
6Uploaders: Evgeni Golov <evgeni@debian.org>
7Build-Depends: debhelper (>= 9),
8 dh-autoreconf,
9 dh-translations,
10 libglib2.0-dev (>= 2.35.4),
11 libgtk-3-dev (>= 3.5.12),
12 libdbus-glib-1-dev,
13 intltool,
14 libindicator3-dev,
15 libdbusmenu-glib-dev (>= 0.5.90),
16 libdbusmenu-gtk3-dev (>= 0.5.90),
17 libtelepathy-glib-dev (>= 0.9.0),
18 gobject-introspection (>= 0.9.12-4~),
19 libgirepository1.0-dev (>= 0.9.12),
20 gtk-doc-tools,
21 libgtest-dev,
22 python3-dbusmock,
23Standards-Version: 3.9.3
24Homepage: https://launchpad.net/indicator-messages
25# If you aren't a member of ~indicator-applet-developers but need to upload
26# packaging changes, just go ahead. ~indicator-applet-developers will notice
27# and sync up the code again.
28Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-messages/trunk.13.04
29Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-developers/indicator-messages/trunk.13.04/files
30
31Package: indicator-messages
32Architecture: any
33Depends: ${shlibs:Depends}, ${misc:Depends}
34Recommends: indicator-applet | indicator-renderer
35Replaces: libindicator-messages-status-provider1,
36 libindicator-messages-status-provider-dev,
37 indicator-status-provider-mc5,
38 indicator-status-provider-pidgin,
39 indicator-status-provider-telepathy,
40 indicator-status-provider-emesene,
41Conflicts: libindicator-messages-status-provider1,
42 libindicator-messages-status-provider-dev,
43 indicator-status-provider-mc5,
44 indicator-status-provider-pidgin,
45 indicator-status-provider-telepathy,
46 indicator-status-provider-emesene,
47Breaks: gwibber-services (<< 3.5.4-0ubuntu1~),
48 telepathy-indicator (<< 0.3.0-0ubuntu1~),
49 thunderbird (<< 15.0+build1-0ubuntu1~),
50 xchat-indicator (<< 0.3.11-0ubuntu2~),
51 xchat-gnome-indicator (<< 0.3.11-0ubuntu2~),
52Description: indicator that collects messages that need a response
53 A place on the user's desktop that collects messages that need a response.
54 This menu provides a condensed and collected view of all of those messages
55 for quick access, but without making them annoying in times that you want
56 to ignore them.
57
58Package: libmessaging-menu0
59Architecture: any
60Section: libs
61Depends: ${shlibs:Depends},
62 ${misc:Depends},
63Description: Messaging Menu - shared library
64 This library contains information to build status providers to go into
65 the messaging menu.
66
67Package: libmessaging-menu-dev
68Architecture: any
69Section: libdevel
70Depends: ${shlibs:Depends},
71 ${misc:Depends},
72 libmessaging-menu0 (=${binary:Version}),
73 libglib2.0-dev,
74Description: Messaging Menu - library development files
75 This library contains information to build status providers to go into
76 the messaging menu.
77
78Package: gir1.2-messagingmenu-1.0
79Section: libs
80Architecture: any
81Depends: ${misc:Depends},
82 ${gir:Depends},
83Description: Messaging Menu - gir bindings
84 .
85 This package can be used by other packages using the GIRepository format
86 to generate dynamic bindings.
087
=== added file 'debian/copyright'
--- debian/copyright 1970-01-01 00:00:00 +0000
+++ debian/copyright 2013-06-07 21:39:23 +0000
@@ -0,0 +1,19 @@
1Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
2Name: indicator-messages
3Maintainer: Ted Gould <ted@canonical.com>
4Source: https://launchpad.net/indicator-messages
5
6Files: *
7Copyright: 2009-2010 Ted Gould <ted@canonical.com>, Canonical Ltd.
8License: GPL-3
9
10Files: debian/*
11Copyright: 2009-2010 Evgeni Golov <evgeni@debian.org>
12Copyright: 2009-2010 Ted Gould <ted@canonical.com>, Canonical Ltd.
13Copyright: 2009-2010 Sebastien Bacher <seb128@ubuntu.com>
14Copyright: 2009-2010 Ken VanDine <ken.vandine@canonical.com>
15License: GPL-3
16
17License: GPL-3
18 On Debian systems, the complete text of the GNU General
19 Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
020
=== added file 'debian/gir1.2-messagingmenu-1.0.install'
--- debian/gir1.2-messagingmenu-1.0.install 1970-01-01 00:00:00 +0000
+++ debian/gir1.2-messagingmenu-1.0.install 2013-06-07 21:39:23 +0000
@@ -0,0 +1,1 @@
1usr/lib/girepository-1.0/*.typelib
02
=== added file 'debian/indicator-messages.install'
--- debian/indicator-messages.install 1970-01-01 00:00:00 +0000
+++ debian/indicator-messages.install 2013-06-07 21:39:23 +0000
@@ -0,0 +1,5 @@
1usr/lib/indicators3
2usr/lib/indicator-messages/indicator-messages-service
3usr/share/dbus-1
4usr/share/glib-2.0
5usr/share/icons
06
=== added file 'debian/libmessaging-menu-dev.install'
--- debian/libmessaging-menu-dev.install 1970-01-01 00:00:00 +0000
+++ debian/libmessaging-menu-dev.install 2013-06-07 21:39:23 +0000
@@ -0,0 +1,5 @@
1usr/lib/libmessaging-menu.so
2usr/lib/pkgconfig
3usr/include /usr/
4usr/share/gir-1.0/
5usr/share/gtk-doc
06
=== added file 'debian/libmessaging-menu0.install'
--- debian/libmessaging-menu0.install 1970-01-01 00:00:00 +0000
+++ debian/libmessaging-menu0.install 2013-06-07 21:39:23 +0000
@@ -0,0 +1,1 @@
1usr/lib/libmessaging-menu.so.* /usr/lib/
02
=== added file 'debian/libmessaging-menu0.symbols'
--- debian/libmessaging-menu0.symbols 1970-01-01 00:00:00 +0000
+++ debian/libmessaging-menu0.symbols 2013-06-07 21:39:23 +0000
@@ -0,0 +1,23 @@
1libmessaging-menu.so.0 libmessaging-menu0 #MINVER#
2 messaging_menu_app_append_source@Base 12.10.0
3 messaging_menu_app_append_source_with_count@Base 12.10.0
4 messaging_menu_app_append_source_with_string@Base 12.10.0
5 messaging_menu_app_append_source_with_time@Base 12.10.0
6 messaging_menu_app_draw_attention@Base 12.10.0
7 messaging_menu_app_get_type@Base 12.10.0
8 messaging_menu_app_has_source@Base 12.10.0
9 messaging_menu_app_insert_source@Base 12.10.0
10 messaging_menu_app_insert_source_with_count@Base 12.10.0
11 messaging_menu_app_insert_source_with_string@Base 12.10.0
12 messaging_menu_app_insert_source_with_time@Base 12.10.0
13 messaging_menu_app_new@Base 12.10.0
14 messaging_menu_app_register@Base 12.10.0
15 messaging_menu_app_remove_attention@Base 12.10.0
16 messaging_menu_app_remove_source@Base 12.10.0
17 messaging_menu_app_set_source_count@Base 12.10.0
18 messaging_menu_app_set_source_icon@Base 12.10.2
19 messaging_menu_app_set_source_label@Base 12.10.2
20 messaging_menu_app_set_source_string@Base 12.10.0
21 messaging_menu_app_set_source_time@Base 12.10.0
22 messaging_menu_app_set_status@Base 12.10.0
23 messaging_menu_app_unregister@Base 12.10.0
024
=== added file 'debian/rules'
--- debian/rules 1970-01-01 00:00:00 +0000
+++ debian/rules 2013-06-07 21:39:23 +0000
@@ -0,0 +1,17 @@
1#!/usr/bin/make -f
2
3export DPKG_GENSYMBOLS_CHECK_LEVEL=4
4
5%:
6 dh $@ --with autoreconf,translations,gir
7
8override_dh_autoreconf:
9 NO_CONFIGURE=1 dh_autoreconf ./autogen.sh
10
11override_dh_auto_configure:
12 dh_auto_configure -- --libdir="\$${prefix}/lib" --libexecdir="\$${prefix}/lib/indicator-messages" --enable-gtk-doc
13
14override_dh_install:
15 find debian/tmp/usr/lib -name *.la -delete
16 dh_install --fail-missing
17
018
=== added file 'debian/watch'
--- debian/watch 1970-01-01 00:00:00 +0000
+++ debian/watch 2013-06-07 21:39:23 +0000
@@ -0,0 +1,2 @@
1version=3
2http://launchpad.net/indicator-messages/+download .*/indicator-messages-([0-9.]+)\.tar\.gz
03
=== added directory 'doc'
=== added file 'doc/Makefile.am'
--- doc/Makefile.am 1970-01-01 00:00:00 +0000
+++ doc/Makefile.am 2013-06-07 21:39:23 +0000
@@ -0,0 +1,1 @@
1SUBDIRS = reference
02
=== added directory 'doc/reference'
=== added file 'doc/reference/Makefile.am'
--- doc/reference/Makefile.am 1970-01-01 00:00:00 +0000
+++ doc/reference/Makefile.am 2013-06-07 21:39:23 +0000
@@ -0,0 +1,20 @@
1DOC_MODULE = messaging-menu
2
3DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
4
5DOC_SOURCE_DIR = $(top_srcdir)/libmessaging-menu
6
7MKDB_OPTIONS=--xml-mode --output-format=xml
8
9# Used for dependencies. The docs will be rebuilt if any of these change.
10HFILE_GLOB = $(top_srcdir)/libmessaging-menu/*.h
11CFILE_GLOB = $(top_srcdir)/libmessaging-menu/*.c
12
13IGNORE_HFILES= \
14 indicator-messages-service.h \
15 gtupleaction.h
16
17INCLUDES=-I$(top_srcdir)/libmessaging-menu $(GIO_CFLAGS)
18GTKDOC_LIBS=$(top_builddir)/libmessaging-menu/libmessaging-menu.la
19
20include $(top_srcdir)/gtk-doc.make
021
=== added file 'doc/reference/messaging-menu-docs.xml.in'
--- doc/reference/messaging-menu-docs.xml.in 1970-01-01 00:00:00 +0000
+++ doc/reference/messaging-menu-docs.xml.in 2013-06-07 21:39:23 +0000
@@ -0,0 +1,38 @@
1<?xml version="1.0"?>
2<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
3 'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [
4<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
5<!ENTITY version "@PACKAGE_VERSION@">
6]>
7<book lang="en" id="messaging-menu" xmlns:xi="http://www.w3.org/2003/XInclude">
8<title>Messaging Menu Reference Manual</title>
9 <bookinfo>
10 <title>Messaging Menu Reference Manual</title>
11 <releaseinfo>for libmessaging-menu &version;</releaseinfo>
12
13 <copyright>
14 <year>2012</year>
15 <holder>Canonical Ltd.</holder>
16 </copyright>
17 </bookinfo>
18
19 <chapter>
20 <title>API Reference</title>
21 <xi:include href="xml/messaging-menu.xml"/>
22 </chapter>
23
24 <chapter id="object-tree">
25 <title>Object Hierarchy</title>
26 <xi:include href="xml/tree_index.sgml"/>
27 </chapter>
28 <index id="api-index-full">
29 <title>API Index</title>
30 <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
31 </index>
32 <index id="deprecated-api-index" role="deprecated">
33 <title>Index of deprecated API</title>
34 <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
35 </index>
36
37 <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
38</book>
039
=== added directory 'libmessaging-menu'
=== added file 'libmessaging-menu/Makefile.am'
--- libmessaging-menu/Makefile.am 1970-01-01 00:00:00 +0000
+++ libmessaging-menu/Makefile.am 2013-06-07 21:39:23 +0000
@@ -0,0 +1,66 @@
1
2lib_LTLIBRARIES = libmessaging-menu.la
3
4libmessaging_menu_ladir = $(includedir)/messaging-menu
5
6libmessaging_menu_la_SOURCES = \
7 messaging-menu.c \
8 gtupleaction.c \
9 gtupleaction.h \
10 $(BUILT_SOURCES)
11
12libmessaging_menu_la_HEADERS = \
13 messaging-menu.h
14
15libmessaging_menu_la_LIBADD = $(GIO_LIBS)
16
17libmessaging_menu_la_CFLAGS = \
18 $(GIO_CFLAGS) \
19 -Wall
20
21libmessaging_menu_la_LDFLAGS = -export-symbols-regex "^messaging_menu_.*"
22
23BUILT_SOURCES = \
24 indicator-messages-service.c \
25 indicator-messages-service.h
26
27CLEANFILES = $(BUILT_SOURCES)
28
29indicator-messages-service.c: $(top_srcdir)/src/messages-service.xml
30 $(AM_V_GEN) gdbus-codegen \
31 --interface-prefix com.canonical.indicator.messages. \
32 --generate-c-code indicator-messages-service \
33 --c-namespace IndicatorMessages \
34 $^
35indicator-messages-service.h: indicator-messages-service.c
36
37pkgconfigdir = $(libdir)/pkgconfig
38pkgconfig_DATA = messaging-menu.pc
39
40
41-include $(INTROSPECTION_MAKEFILE)
42
43INTROSPECTION_GIRS =
44INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all
45INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
46
47if HAVE_INTROSPECTION
48
49MessagingMenu-1.0.gir: libmessaging-menu.la
50MessagingMenu_1_0_gir_NAMESPACE = MessagingMenu
51MessagingMenu_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
52MessagingMenu_1_0_gir_CFLAGS = $(INCLUDES) $(GIO_CFLAGS)
53MessagingMenu_1_0_gir_SCANNERFLAGS = --c-include="messaging-menu.h"
54MessagingMenu_1_0_gir_LIBS = libmessaging-menu.la
55MessagingMenu_1_0_gir_FILES = messaging-menu.c messaging-menu.h
56MessagingMenu_1_0_gir_EXPORT_PACKAGES = messaging-menu
57INTROSPECTION_GIRS += MessagingMenu-1.0.gir
58
59girdir = $(datadir)/gir-1.0
60gir_DATA = $(INTROSPECTION_GIRS)
61
62typelibdir = $(libdir)/girepository-1.0
63typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
64
65CLEANFILES +=$(gir_DATA) $(typelib_DATA)
66endif
067
=== added file 'libmessaging-menu/gtupleaction.c'
--- libmessaging-menu/gtupleaction.c 1970-01-01 00:00:00 +0000
+++ libmessaging-menu/gtupleaction.c 2013-06-07 21:39:23 +0000
@@ -0,0 +1,354 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Lars Uebernickel <lars.uebernickel@canonical.com>
18 */
19
20#include "gtupleaction.h"
21
22typedef GObjectClass GTupleActionClass;
23
24struct _GTupleAction
25{
26 GObject parent;
27
28 gchar *name;
29 GVariantType *type;
30 gboolean enabled;
31
32 gsize n_children;
33 GVariant **children;
34};
35
36static void action_interface_init (GActionInterface *iface);
37
38G_DEFINE_TYPE_WITH_CODE (GTupleAction, g_tuple_action, G_TYPE_OBJECT,
39 G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, action_interface_init));
40
41enum
42{
43 PROP_0,
44 PROP_NAME,
45 PROP_PARAMETER_TYPE,
46 PROP_ENABLED,
47 PROP_STATE_TYPE,
48 PROP_STATE,
49 N_PROPERTIES
50};
51
52enum
53{
54 SIGNAL_ACTIVATE,
55 N_SIGNALS
56};
57
58static GParamSpec *properties[N_PROPERTIES];
59static guint signal_ids[N_SIGNALS];
60
61static const gchar *
62g_tuple_action_get_name (GAction *action)
63{
64 GTupleAction *tuple = G_TUPLE_ACTION (action);
65
66 return tuple->name;
67}
68
69static const GVariantType *
70g_tuple_action_get_parameter_type (GAction *action)
71{
72 return NULL;
73}
74
75static const GVariantType *
76g_tuple_action_get_state_type (GAction *action)
77{
78 GTupleAction *tuple = G_TUPLE_ACTION (action);
79
80 return tuple->type;
81}
82
83static GVariant *
84g_tuple_action_get_state_hint (GAction *action)
85{
86 return NULL;
87}
88
89static gboolean
90g_tuple_action_get_enabled (GAction *action)
91{
92 GTupleAction *tuple = G_TUPLE_ACTION (action);
93
94 return tuple->enabled;
95}
96
97static GVariant *
98g_tuple_action_get_state (GAction *action)
99{
100 GTupleAction *tuple = G_TUPLE_ACTION (action);
101 GVariant *result;
102
103 result = g_variant_new_tuple (tuple->children, tuple->n_children);
104 return g_variant_ref_sink (result);
105}
106
107static void
108g_tuple_action_set_state (GTupleAction *tuple,
109 GVariant *state)
110{
111 int i;
112
113 g_return_if_fail (g_variant_type_is_tuple (g_variant_get_type (state)));
114
115 if (tuple->type == NULL)
116 {
117 tuple->type = g_variant_type_copy (g_variant_get_type (state));
118 tuple->n_children = g_variant_n_children (state);
119 tuple->children = g_new0 (GVariant *, tuple->n_children);
120 }
121
122 for (i = 0; i < tuple->n_children; i++)
123 {
124 if (tuple->children[i])
125 g_variant_unref (tuple->children[i]);
126 tuple->children[i] = g_variant_get_child_value (state, i);
127 }
128
129 g_object_notify_by_pspec (G_OBJECT (tuple), properties[PROP_STATE]);
130}
131
132static void
133g_tuple_action_change_state (GAction *action,
134 GVariant *value)
135{
136 GTupleAction *tuple = G_TUPLE_ACTION (action);
137
138 g_return_if_fail (value != NULL);
139 g_return_if_fail (g_variant_is_of_type (value, tuple->type));
140
141 g_variant_ref_sink (value);
142
143 /* TODO add a change-state signal similar to GSimpleAction */
144 g_tuple_action_set_state (tuple, value);
145
146 g_variant_unref (value);
147}
148
149static void
150g_tuple_action_activate (GAction *action,
151 GVariant *parameter)
152{
153 GTupleAction *tuple = G_TUPLE_ACTION (action);
154
155 g_return_if_fail (parameter == NULL);
156
157 if (tuple->enabled)
158 g_signal_emit (tuple, signal_ids[SIGNAL_ACTIVATE], 0, NULL);
159}
160
161static void
162g_tuple_action_get_property (GObject *object,
163 guint prop_id,
164 GValue *value,
165 GParamSpec *pspec)
166{
167 GAction *action = G_ACTION (object);
168
169 switch (prop_id)
170 {
171 case PROP_NAME:
172 g_value_set_string (value, g_tuple_action_get_name (action));
173 break;
174
175 case PROP_PARAMETER_TYPE:
176 g_value_set_boxed (value, g_tuple_action_get_parameter_type (action));
177 break;
178
179 case PROP_ENABLED:
180 g_value_set_boolean (value, g_tuple_action_get_enabled (action));
181 break;
182
183 case PROP_STATE_TYPE:
184 g_value_set_boxed (value, g_tuple_action_get_state_type (action));
185 break;
186
187 case PROP_STATE:
188 g_value_take_variant (value, g_tuple_action_get_state (action));
189 break;
190
191 default:
192 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
193 }
194}
195
196static void
197g_tuple_action_set_property (GObject *object,
198 guint prop_id,
199 const GValue *value,
200 GParamSpec *pspec)
201{
202 GTupleAction *tuple = G_TUPLE_ACTION (object);
203
204 switch (prop_id)
205 {
206 case PROP_NAME:
207 tuple->name = g_value_dup_string (value);
208 g_object_notify_by_pspec (object, properties[PROP_NAME]);
209 break;
210
211 case PROP_ENABLED:
212 tuple->enabled = g_value_get_boolean (value);
213 g_object_notify_by_pspec (object, properties[PROP_ENABLED]);
214 break;
215
216 case PROP_STATE:
217 g_tuple_action_set_state (tuple, g_value_get_variant (value));
218 break;
219
220 default:
221 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
222 }
223}
224
225static void
226g_tuple_action_finalize (GObject *object)
227{
228 GTupleAction *tuple = G_TUPLE_ACTION (object);
229 int i;
230
231 g_free (tuple->name);
232 g_variant_type_free (tuple->type);
233
234 for (i = 0; i < tuple->n_children; i++)
235 g_variant_unref (tuple->children[i]);
236
237 g_free (tuple->children);
238
239 G_OBJECT_CLASS (g_tuple_action_parent_class)->finalize (object);
240}
241
242static void
243action_interface_init (GActionInterface *iface)
244{
245 iface->get_name = g_tuple_action_get_name;
246 iface->get_parameter_type = g_tuple_action_get_parameter_type;
247 iface->get_state_type = g_tuple_action_get_state_type;
248 iface->get_state_hint = g_tuple_action_get_state_hint;
249 iface->get_enabled = g_tuple_action_get_enabled;
250 iface->get_state = g_tuple_action_get_state;
251 iface->change_state = g_tuple_action_change_state;
252 iface->activate = g_tuple_action_activate;
253}
254
255static void
256g_tuple_action_class_init (GTupleActionClass *class)
257{
258 GObjectClass *object_class = G_OBJECT_CLASS (class);
259
260 object_class->get_property = g_tuple_action_get_property;
261 object_class->set_property = g_tuple_action_set_property;
262 object_class->finalize = g_tuple_action_finalize;
263
264 properties[PROP_NAME] = g_param_spec_string ("name",
265 "Name",
266 "The name of the action",
267 NULL,
268 G_PARAM_READWRITE |
269 G_PARAM_CONSTRUCT_ONLY |
270 G_PARAM_STATIC_STRINGS);
271
272 properties[PROP_PARAMETER_TYPE] = g_param_spec_boxed ("parameter-type",
273 "Parameter Type",
274 "The variant type passed to activate",
275 G_TYPE_VARIANT_TYPE,
276 G_PARAM_READABLE |
277 G_PARAM_STATIC_STRINGS);
278
279 properties[PROP_ENABLED] = g_param_spec_boolean ("enabled",
280 "Enabled",
281 "Whether the action can be activated",
282 TRUE,
283 G_PARAM_READWRITE |
284 G_PARAM_STATIC_STRINGS);
285
286 properties[PROP_STATE_TYPE] = g_param_spec_boxed ("state-type",
287 "State Type",
288 "The variant type of the state, must be a tuple",
289 G_TYPE_VARIANT_TYPE,
290 G_PARAM_READABLE |
291 G_PARAM_STATIC_STRINGS);
292
293 properties[PROP_STATE] = g_param_spec_variant ("state",
294 "State",
295 "The state of the action",
296 G_VARIANT_TYPE_TUPLE,
297 NULL,
298 G_PARAM_READWRITE |
299 G_PARAM_STATIC_STRINGS);
300
301 g_object_class_install_properties (object_class, N_PROPERTIES, properties);
302
303 signal_ids[SIGNAL_ACTIVATE] = g_signal_new ("activate",
304 G_TYPE_TUPLE_ACTION,
305 G_SIGNAL_RUN_LAST | G_SIGNAL_MUST_COLLECT,
306 0, NULL, NULL,
307 g_cclosure_marshal_VOID__VARIANT,
308 G_TYPE_NONE, 1,
309 G_TYPE_VARIANT);
310}
311
312static void
313g_tuple_action_init (GTupleAction *action)
314{
315 action->enabled = TRUE;
316}
317
318GTupleAction *
319g_tuple_action_new (const gchar *name,
320 GVariant *initial_state)
321{
322 const GVariantType *type;
323
324 g_return_val_if_fail (name != NULL, NULL);
325 g_return_val_if_fail (initial_state != NULL, NULL);
326
327 type = g_variant_get_type (initial_state);
328 g_return_val_if_fail (g_variant_type_is_tuple (type), NULL);
329
330 return g_object_new (G_TYPE_TUPLE_ACTION,
331 "name", name,
332 "state", initial_state,
333 NULL);
334}
335
336void
337g_tuple_action_set_child (GTupleAction *action,
338 gsize index,
339 GVariant *value)
340{
341 const GVariantType *type;
342
343 g_return_if_fail (G_IS_TUPLE_ACTION (action));
344 g_return_if_fail (index < action->n_children);
345 g_return_if_fail (value != NULL);
346
347 type = g_variant_get_type (value);
348 g_return_if_fail (g_variant_is_of_type (value, type));
349
350 g_variant_unref (action->children[index]);
351 action->children[index] = g_variant_ref_sink (value);
352
353 g_object_notify_by_pspec (G_OBJECT (action), properties[PROP_STATE]);
354}
0355
=== added file 'libmessaging-menu/gtupleaction.h'
--- libmessaging-menu/gtupleaction.h 1970-01-01 00:00:00 +0000
+++ libmessaging-menu/gtupleaction.h 2013-06-07 21:39:23 +0000
@@ -0,0 +1,40 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Lars Uebernickel <lars.uebernickel@canonical.com>
18 */
19
20#ifndef __g_tuple_action_h__
21#define __g_tuple_action_h__
22
23#include <gio/gio.h>
24
25#define G_TYPE_TUPLE_ACTION (g_tuple_action_get_type ())
26#define G_TUPLE_ACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TUPLE_ACTION, GTupleAction))
27#define G_IS_TUPLE_ACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TUPLE_ACTION))
28
29typedef struct _GTupleAction GTupleAction;
30
31GType g_tuple_action_get_type (void) G_GNUC_CONST;
32
33GTupleAction * g_tuple_action_new (const gchar *name,
34 GVariant *initial_state);
35
36void g_tuple_action_set_child (GTupleAction *action,
37 gsize index,
38 GVariant *value);
39
40#endif
041
=== added file 'libmessaging-menu/messaging-menu.c'
--- libmessaging-menu/messaging-menu.c 1970-01-01 00:00:00 +0000
+++ libmessaging-menu/messaging-menu.c 2013-06-07 21:39:23 +0000
@@ -0,0 +1,1199 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Lars Uebernickel <lars.uebernickel@canonical.com>
18 */
19
20#include "messaging-menu.h"
21#include "indicator-messages-service.h"
22
23#include <gio/gdesktopappinfo.h>
24
25/**
26 * SECTION:messaging-menu
27 * @title: MessagingMenuApp
28 * @short_description: An application section in the messaging menu
29 * @include: messaging-menu.h
30 *
31 * A #MessagingMenuApp represents an application section in the
32 * Messaging Menu. An application section is tied to an installed
33 * application through a desktop file id, which must be passed to
34 * messaging_menu_app_new().
35 *
36 * To register the application with the Messaging Menu, call
37 * messaging_menu_app_register(). This signifies that the application
38 * should be present in the menu and be marked as "running".
39 *
40 * The first menu item in an application section represents the
41 * application itself, using the name and icon found in the associated
42 * desktop file. Activating this item starts the application.
43 *
44 * Following the application item, the Messaging Menu inserts all
45 * shortcut actions found in the desktop file. Actions whose
46 * <code>NotShowIn</code> keyword contains "Messaging Menu" or whose
47 * <code>OnlyShowIn</code> keyword does not contain "Messaging Menu"
48 * will not appear (the <ulink
49 * url="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html#extra-actions">
50 * desktop file specification</ulink> contains a detailed explanation of
51 * shortcut actions.) An application cannot add, remove, or change
52 * these shortcut items while it is running.
53 *
54 * Next, an application section contains menu items for message sources.
55 * What exactly constitutes a message source depends on the type of
56 * application: an email client's message sources are folders
57 * containing new messages, while those of a chat program are persons
58 * that have contacted the user.
59 *
60 * A message source is represented in the menu by a label and optionally
61 * also an icon. It can be associated with either a count, a time, or
62 * an arbitrary string, which will appear on the right side of the menu
63 * item.
64 *
65 * When the user activates a source, the source is immediately removed
66 * from the menu and the "activate-source" signal is emitted.
67 *
68 * Applications should always expose all the message sources available.
69 * However, the Messaging Menu might limit the amount of sources it
70 * displays to the user.
71 *
72 * The Messaging Menu offers users a way to set their chat status
73 * (available, away, busy, invisible, or offline) for multiple
74 * applications at once. Applications that appear in the Messaging Menu
75 * can integrate with this by setting the
76 * "X-MessagingMenu-UsesChatSection" key in their desktop file to True.
77 * Use messaging_menu_app_set_status() to signify that the application's
78 * chat status has changed. When the user changes status through the
79 * Messaging Menu, the ::status-changed signal will be emitted.
80 *
81 * If the application stops running without calling
82 * messaging_menu_app_unregister(), it will be marked as "not running".
83 * Its application and shortcut items stay in the menu, but all message
84 * sources are removed. If messaging_menu_app_unregister() is called,
85 * the application section is removed completely.
86 *
87 * More information about the design and recommended usage of the
88 * Messaging Menu is available at <ulink
89 * url="https://wiki.ubuntu.com/MessagingMenu">https://wiki.ubuntu.com/MessagingMenu</ulink>.
90 */
91
92/**
93 * MessagingMenuApp:
94 *
95 * #MessagingMenuApp is an opaque structure.
96 */
97struct _MessagingMenuApp
98{
99 GObject parent_instance;
100
101 GDesktopAppInfo *appinfo;
102 int registered; /* -1 for unknown */
103 MessagingMenuStatus status;
104 gboolean status_set;
105 GSimpleActionGroup *source_actions;
106 GMenu *menu;
107 GDBusConnection *bus;
108
109 IndicatorMessagesService *messages_service;
110 guint watch_id;
111 guint action_export_id;
112 guint menu_export_id;
113
114 GCancellable *cancellable;
115};
116
117G_DEFINE_TYPE (MessagingMenuApp, messaging_menu_app, G_TYPE_OBJECT);
118
119enum {
120 PROP_0,
121 PROP_DESKTOP_ID,
122 N_PROPERTIES
123};
124
125enum {
126 ACTIVATE_SOURCE,
127 STATUS_CHANGED,
128 N_SIGNALS
129};
130
131static GParamSpec *properties[N_PROPERTIES];
132static guint signals[N_SIGNALS];
133
134static const gchar *status_ids[] = { "available", "away", "busy", "invisible", "offline" };
135
136static void global_status_changed (IndicatorMessagesService *service,
137 const gchar *status_str,
138 gpointer user_data);
139
140static gchar *
141messaging_menu_app_get_dbus_object_path (MessagingMenuApp *app)
142{
143 gchar *path;
144
145 if (!app->appinfo)
146 return NULL;
147
148 path = g_strconcat ("/com/canonical/indicator/messages/",
149 g_app_info_get_id (G_APP_INFO (app->appinfo)),
150 NULL);
151
152 g_strcanon (path, "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", '_');
153
154 return path;
155}
156
157static void
158export_menus_and_actions (GObject *source,
159 GAsyncResult *res,
160 gpointer user_data)
161{
162 MessagingMenuApp *app = user_data;
163 GError *error = NULL;
164 gchar *object_path;
165
166 object_path = messaging_menu_app_get_dbus_object_path (app);
167 if (!object_path)
168 return;
169
170 app->bus = g_bus_get_finish (res, &error);
171 if (app->bus == NULL)
172 {
173 g_warning ("unable to connect to session bus: %s", error->message);
174 g_error_free (error);
175 return;
176 }
177
178 app->action_export_id = g_dbus_connection_export_action_group (app->bus,
179 object_path,
180 G_ACTION_GROUP (app->source_actions),
181 &error);
182 if (!app->action_export_id)
183 {
184 g_warning ("unable to export action group: %s", error->message);
185 g_clear_error (&error);
186 }
187
188 app->menu_export_id = g_dbus_connection_export_menu_model (app->bus,
189 object_path,
190 G_MENU_MODEL (app->menu),
191 &error);
192 if (!app->menu_export_id)
193 {
194 g_warning ("unable to export menu: %s", error->message);
195 g_clear_error (&error);
196 }
197
198 g_free (object_path);
199}
200
201static void
202messaging_menu_app_set_desktop_id (MessagingMenuApp *app,
203 const gchar *desktop_id)
204{
205 g_return_if_fail (desktop_id != NULL);
206
207 /* no need to clean up, it's construct only */
208 app->appinfo = g_desktop_app_info_new (desktop_id);
209 if (app->appinfo == NULL)
210 {
211 g_warning ("could not find the desktop file for '%s'",
212 desktop_id);
213 }
214
215 g_bus_get (G_BUS_TYPE_SESSION,
216 app->cancellable,
217 export_menus_and_actions,
218 app);
219}
220
221static void
222messaging_menu_app_set_property (GObject *object,
223 guint prop_id,
224 const GValue *value,
225 GParamSpec *pspec)
226{
227 MessagingMenuApp *app = MESSAGING_MENU_APP (object);
228
229 switch (prop_id)
230 {
231 case PROP_DESKTOP_ID:
232 messaging_menu_app_set_desktop_id (app, g_value_get_string (value));
233 break;
234
235 default:
236 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
237 }
238}
239
240static void
241messaging_menu_app_finalize (GObject *object)
242{
243 G_OBJECT_CLASS (messaging_menu_app_parent_class)->finalize (object);
244}
245
246static void
247messaging_menu_app_dispose (GObject *object)
248{
249 MessagingMenuApp *app = MESSAGING_MENU_APP (object);
250
251 if (app->bus)
252 {
253 if (app->action_export_id > 0)
254 g_dbus_connection_unexport_action_group (app->bus, app->action_export_id);
255
256 if (app->menu_export_id > 0)
257 g_dbus_connection_unexport_menu_model (app->bus, app->menu_export_id);
258
259 app->action_export_id = 0;
260 app->menu_export_id = 0;
261 g_object_unref (app->bus);
262 app->bus = NULL;
263 }
264
265 if (app->watch_id > 0)
266 {
267 g_bus_unwatch_name (app->watch_id);
268 app->watch_id = 0;
269 }
270
271 if (app->cancellable)
272 {
273 g_cancellable_cancel (app->cancellable);
274 g_object_unref (app->cancellable);
275 app->cancellable = NULL;
276 }
277
278 if (app->messages_service)
279 {
280 indicator_messages_service_call_application_stopped_running (app->messages_service,
281 g_app_info_get_id (G_APP_INFO (app->appinfo)),
282 NULL, NULL, NULL);
283
284 g_signal_handlers_disconnect_by_func (app->messages_service,
285 global_status_changed,
286 app);
287 g_clear_object (&app->messages_service);
288 }
289
290 g_clear_object (&app->appinfo);
291 g_clear_object (&app->source_actions);
292 g_clear_object (&app->menu);
293
294 G_OBJECT_CLASS (messaging_menu_app_parent_class)->dispose (object);
295}
296
297static void
298messaging_menu_app_class_init (MessagingMenuAppClass *class)
299{
300 GObjectClass *object_class = G_OBJECT_CLASS (class);
301
302 object_class->set_property = messaging_menu_app_set_property;
303 object_class->finalize = messaging_menu_app_finalize;
304 object_class->dispose = messaging_menu_app_dispose;
305
306 /**
307 * MessagingMenuApp:desktop-id:
308 *
309 * The desktop id of the application associated with this application
310 * section. Must be given when the #MessagingMenuApp is created.
311 */
312 properties[PROP_DESKTOP_ID] = g_param_spec_string ("desktop-id",
313 "Desktop Id",
314 "The desktop id of the associated application",
315 NULL,
316 G_PARAM_WRITABLE |
317 G_PARAM_CONSTRUCT_ONLY |
318 G_PARAM_STATIC_STRINGS);
319
320 g_object_class_install_properties (object_class, N_PROPERTIES, properties);
321
322 /**
323 * MessagingMenuApp::activate-source:
324 * @mmapp: the #MessagingMenuApp
325 * @source_id: the source id that was activated
326 *
327 * Emitted when the user has activated the message source with id
328 * @source_id. The source is immediately removed from the menu,
329 * handlers of this signal do not need to call
330 * messaging_menu_app_remove_source().
331 */
332 signals[ACTIVATE_SOURCE] = g_signal_new ("activate-source",
333 MESSAGING_MENU_TYPE_APP,
334 G_SIGNAL_RUN_FIRST |
335 G_SIGNAL_DETAILED,
336 0,
337 NULL, NULL,
338 g_cclosure_marshal_VOID__STRING,
339 G_TYPE_NONE, 1, G_TYPE_STRING);
340
341 /**
342 * MessagingMenuApp::status-changed:
343 * @mmapp: the #MessagingMenuApp
344 * @status: a #MessagingMenuStatus
345 *
346 * Emitted when the chat status is changed through the messaging menu.
347 *
348 * Applications which are registered to use the chat status should
349 * change their status to @status upon receiving this signal. Call
350 * messaging_menu_app_set_status() to acknowledge that the application
351 * changed its status.
352 */
353 signals[STATUS_CHANGED] = g_signal_new ("status-changed",
354 MESSAGING_MENU_TYPE_APP,
355 G_SIGNAL_RUN_FIRST,
356 0,
357 NULL, NULL,
358 g_cclosure_marshal_VOID__INT,
359 G_TYPE_NONE, 1, G_TYPE_INT);
360}
361
362static void
363created_messages_service (GObject *source_object,
364 GAsyncResult *result,
365 gpointer user_data)
366{
367 MessagingMenuApp *app = user_data;
368 GError *error = NULL;
369
370 app->messages_service = indicator_messages_service_proxy_new_finish (result, &error);
371 if (!app->messages_service)
372 {
373 g_warning ("unable to connect to the mesaging menu service: %s", error->message);
374 g_error_free (error);
375 return;
376 }
377
378 g_signal_connect (app->messages_service, "status-changed",
379 G_CALLBACK (global_status_changed), app);
380
381 /* sync current status */
382 if (app->registered == TRUE)
383 messaging_menu_app_register (app);
384 else if (app->registered == FALSE)
385 messaging_menu_app_unregister (app);
386 if (app->status_set)
387 messaging_menu_app_set_status (app, app->status);
388}
389
390static void
391indicator_messages_appeared (GDBusConnection *bus,
392 const gchar *name,
393 const gchar *name_owner,
394 gpointer user_data)
395{
396 MessagingMenuApp *app = user_data;
397
398 indicator_messages_service_proxy_new (bus,
399 G_DBUS_PROXY_FLAGS_NONE,
400 "com.canonical.indicator.messages",
401 "/com/canonical/indicator/messages/service",
402 app->cancellable,
403 created_messages_service,
404 app);
405}
406
407static void
408indicator_messages_vanished (GDBusConnection *bus,
409 const gchar *name,
410 gpointer user_data)
411{
412 MessagingMenuApp *app = user_data;
413
414 if (app->messages_service)
415 {
416 g_signal_handlers_disconnect_by_func (app->messages_service,
417 global_status_changed,
418 app);
419 g_clear_object (&app->messages_service);
420 }
421}
422
423static void
424messaging_menu_app_init (MessagingMenuApp *app)
425{
426 app->registered = -1;
427 app->status_set = FALSE;
428 app->bus = NULL;
429
430 app->action_export_id = 0;
431 app->menu_export_id = 0;
432
433 app->cancellable = g_cancellable_new ();
434
435 app->source_actions = g_simple_action_group_new ();
436 app->menu = g_menu_new ();
437
438 app->cancellable = g_cancellable_new ();
439
440 app->watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
441 "com.canonical.indicator.messages",
442 G_BUS_NAME_WATCHER_FLAGS_NONE,
443 indicator_messages_appeared,
444 indicator_messages_vanished,
445 app,
446 NULL);
447}
448
449/**
450 * messaging_menu_new:
451 * @desktop_id: a desktop file id. See g_desktop_app_info_new()
452 *
453 * Creates a new #MessagingMenuApp for the application associated with
454 * @desktop_id.
455 *
456 * The application will not show up (nor be marked as "running") in the
457 * Messaging Menu before messaging_menu_app_register() has been called.
458 *
459 * Returns: (transfer full): a new #MessagingMenuApp
460 */
461MessagingMenuApp *
462messaging_menu_app_new (const gchar *desktop_id)
463{
464 return g_object_new (MESSAGING_MENU_TYPE_APP,
465 "desktop-id", desktop_id,
466 NULL);
467}
468
469/**
470 * messaging_menu_app_register:
471 * @app: a #MessagingMenuApp
472 *
473 * Registers @app with the Messaging Menu.
474 *
475 * If the application doesn't already have a section in the Messaging
476 * Menu, one will be created for it. The application will also be
477 * marked as "running".
478 *
479 * The application will be marked as "not running" as soon as @app is
480 * destroyed. The application launcher as well as shortcut actions will
481 * remain in the menu. To completely remove the application section
482 * from the Messaging Menu, call messaging_menu_app_unregister().
483 */
484void
485messaging_menu_app_register (MessagingMenuApp *app)
486{
487 gchar *object_path;
488
489 g_return_if_fail (MESSAGING_MENU_IS_APP (app));
490
491 app->registered = TRUE;
492
493 /* state will be synced right after connecting to the service */
494 if (!app->messages_service)
495 return;
496
497 object_path = messaging_menu_app_get_dbus_object_path (app);
498 if (!object_path)
499 return;
500
501 indicator_messages_service_call_register_application (app->messages_service,
502 g_app_info_get_id (G_APP_INFO (app->appinfo)),
503 object_path,
504 app->cancellable,
505 NULL, NULL);
506
507 g_free (object_path);
508}
509
510/**
511 * messaging_menu_app_unregister:
512 * @app: a #MessagingMenuApp
513 *
514 * Completely removes the @app from the Messaging Menu. If the
515 * application's launcher and shortcut actions should remain in the
516 * menu, destroying @app with g_object_unref() suffices.
517 *
518 * Note: @app will remain valid and usable after this call.
519 */
520void
521messaging_menu_app_unregister (MessagingMenuApp *app)
522{
523 g_return_if_fail (MESSAGING_MENU_IS_APP (app));
524
525 app->registered = FALSE;
526
527 /* state will be synced right after connecting to the service */
528 if (!app->messages_service)
529 return;
530
531 if (!app->appinfo)
532 return;
533
534 indicator_messages_service_call_unregister_application (app->messages_service,
535 g_app_info_get_id (G_APP_INFO (app->appinfo)),
536 app->cancellable,
537 NULL, NULL);
538}
539
540/**
541 * messaging_menu_app_set_status:
542 * @app: a #MessagingMenuApp
543 * @status: a #MessagingMenuStatus
544 *
545 * Notify the Messaging Menu that the chat status of @app has changed to
546 * @status.
547 *
548 * Connect to the ::status-changed signal to receive notification about
549 * the user changing their global chat status through the Messaging
550 * Menu.
551 *
552 * This function does nothing for applications whose desktop file does
553 * not include X-MessagingMenu-UsesChatSection.
554 */
555void
556messaging_menu_app_set_status (MessagingMenuApp *app,
557 MessagingMenuStatus status)
558{
559 g_return_if_fail (MESSAGING_MENU_IS_APP (app));
560 g_return_if_fail (status >= MESSAGING_MENU_STATUS_AVAILABLE &&
561 status <= MESSAGING_MENU_STATUS_OFFLINE);
562
563 app->status = status;
564 app->status_set = TRUE;
565
566 /* state will be synced right after connecting to the service */
567 if (!app->messages_service)
568 return;
569
570 if (!app->appinfo)
571 return;
572
573 indicator_messages_service_call_set_status (app->messages_service,
574 g_app_info_get_id (G_APP_INFO (app->appinfo)),
575 status_ids [status],
576 app->cancellable,
577 NULL, NULL);
578}
579
580static int
581status_from_string (const gchar *s)
582{
583 int i;
584
585 if (!s)
586 return -1;
587
588 for (i = 0; i <= MESSAGING_MENU_STATUS_OFFLINE; i++)
589 {
590 if (g_str_equal (s, status_ids[i]))
591 return i;
592 }
593
594 return -1;
595}
596
597static void
598global_status_changed (IndicatorMessagesService *service,
599 const gchar *status_str,
600 gpointer user_data)
601{
602 MessagingMenuApp *app = user_data;
603 int status;
604
605 status = status_from_string (status_str);
606 g_return_if_fail (status >= 0);
607
608 g_signal_emit (app, signals[STATUS_CHANGED], 0, status);
609}
610
611static void
612source_action_activated (GSimpleAction *action,
613 GVariant *parameter,
614 gpointer user_data)
615{
616 MessagingMenuApp *app = user_data;
617 const gchar *name = g_action_get_name (G_ACTION (action));
618 GQuark q = g_quark_from_string (name);
619
620 messaging_menu_app_remove_source (app, name);
621
622 g_signal_emit (app, signals[ACTIVATE_SOURCE], q, name);
623}
624
625static void
626messaging_menu_app_insert_source_action (MessagingMenuApp *app,
627 gint position,
628 const gchar *id,
629 GIcon *icon,
630 const gchar *label,
631 GVariant *state)
632{
633 GSimpleAction *action;
634 GMenuItem *menuitem;
635
636 g_return_if_fail (MESSAGING_MENU_IS_APP (app));
637 g_return_if_fail (id != NULL);
638
639 if (g_simple_action_group_lookup (app->source_actions, id))
640 {
641 g_warning ("a source with id '%s' already exists", id);
642 return;
643 }
644
645 action = g_simple_action_new_stateful (id, NULL, state);
646 g_signal_connect (action, "activate",
647 G_CALLBACK (source_action_activated), app);
648 g_simple_action_group_insert (app->source_actions, G_ACTION (action));
649 g_object_unref (action);
650
651 menuitem = g_menu_item_new (label, id);
652 g_menu_item_set_attribute (menuitem, "x-canonical-type", "s", "ImSourceMenuItem");
653 if (icon)
654 {
655 gchar *iconstr = g_icon_to_string (icon);
656 g_menu_item_set_attribute (menuitem, "x-canonical-icon", "s", iconstr);
657 g_free (iconstr);
658 }
659 g_menu_insert_item (app->menu, position, menuitem);
660 g_object_unref (menuitem);
661}
662
663static GSimpleAction *
664messaging_menu_app_get_source_action (MessagingMenuApp *app,
665 const gchar *source_id)
666
667{
668 GAction *action;
669
670 g_return_val_if_fail (MESSAGING_MENU_IS_APP (app), NULL);
671 g_return_val_if_fail (source_id != NULL, NULL);
672
673 action = g_simple_action_group_lookup (app->source_actions, source_id);
674 if (action == NULL)
675 g_warning ("a source with id '%s' doesn't exist", source_id);
676
677 return G_SIMPLE_ACTION (action);
678}
679
680static void
681messaging_menu_app_set_source_action (MessagingMenuApp *app,
682 const gchar *source_id,
683 guint count,
684 gint64 time,
685 const gchar *string)
686{
687 GSimpleAction *action;
688 GVariant *state;
689 gboolean draws_attention;
690 GVariant *new_state;
691
692 action = messaging_menu_app_get_source_action (app, source_id);
693 if (!action)
694 return;
695
696 state = g_action_get_state (G_ACTION (action));
697 g_variant_get_child (state, 3, "b", &draws_attention);
698
699 new_state = g_variant_new ("(uxsb)", count, time, string, draws_attention);
700 g_simple_action_set_state (action, new_state);
701
702 g_variant_unref (state);
703}
704
705static void
706messaging_menu_app_set_draws_attention (MessagingMenuApp *app,
707 const gchar *source_id,
708 gboolean draws_attention)
709{
710 GSimpleAction *action;
711 GVariant *state;
712 guint count;
713 gint64 time;
714 const gchar *string;
715 GVariant *new_state;
716
717 action = messaging_menu_app_get_source_action (app, source_id);
718 if (!action)
719 return;
720
721 state = g_action_get_state (G_ACTION (action));
722 g_variant_get (state, "(ux&sb)", &count, &time, &string, NULL);
723
724 new_state = g_variant_new ("(uxsb)", count, time, string, TRUE);
725 g_simple_action_set_state (action, new_state);
726
727 g_variant_unref (state);
728}
729
730/**
731 * messaging_menu_app_insert_source:
732 * @app: a #MessagingMenuApp
733 * @position: the position at which to insert the source
734 * @id: a unique identifier for the source to be added
735 * @icon: the icon associated with the source
736 * @label: a user-visible string best describing the source
737 *
738 * Inserts a new message source into the section representing @app. Equivalent
739 * to calling messaging_menu_app_insert_source_with_time() with the current
740 * time.
741 *
742 * It is an error to insert a source with an @id which already exists. Use
743 * messaging_menu_app_has_source() to find out whether there is such a source.
744 */
745void
746messaging_menu_app_insert_source (MessagingMenuApp *app,
747 gint position,
748 const gchar *id,
749 GIcon *icon,
750 const gchar *label)
751{
752 messaging_menu_app_insert_source_with_time (app, position, id, icon, label,
753 g_get_real_time ());
754}
755
756/**
757 * messaging_menu_app_append_source:
758 * @app: a #MessagingMenuApp
759 * @id: a unique identifier for the source to be added
760 * @icon: (allow-none): the icon associated with the source
761 * @label: a user-visible string best describing the source
762 *
763 * Appends a new message source to the end of the section representing @app.
764 * Equivalent to calling messaging_menu_app_append_source_with_time() with the
765 * current time.
766 *
767 * It is an error to add a source with an @id which already exists. Use
768 * messaging_menu_app_has_source() to find out whether there is such a source.
769 */
770void
771messaging_menu_app_append_source (MessagingMenuApp *app,
772 const gchar *id,
773 GIcon *icon,
774 const gchar *label)
775{
776 messaging_menu_app_insert_source (app, -1, id, icon, label);
777}
778
779/**
780 * messaging_menu_app_insert_source_with_count:
781 * @app: a #MessagingMenuApp
782 * @position: the position at which to insert the source
783 * @id: a unique identifier for the source to be added
784 * @icon: (allow-none): the icon associated with the source
785 * @label: a user-visible string best describing the source
786 * @count: the count for the source
787 *
788 * Inserts a new message source into the section representing @app and
789 * initializes it with @count.
790 *
791 * To update the count, use messaging_menu_app_set_source_count().
792 *
793 * It is an error to insert a source with an @id which already exists. Use
794 * messaging_menu_app_has_source() to find out whether there is such a source.
795 */
796void
797messaging_menu_app_insert_source_with_count (MessagingMenuApp *app,
798 gint position,
799 const gchar *id,
800 GIcon *icon,
801 const gchar *label,
802 guint count)
803{
804 messaging_menu_app_insert_source_action (app, position, id, icon, label,
805 g_variant_new ("(uxsb)", count, 0, "", FALSE));
806}
807
808/**
809 * messaging_menu_app_append_source_with_count:
810 * @app: a #MessagingMenuApp
811 * @id: a unique identifier for the source to be added
812 * @icon: (allow-none): the icon associated with the source
813 * @label: a user-visible string best describing the source
814 * @count: the count for the source
815 *
816 * Appends a new message source to the end of the section representing @app and
817 * initializes it with @count.
818 *
819 * To update the count, use messaging_menu_app_set_source_count().
820 *
821 * It is an error to add a source with an @id which already exists. Use
822 * messaging_menu_app_has_source() to find out whether there is such a source.
823 */
824void messaging_menu_app_append_source_with_count (MessagingMenuApp *app,
825 const gchar *id,
826 GIcon *icon,
827 const gchar *label,
828 guint count)
829{
830 messaging_menu_app_insert_source_with_count (app, -1, id, icon, label, count);
831}
832
833/**
834 * messaging_menu_app_insert_source_with_time:
835 * @app: a #MessagingMenuApp
836 * @position: the position at which to insert the source
837 * @id: a unique identifier for the source to be added
838 * @icon: (allow-none): the icon associated with the source
839 * @label: a user-visible string best describing the source
840 * @time: the time when the source was created, in microseconds
841 *
842 * Inserts a new message source into the section representing @app and
843 * initializes it with @time. Use messaging_menu_app_insert_source() to
844 * insert a source with the current time.
845 *
846 * To change the time, use messaging_menu_app_set_source_time().
847 *
848 * It is an error to insert a source with an @id which already exists. Use
849 * messaging_menu_app_has_source() to find out whether there is such a source.
850 */
851void
852messaging_menu_app_insert_source_with_time (MessagingMenuApp *app,
853 gint position,
854 const gchar *id,
855 GIcon *icon,
856 const gchar *label,
857 gint64 time)
858{
859 messaging_menu_app_insert_source_action (app, position, id, icon, label,
860 g_variant_new ("(uxsb)", 0, time, "", FALSE));
861}
862
863/**
864 * messaging_menu_app_append_source_with_time:
865 * @app: a #MessagingMenuApp
866 * @id: a unique identifier for the source to be added
867 * @icon: (allow-none): the icon associated with the source
868 * @label: a user-visible string best describing the source
869 * @time: the time when the source was created, in microseconds
870 *
871 * Appends a new message source to the end of the section representing
872 * @app and initializes it with @time. Use
873 * messaging_menu_app_append_source() to append a source with the
874 * current time.
875 *
876 * To change the time, use messaging_menu_app_set_source_time().
877 *
878 * It is an error to insert a source with an @id which already exists. Use
879 * messaging_menu_app_has_source() to find out whether there is such a source.
880 */
881void
882messaging_menu_app_append_source_with_time (MessagingMenuApp *app,
883 const gchar *id,
884 GIcon *icon,
885 const gchar *label,
886 gint64 time)
887{
888 messaging_menu_app_insert_source_with_time (app, -1, id, icon, label, time);
889}
890
891/**
892 * messaging_menu_app_insert_source_with_string:
893 * @app: a #MessagingMenuApp
894 * @position: the position at which to insert the source
895 * @id: a unique identifier for the source to be added
896 * @icon: (allow-none): the icon associated with the source
897 * @label: a user-visible string best describing the source
898 * @str: a string associated with the source
899 *
900 * Inserts a new message source into the section representing @app and
901 * initializes it with @str.
902 *
903 * To update the string, use messaging_menu_app_set_source_string().
904 *
905 * It is an error to insert a source with an @id which already exists. Use
906 * messaging_menu_app_has_source() to find out whether there is such a source.
907 */
908void
909messaging_menu_app_insert_source_with_string (MessagingMenuApp *app,
910 gint position,
911 const gchar *id,
912 GIcon *icon,
913 const gchar *label,
914 const gchar *str)
915{
916 messaging_menu_app_insert_source_action (app, position, id, icon, label,
917 g_variant_new ("(uxsb)", 0, 0, str, FALSE));
918}
919
920/**
921 * messaging_menu_app_append_source_with_string:
922 * @app: a #MessagingMenuApp
923 * @id: a unique identifier for the source to be added
924 * @icon: (allow-none): the icon associated with the source
925 * @label: a user-visible string best describing the source
926 * @str: a string associated with the source
927 *
928 * Appends a new message source to the end of the section representing @app and
929 * initializes it with @str.
930 *
931 * To update the string, use messaging_menu_app_set_source_string().
932 *
933 * It is an error to insert a source with an @id which already exists. Use
934 * messaging_menu_app_has_source() to find out whether there is such a source.
935 */
936void
937messaging_menu_app_append_source_with_string (MessagingMenuApp *app,
938 const gchar *id,
939 GIcon *icon,
940 const gchar *label,
941 const gchar *str)
942{
943 messaging_menu_app_insert_source_with_string (app, -1, id, icon, label, str);
944}
945
946/**
947 * messaging_menu_app_remove_source:
948 * @app: a #MessagingMenuApp
949 * @source_id: the id of the source to remove
950 *
951 * Removes the source corresponding to @source_id from the menu.
952 */
953void
954messaging_menu_app_remove_source (MessagingMenuApp *app,
955 const gchar *source_id)
956{
957 int n_items;
958 int i;
959
960 g_return_if_fail (MESSAGING_MENU_IS_APP (app));
961 g_return_if_fail (source_id != NULL);
962
963 if (g_simple_action_group_lookup (app->source_actions, source_id) == NULL)
964 return;
965
966 n_items = g_menu_model_get_n_items (G_MENU_MODEL (app->menu));
967 for (i = 0; i < n_items; i++)
968 {
969 gchar *action;
970
971 if (g_menu_model_get_item_attribute (G_MENU_MODEL (app->menu), i,
972 "action", "s", &action))
973 {
974 if (!g_strcmp0 (action, source_id))
975 {
976 g_menu_remove (app->menu, i);
977 break;
978 }
979
980 g_free (action);
981 }
982 }
983
984 g_simple_action_group_remove (app->source_actions, source_id);
985}
986
987/**
988 * messaging_menu_app_has_source:
989 * @app: a #MessagingMenuApp
990 * @source_id: a source id
991 *
992 * Returns: TRUE if there is a source associated with @source_id
993 */
994gboolean
995messaging_menu_app_has_source (MessagingMenuApp *app,
996 const gchar *source_id)
997{
998 g_return_val_if_fail (MESSAGING_MENU_IS_APP (app), FALSE);
999 g_return_val_if_fail (source_id != NULL, FALSE);
1000
1001 return g_simple_action_group_lookup (app->source_actions, source_id) != NULL;
1002}
1003
1004static GMenuItem *
1005g_menu_find_item_with_action (GMenu *menu,
1006 const gchar *action,
1007 gint *out_pos)
1008{
1009 gint i;
1010 gint n_elements;
1011 GMenuItem *item = NULL;
1012
1013 n_elements = g_menu_model_get_n_items (G_MENU_MODEL (menu));
1014
1015 for (i = 0; i < n_elements && item == NULL; i++)
1016 {
1017 GVariant *attr;
1018
1019 item = g_menu_item_new_from_model (G_MENU_MODEL (menu), i);
1020 attr = g_menu_item_get_attribute_value (item, G_MENU_ATTRIBUTE_ACTION, G_VARIANT_TYPE_STRING);
1021
1022 if (!g_str_equal (action, g_variant_get_string (attr, NULL)))
1023 g_clear_object (&item);
1024
1025 g_variant_unref (attr);
1026 }
1027
1028 if (item && out_pos)
1029 *out_pos = i - 1;
1030
1031 return item;
1032}
1033
1034static void
1035g_menu_replace_item (GMenu *menu,
1036 gint pos,
1037 GMenuItem *item)
1038{
1039 g_menu_remove (menu, pos);
1040 g_menu_insert_item (menu, pos, item);
1041}
1042
1043/**
1044 * messaging_menu_app_set_source_label:
1045 * @app: a #MessagingMenuApp
1046 * @source_id: a source id
1047 * @label: the new label for the source
1048 *
1049 * Changes the label of @source_id to @label.
1050 */
1051void
1052messaging_menu_app_set_source_label (MessagingMenuApp *app,
1053 const gchar *source_id,
1054 const gchar *label)
1055{
1056 gint pos;
1057 GMenuItem *item;
1058
1059 g_return_if_fail (MESSAGING_MENU_IS_APP (app));
1060 g_return_if_fail (source_id != NULL);
1061 g_return_if_fail (label != NULL);
1062
1063 item = g_menu_find_item_with_action (app->menu, source_id, &pos);
1064 if (item == NULL)
1065 return;
1066
1067 g_menu_item_set_attribute (item, G_MENU_ATTRIBUTE_LABEL, "s", label);
1068 g_menu_replace_item (app->menu, pos, item);
1069
1070 g_object_unref (item);
1071}
1072
1073/**
1074 * messaging_menu_app_set_source_icon:
1075 * @app: a #MessagingMenuApp
1076 * @source_id: a source id
1077 * @icon: (allow-none): the new icon for the source
1078 *
1079 * Changes the icon of @source_id to @icon.
1080 */
1081void
1082messaging_menu_app_set_source_icon (MessagingMenuApp *app,
1083 const gchar *source_id,
1084 GIcon *icon)
1085{
1086 gint pos;
1087 GMenuItem *item;
1088
1089 g_return_if_fail (MESSAGING_MENU_IS_APP (app));
1090 g_return_if_fail (source_id != NULL);
1091
1092 item = g_menu_find_item_with_action (app->menu, source_id, &pos);
1093 if (item == NULL)
1094 return;
1095
1096 if (icon)
1097 {
1098 gchar *iconstr;
1099
1100 iconstr = g_icon_to_string (icon);
1101 g_menu_item_set_attribute (item, "x-canonical-icon", "s", iconstr);
1102
1103 g_free (iconstr);
1104 }
1105 else
1106 {
1107 g_menu_item_set_attribute_value (item, "x-canonical-icon", NULL);
1108 }
1109
1110 g_menu_replace_item (app->menu, pos, item);
1111
1112 g_object_unref (item);
1113}
1114
1115/**
1116 * messaging_menu_app_set_source_count:
1117 * @app: a #MessagingMenuApp
1118 * @source_id: a source id
1119 * @count: the new count for the source
1120 *
1121 * Updates the count of @source_id to @count.
1122 */
1123void messaging_menu_app_set_source_count (MessagingMenuApp *app,
1124 const gchar *source_id,
1125 guint count)
1126{
1127 messaging_menu_app_set_source_action (app, source_id, count, 0, "");
1128}
1129
1130/**
1131 * messaging_menu_app_set_source_time:
1132 * @app: a #MessagingMenuApp
1133 * @source_id: a source id
1134 * @time: the new time for the source, in microseconds
1135 *
1136 * Updates the time of @source_id to @time.
1137 */
1138void
1139messaging_menu_app_set_source_time (MessagingMenuApp *app,
1140 const gchar *source_id,
1141 gint64 time)
1142{
1143 messaging_menu_app_set_source_action (app, source_id, 0, time, "");
1144}
1145
1146/**
1147 * messaging_menu_app_set_source_string:
1148 * @app: a #MessagingMenuApp
1149 * @source_id: a source id
1150 * @str: the new string for the source
1151 *
1152 * Updates the string displayed next to @source_id to @str.
1153 */
1154void
1155messaging_menu_app_set_source_string (MessagingMenuApp *app,
1156 const gchar *source_id,
1157 const gchar *str)
1158{
1159 messaging_menu_app_set_source_action (app, source_id, 0, 0, str);
1160}
1161
1162/**
1163 * messaging_menu_app_draw_attention:
1164 * @app: a #MessagingMenuApp
1165 * @source_id: a source id
1166 *
1167 * Indicates that @source_id has important unread messages. Currently, this
1168 * means that the messaging menu's envelope icon will turn blue.
1169 *
1170 * Use messaging_menu_app_remove_attention() to stop indicating that the source
1171 * needs attention.
1172 */
1173void
1174messaging_menu_app_draw_attention (MessagingMenuApp *app,
1175 const gchar *source_id)
1176{
1177 messaging_menu_app_set_draws_attention (app, source_id, TRUE);
1178}
1179
1180/**
1181 * messaging_menu_app_remove_attention:
1182 * @app: a #MessagingMenuApp
1183 * @source_id: a source id
1184 *
1185 * Stop indicating that @source_id needs attention.
1186 *
1187 * This function does not need to be called when the source is removed
1188 * with messaging_menu_app_remove_source() or the user has activated the
1189 * source.
1190 *
1191 * Use messaging_menu_app_draw_attention() to make @source_id draw attention
1192 * again.
1193 */
1194void
1195messaging_menu_app_remove_attention (MessagingMenuApp *app,
1196 const gchar *source_id)
1197{
1198 messaging_menu_app_set_draws_attention (app, source_id, TRUE);
1199}
01200
=== added file 'libmessaging-menu/messaging-menu.h'
--- libmessaging-menu/messaging-menu.h 1970-01-01 00:00:00 +0000
+++ libmessaging-menu/messaging-menu.h 2013-06-07 21:39:23 +0000
@@ -0,0 +1,148 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License version 3, as
6 * published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranties of
10 * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
11 * PURPOSE. See the GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * Authors:
17 * Lars Uebernickel <lars.uebernickel@canonical.com>
18 */
19
20#ifndef __messaging_menu_h__
21#define __messaging_menu_h__
22
23#include <gio/gio.h>
24
25G_BEGIN_DECLS
26
27#define MESSAGING_MENU_TYPE_APP messaging_menu_app_get_type()
28#define MESSAGING_MENU_APP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MESSAGING_MENU_TYPE_APP, MessagingMenuApp))
29#define MESSAGING_MENU_APP_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), MESSAGING_MENU_TYPE_APP, MessagingMenuAppClass))
30#define MESSAGING_MENU_IS_APP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MESSAGING_MENU_TYPE_APP))
31
32/**
33 * MessagingMenuStatus:
34 * @MESSAGING_MENU_STATUS_AVAILABLE: available
35 * @MESSAGING_MENU_STATUS_AWAY: away
36 * @MESSAGING_MENU_STATUS_BUSY: busy
37 * @MESSAGING_MENU_STATUS_INVISIBLE: invisible
38 * @MESSAGING_MENU_STATUS_OFFLINE: offline
39 *
40 * An enumeration for the possible chat statuses the messaging menu can be in.
41 */
42typedef enum {
43 MESSAGING_MENU_STATUS_AVAILABLE,
44 MESSAGING_MENU_STATUS_AWAY,
45 MESSAGING_MENU_STATUS_BUSY,
46 MESSAGING_MENU_STATUS_INVISIBLE,
47 MESSAGING_MENU_STATUS_OFFLINE
48} MessagingMenuStatus;
49
50
51typedef GObjectClass MessagingMenuAppClass;
52typedef struct _MessagingMenuApp MessagingMenuApp;
53
54GType messaging_menu_app_get_type (void) G_GNUC_CONST;
55
56MessagingMenuApp * messaging_menu_app_new (const gchar *desktop_id);
57
58void messaging_menu_app_register (MessagingMenuApp *app);
59void messaging_menu_app_unregister (MessagingMenuApp *app);
60
61void messaging_menu_app_set_status (MessagingMenuApp *app,
62 MessagingMenuStatus status);
63
64void messaging_menu_app_insert_source (MessagingMenuApp *app,
65 gint position,
66 const gchar *id,
67 GIcon *icon,
68 const gchar *label);
69
70void messaging_menu_app_append_source (MessagingMenuApp *app,
71 const gchar *id,
72 GIcon *icon,
73 const gchar *label);
74
75void messaging_menu_app_insert_source_with_count (MessagingMenuApp *app,
76 gint position,
77 const gchar *id,
78 GIcon *icon,
79 const gchar *label,
80 guint count);
81
82void messaging_menu_app_append_source_with_count (MessagingMenuApp *app,
83 const gchar *id,
84 GIcon *icon,
85 const gchar *label,
86 guint count);
87
88void messaging_menu_app_insert_source_with_time (MessagingMenuApp *app,
89 gint position,
90 const gchar *id,
91 GIcon *icon,
92 const gchar *label,
93 gint64 time);
94
95void messaging_menu_app_append_source_with_time (MessagingMenuApp *app,
96 const gchar *id,
97 GIcon *icon,
98 const gchar *label,
99 gint64 time);
100
101void messaging_menu_app_append_source_with_string (MessagingMenuApp *app,
102 const gchar *id,
103 GIcon *icon,
104 const gchar *label,
105 const gchar *str);
106
107void messaging_menu_app_insert_source_with_string (MessagingMenuApp *app,
108 gint position,
109 const gchar *id,
110 GIcon *icon,
111 const gchar *label,
112 const gchar *str);
113
114void messaging_menu_app_remove_source (MessagingMenuApp *app,
115 const gchar *source_id);
116
117gboolean messaging_menu_app_has_source (MessagingMenuApp *app,
118 const gchar *source_id);
119
120void messaging_menu_app_set_source_label (MessagingMenuApp *app,
121 const gchar *source_id,
122 const gchar *label);
123
124void messaging_menu_app_set_source_icon (MessagingMenuApp *app,
125 const gchar *source_id,
126 GIcon *icon);
127
128void messaging_menu_app_set_source_count (MessagingMenuApp *app,
129 const gchar *source_id,
130 guint count);
131
132void messaging_menu_app_set_source_time (MessagingMenuApp *app,
133 const gchar *source_id,
134 gint64 time);
135
136void messaging_menu_app_set_source_string (MessagingMenuApp *app,
137 const gchar *source_id,
138 const gchar *str);
139
140void messaging_menu_app_draw_attention (MessagingMenuApp *app,
141 const gchar *source_id);
142
143void messaging_menu_app_remove_attention (MessagingMenuApp *app,
144 const gchar *source_id);
145
146G_END_DECLS
147
148#endif
0149
=== added file 'libmessaging-menu/messaging-menu.pc.in'
--- libmessaging-menu/messaging-menu.pc.in 1970-01-01 00:00:00 +0000
+++ libmessaging-menu/messaging-menu.pc.in 2013-06-07 21:39:23 +0000
@@ -0,0 +1,11 @@
1prefix=@prefix@
2exec_prefix=@exec_prefix@
3libdir=@libdir@
4includedir=@includedir@/messaging-menu
5
6Name: Messaging Menu Library
7Description: Messaging Menu client library
8Version: @VERSION@
9Requires: gio-unix-2.0
10Libs: -L${libdir} -lmessaging-menu
11Cflags: -I${includedir}
012
=== added directory 'm4'
=== added file 'm4/ax_python_module.m4'
--- m4/ax_python_module.m4 1970-01-01 00:00:00 +0000
+++ m4/ax_python_module.m4 2013-06-07 21:39:23 +0000
@@ -0,0 +1,49 @@
1# ===========================================================================
2# http://www.gnu.org/software/autoconf-archive/ax_python_module.html
3# ===========================================================================
4#
5# SYNOPSIS
6#
7# AX_PYTHON_MODULE(modname[, fatal])
8#
9# DESCRIPTION
10#
11# Checks for Python module.
12#
13# If fatal is non-empty then absence of a module will trigger an error.
14#
15# LICENSE
16#
17# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
18#
19# Copying and distribution of this file, with or without modification, are
20# permitted in any medium without royalty provided the copyright notice
21# and this notice are preserved. This file is offered as-is, without any
22# warranty.
23
24#serial 5
25
26AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
27AC_DEFUN([AX_PYTHON_MODULE],[
28 if test -z $PYTHON;
29 then
30 PYTHON="python"
31 fi
32 PYTHON_NAME=`basename $PYTHON`
33 AC_MSG_CHECKING($PYTHON_NAME module: $1)
34 $PYTHON -c "import $1" 2>/dev/null
35 if test $? -eq 0;
36 then
37 AC_MSG_RESULT(yes)
38 eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
39 else
40 AC_MSG_RESULT(no)
41 eval AS_TR_CPP(HAVE_PYMOD_$1)=no
42 #
43 if test -n "$2"
44 then
45 AC_MSG_ERROR(failed to find required module $1)
46 exit 1
47 fi
48 fi
49])
050
=== added file 'm4/gcov.m4'
--- m4/gcov.m4 1970-01-01 00:00:00 +0000
+++ m4/gcov.m4 2013-06-07 21:39:23 +0000
@@ -0,0 +1,86 @@
1# Checks for existence of coverage tools:
2# * gcov
3# * lcov
4# * genhtml
5# * gcovr
6#
7# Sets ac_cv_check_gcov to yes if tooling is present
8# and reports the executables to the variables LCOV, GCOVR and GENHTML.
9AC_DEFUN([AC_TDD_GCOV],
10[
11 AC_ARG_ENABLE(gcov,
12 AS_HELP_STRING([--enable-gcov],
13 [enable coverage testing with gcov]),
14 [use_gcov=$enableval], [use_gcov=no])
15
16 if test "x$use_gcov" = "xyes"; then
17 # we need gcc:
18 if test "$GCC" != "yes"; then
19 AC_MSG_ERROR([GCC is required for --enable-gcov])
20 fi
21
22 # Check if ccache is being used
23 AC_CHECK_PROG(SHTOOL, shtool, shtool)
24 case `$SHTOOL path $CC` in
25 *ccache*[)] gcc_ccache=yes;;
26 *[)] gcc_ccache=no;;
27 esac
28
29 if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
30 AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
31 fi
32
33 lcov_version_list="1.6 1.7 1.8 1.9"
34 AC_CHECK_PROG(LCOV, lcov, lcov)
35 AC_CHECK_PROG(GENHTML, genhtml, genhtml)
36
37 if test "$LCOV"; then
38 AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
39 glib_cv_lcov_version=invalid
40 lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
41 for lcov_check_version in $lcov_version_list; do
42 if test "$lcov_version" = "$lcov_check_version"; then
43 glib_cv_lcov_version="$lcov_check_version (ok)"
44 fi
45 done
46 ])
47 else
48 lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
49 AC_MSG_ERROR([$lcov_msg])
50 fi
51
52 case $glib_cv_lcov_version in
53 ""|invalid[)]
54 lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
55 AC_MSG_ERROR([$lcov_msg])
56 LCOV="exit 0;"
57 ;;
58 esac
59
60 if test -z "$GENHTML"; then
61 AC_MSG_ERROR([Could not find genhtml from the lcov package])
62 fi
63
64 ac_cv_check_gcov=yes
65 ac_cv_check_lcov=yes
66
67 # Remove all optimization flags from CFLAGS
68 changequote({,})
69 CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
70 changequote([,])
71
72 # Add the special gcc flags
73 COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
74 COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
75 COVERAGE_LDFLAGS="-lgcov"
76
77 # Check availability of gcovr
78 AC_CHECK_PROG(GCOVR, gcovr, gcovr)
79 if test -z "$GCOVR"; then
80 ac_cv_check_gcovr=no
81 else
82 ac_cv_check_gcovr=yes
83 fi
84
85fi
86]) # AC_TDD_GCOV
087
=== added file 'm4/gtest.m4'
--- m4/gtest.m4 1970-01-01 00:00:00 +0000
+++ m4/gtest.m4 2013-06-07 21:39:23 +0000
@@ -0,0 +1,63 @@
1# Copyright (C) 2012 Canonical, Ltd.
2#
3# Permission is hereby granted, free of charge, to any person obtaining a copy
4# of this software and associated documentation files (the "Software"), to deal
5# in the Software without restriction, including without limitation the rights
6# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7# copies of the Software, and to permit persons to whom the Software is
8# furnished to do so, subject to the following conditions:
9#
10# The above copyright notice and this permission notice (including the next
11# paragraph) shall be included in all copies or substantial portions of the
12# Software.
13#
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20# SOFTWARE.
21
22# Checks whether the gtest source is available on the system. Allows for
23# adjusting the include and source path. Sets have_gtest=yes if the source is
24# present. Sets GTEST_CPPFLAGS and GTEST_SOURCE to the preprocessor flags and
25# source location respectively.
26AC_DEFUN([CHECK_GTEST],
27[
28 AC_ARG_WITH([gtest-include-path],
29 [AS_HELP_STRING([--with-gtest-include-path],
30 [location of the Google test headers])],
31 [GTEST_CPPFLAGS="-I$withval"])
32
33 AC_ARG_WITH([gtest-source-path],
34 [AS_HELP_STRING([--with-gtest-source-path],
35 [location of the Google test sources, defaults to /usr/src/gtest])],
36 [GTEST_SOURCE="$withval"],
37 [GTEST_SOURCE="/usr/src/gtest"])
38
39 GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"
40
41 AC_LANG_PUSH([C++])
42
43 tmp_CPPFLAGS="$CPPFLAGS"
44 CPPFLAGS="$CPPFLAGS $GTEST_CPPFLAGS"
45
46 AC_CHECK_HEADER([gtest/gtest.h])
47
48 CPPFLAGS="$tmp_CPPFLAGS"
49
50 AC_LANG_POP
51
52 AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
53 [$GTEST_SOURCE/src/gtest_main.cc],
54 [have_gtest_source=yes],
55 [have_gtest_source=no])
56
57 AS_IF([test "x$ac_cv_header_gtest_gtest_h" = xyes -a \
58 "x$have_gtest_source" = xyes],
59 [have_gtest=yes]
60 [AC_SUBST(GTEST_CPPFLAGS)]
61 [AC_SUBST(GTEST_SOURCE)],
62 [have_gtest=no])
63]) # CHECK_GTEST
064
=== modified file 'po/POTFILES.in'
--- po/POTFILES.in 2011-07-02 14:42:05 +0000
+++ po/POTFILES.in 2013-06-07 21:39:23 +0000
@@ -1,9 +1,3 @@
1[encoding: UTF-8]1[encoding: UTF-8]
2src/messages-service-dbus.c
3src/indicator-messages.c2src/indicator-messages.c
4src/messages-service.c3src/messages-service.c
5src/default-applications.c
6src/launcher-menu-item.c
7src/im-menu-item.c
8src/app-menu-item.c
9src/status-items.c
104
=== added file 'po/indicator-messages.pot'
--- po/indicator-messages.pot 1970-01-01 00:00:00 +0000
+++ po/indicator-messages.pot 2013-06-07 21:39:23 +0000
@@ -0,0 +1,46 @@
1# SOME DESCRIPTIVE TITLE.
2# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3# This file is distributed under the same license as the PACKAGE package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5#
6#, fuzzy
7msgid ""
8msgstr ""
9"Project-Id-Version: PACKAGE VERSION\n"
10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2012-11-16 14:53+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
15"Language: \n"
16"MIME-Version: 1.0\n"
17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"
19
20#: ../src/messages-service.c:329
21msgid "Messages"
22msgstr ""
23
24#: ../src/messages-service.c:552
25msgid "Available"
26msgstr ""
27
28#: ../src/messages-service.c:553
29msgid "Away"
30msgstr ""
31
32#: ../src/messages-service.c:554
33msgid "Busy"
34msgstr ""
35
36#: ../src/messages-service.c:555
37msgid "Invisible"
38msgstr ""
39
40#: ../src/messages-service.c:556
41msgid "Offline"
42msgstr ""
43
44#: ../src/messages-service.c:659
45msgid "Clear"
46msgstr ""
047
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2011-07-08 19:46:06 +0000
+++ src/Makefile.am 2013-06-07 21:39:23 +0000
@@ -15,262 +15,80 @@
15messaginglib_LTLIBRARIES = libmessaging.la15messaginglib_LTLIBRARIES = libmessaging.la
16libmessaging_la_SOURCES = \16libmessaging_la_SOURCES = \
17 indicator-messages.c \17 indicator-messages.c \
18 gen-messages-service.xml.h \18 ido-menu-item.c \
19 gen-messages-service.xml.c \19 ido-menu-item.h \
20 im-app-menu-item.c \
21 im-app-menu-item.h \
22 im-source-menu-item.c \
23 im-source-menu-item.h \
24 ido-detail-label.c \
25 ido-detail-label.h \
26 indicator-messages-service.c \
27 indicator-messages-service.h
20 dbus-data.h28 dbus-data.h
21libmessaging_la_CFLAGS = \29libmessaging_la_CFLAGS = \
22 $(APPLET_CFLAGS) \30 $(APPLET_CFLAGS) \
31 $(COVERAGE_CFLAGS) \
23 -Wall \32 -Wall \
24 -Wl,-Bsymbolic-functions \33 -Wl,-Bsymbolic-functions \
25 -Wl,-z,defs \34 -Wl,-z,defs \
26 -Wl,--as-needed \35 -Wl,--as-needed \
27 -Werror \36 -Werror \
28 -DG_LOG_DOMAIN=\"Indicator-Messages\"37 -DG_LOG_DOMAIN=\"Indicator-Messages\"
29libmessaging_la_LIBADD = $(APPLET_LIBS)38libmessaging_la_LIBADD = $(APPLET_LIBS) -lm
30libmessaging_la_LDFLAGS = -module -avoid-version39libmessaging_la_LDFLAGS = \
40 $(COVERAGE_LDFLAGS) \
41 -module -avoid-version
3142
32######################################43######################################
33# Building the messages service44# Building the messages service
34######################################45######################################
3546
36indicator_messages_service_SOURCES = \47indicator_messages_service_SOURCES = \
37 default-applications.h \
38 default-applications.c \
39 messages-service.c \48 messages-service.c \
40 messages-service-dbus.c \49 indicator-messages-service.c \
41 messages-service-dbus.h \50 indicator-messages-service.h \
42 gen-messages-service.xml.h \51 app-section.c \
43 gen-messages-service.xml.c \52 app-section.h \
44 im-menu-item.c \
45 im-menu-item.h \
46 app-menu-item.c \
47 app-menu-item.h \
48 launcher-menu-item.c \
49 launcher-menu-item.h \
50 seen-db.c \
51 seen-db.h \
52 dirs.h \
53 dbus-data.h \53 dbus-data.h \
54 \54 gactionmuxer.c \
55 status-items.c \55 gactionmuxer.h \
56 status-items.h56 gsettingsstrv.c \
57 gsettingsstrv.h \
58 gmenuutils.c \
59 gmenuutils.h
5760
58indicator_messages_service_CFLAGS = \61indicator_messages_service_CFLAGS = \
59 $(APPLET_CFLAGS) \62 $(APPLET_CFLAGS) \
63 $(COVERAGE_CFLAGS) \
60 -Wall \64 -Wall \
61 -Wl,-Bsymbolic-functions \65 -Wl,-Bsymbolic-functions \
62 -Wl,-z,defs \66 -Wl,-z,defs \
63 -Wl,--as-needed \67 -Wl,--as-needed \
64 -Werror \68 -Werror \
65 -DG_LOG_DOMAIN=\"Indicator-Messages\" \69 -DG_LOG_DOMAIN=\"Indicator-Messages\"
66 -DSTATUS_PROVIDER_DIR=\"$(STATUS_PROVIDER_DIR)\"
6770
68indicator_messages_service_LDADD = \71indicator_messages_service_LDADD = \
69 $(APPLET_LIBS) \72 $(APPLET_LIBS)
70 libindicator-messages-status-provider.la73
7174indicator_messages_service_LDFLAGS = \
72gen-%.xml.h: %.xml75 $(COVERAGE_LDFLAGS)
73 @echo "Building $@ from $<"76
74 @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@77indicator-messages-service.c: $(top_srcdir)/src/messages-service.xml
7578 $(AM_V_GEN) gdbus-codegen \
76gen-%.xml.c: %.xml79 --interface-prefix com.canonical.indicator.messages. \
77 @echo "Building $@ from $<"80 --generate-c-code indicator-messages-service \
78 echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@81 --c-namespace IndicatorMessages \
79 @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@82 $^
80 @echo ";" >> $@83indicator-messages-service.h: indicator-messages-service.c
8184
82BUILT_SOURCES += \85BUILT_SOURCES += \
83 gen-messages-service.xml.h \86 indicator-messages-service.c \
84 gen-messages-service.xml.c87 indicator-messages-service.h
8588
86EXTRA_DIST += \89EXTRA_DIST += \
87 messages-service.xml90 messages-service.xml
8891
89######################################
90# Status Provider Library
91######################################
92
93STATUS_PROVIDER_API_VERSION = 1
94STATUS_PROVIDER_DIR = $(libexecdir)/status-providers/$(STATUS_PROVIDER_API_VERSION)
95statusprovidersdir = $(STATUS_PROVIDER_DIR)
96statusproviders_LTLIBRARIES =
97
98EXTRA_DIST += \
99 indicator-messages-status-provider-0.5.pc.in.in
100CLEANFILES += \
101 indicator-messages-status-provider-0.5.pc
102
103pkgconfig_DATA = indicator-messages-status-provider-0.5.pc
104pkgconfigdir = $(libdir)/pkgconfig
105
106%.pc: %.pc.in
107 sed \
108 -e "s|\@status_provider_dir\@|$(STATUS_PROVIDER_DIR)|" \
109 -e "s|\@status_provider_api_version\@|$(STATUS_PROVIDER_API_VERSION)|" \
110 $< > $@
111
112lib_LTLIBRARIES = \
113 libindicator-messages-status-provider.la
114
115libindicator_messages_status_provider_la_HEADERS = \
116 status-provider.h
117
118libindicator_messages_status_provider_la_SOURCES = \
119 $(libindicator_messages_status_provider_HEADERS) \
120 status-provider.c
121
122libindicator_messages_status_provider_ladir = \
123 $(includedir)/libindicator-messages-status-provider-$(STATUS_PROVIDER_API_VERSION)/
124
125libindicator_messages_status_provider_la_LDFLAGS = \
126 -version-info $(STATUS_PROVIDER_API_VERSION):0:0 \
127 -no-undefined \
128 -export-symbols-regex "^[^_].*"
129
130libindicator_messages_status_provider_la_LIBADD = \
131 $(APPLET_LIBS)
132
133libindicator_messages_status_provider_la_CFLAGS = \
134 $(APPLET_CFLAGS) \
135 -Wall -Werror
136
137######################################
138# Status provider: Pidgin
139######################################
140
141statusproviders_LTLIBRARIES += libpidgin.la
142libpidgin_la_SOURCES = \
143 status-provider-pidgin.h \
144 status-provider-pidgin.c \
145 status-provider-pidgin-marshal.h \
146 status-provider-pidgin-marshal.c
147libpidgin_la_CFLAGS = \
148 $(APPLET_CFLAGS) \
149 $(STATUS_PROVIDER_PIDGIN_CFLAGS) \
150 -Wall -Werror \
151 -DG_LOG_DOMAIN=\"Status-Provider-Pidgin\"
152libpidgin_la_LIBADD = \
153 libindicator-messages-status-provider.la \
154 $(APPLET_LIBS) \
155 $(STATUS_PROVIDER_PIDGIN_LIBS)
156libpidgin_la_LDFLAGS = -module -avoid-version
157
158status-provider-pidgin-marshal.h: $(srcdir)/status-provider-pidgin.list
159 glib-genmarshal --header \
160 --prefix=_status_provider_pidgin_marshal $(srcdir)/status-provider-pidgin.list \
161 > status-provider-pidgin-marshal.h
162
163status-provider-pidgin-marshal.c: $(srcdir)/status-provider-pidgin.list
164 glib-genmarshal --body \
165 --prefix=_status_provider_pidgin_marshal $(srcdir)/status-provider-pidgin.list \
166 > status-provider-pidgin-marshal.c
167
168BUILT_SOURCES += \
169 status-provider-pidgin-marshal.h \
170 status-provider-pidgin-marshal.c
171
172EXTRA_DIST += \
173 status-provider-pidgin.list
174
175######################################
176# Status provider: Mission Control 4
177######################################
178
179statusproviders_LTLIBRARIES += libtelepathy.la
180libtelepathy_la_SOURCES = \
181 status-provider-telepathy.h \
182 status-provider-telepathy.c \
183 status-provider-telepathy-marshal.h \
184 status-provider-telepathy-marshal.c
185libtelepathy_la_CFLAGS = \
186 $(APPLET_CFLAGS) \
187 $(STATUS_PROVIDER_TELEPATHY_CFLAGS) \
188 -Wall -Werror \
189 -DG_LOG_DOMAIN=\"Status-Provider-Telepathy\"
190libtelepathy_la_LIBADD = \
191 libindicator-messages-status-provider.la \
192 $(APPLET_LIBS) \
193 $(STATUS_PROVIDER_TELEPATHY_LIBS)
194libtelepathy_la_LDFLAGS = -module -avoid-version
195
196status-provider-telepathy-marshal.h: $(srcdir)/status-provider-telepathy.list
197 glib-genmarshal --header \
198 --prefix=_status_provider_telepathy_marshal $(srcdir)/status-provider-telepathy.list \
199 > status-provider-telepathy-marshal.h
200
201status-provider-telepathy-marshal.c: $(srcdir)/status-provider-telepathy.list
202 glib-genmarshal --body \
203 --prefix=_status_provider_telepathy_marshal $(srcdir)/status-provider-telepathy.list \
204 > status-provider-telepathy-marshal.c
205
206BUILT_SOURCES += \
207 status-provider-telepathy-marshal.h \
208 status-provider-telepathy-marshal.c
209
210EXTRA_DIST += \
211 status-provider-telepathy.list
212
213######################################
214# Status provider: Mission Control 5
215######################################
216
217statusproviders_LTLIBRARIES += libmc5.la
218libmc5_la_SOURCES = \
219 status-provider-mc5.h \
220 status-provider-mc5.c \
221 status-provider-mc5-marshal.h \
222 status-provider-mc5-marshal.c
223libmc5_la_CFLAGS = \
224 $(APPLET_CFLAGS) \
225 $(STATUS_PROVIDER_MC5_CFLAGS) \
226 -Wall -Werror \
227 -DG_LOG_DOMAIN=\"Status-Provider-MC5\"
228libmc5_la_LIBADD = \
229 libindicator-messages-status-provider.la \
230 $(APPLET_LIBS) \
231 $(STATUS_PROVIDER_MC5_LIBS)
232libmc5_la_LDFLAGS = -module -avoid-version
233
234status-provider-mc5-marshal.h: $(srcdir)/status-provider-mc5.list
235 glib-genmarshal --header \
236 --prefix=_status_provider_mc5_marshal $(srcdir)/status-provider-mc5.list \
237 > status-provider-mc5-marshal.h
238
239status-provider-mc5-marshal.c: $(srcdir)/status-provider-mc5.list
240 glib-genmarshal --body \
241 --prefix=_status_provider_mc5_marshal $(srcdir)/status-provider-mc5.list \
242 > status-provider-mc5-marshal.c
243
244BUILT_SOURCES += \
245 status-provider-mc5-marshal.h \
246 status-provider-mc5-marshal.c
247
248EXTRA_DIST += \
249 status-provider-mc5.list
250
251######################################
252# Status provider: Emesene
253######################################
254
255statusproviders_LTLIBRARIES += libemesene.la
256libemesene_la_SOURCES = \
257 status-provider-emesene.h \
258 status-provider-emesene.c
259libemesene_la_CFLAGS = \
260 $(APPLET_CFLAGS) \
261 $(STATUS_PROVIDER_EMESENE_CFLAGS) \
262 -Wall -Werror \
263 -DG_LOG_DOMAIN=\"Status-Provider-Emesene\"
264libemesene_la_LIBADD = \
265 libindicator-messages-status-provider.la \
266 $(APPLET_LIBS) \
267 $(STATUS_PROVIDER_EMESENE_LIBS)
268libemesene_la_LDFLAGS = -module -avoid-version
269
270######################################
271# Extras
272######################################
273
274CLEANFILES += \92CLEANFILES += \
275 $(BUILT_SOURCES)93 $(BUILT_SOURCES)
27694
27795
=== renamed file 'src/app-menu-item.c' => 'src/app-section.c'
--- src/app-menu-item.c 2011-04-06 16:24:05 +0000
+++ src/app-section.c 2013-06-07 21:39:23 +0000
@@ -2,9 +2,10 @@
2An indicator to show information that is in messaging applications2An indicator to show information that is in messaging applications
3that the user is using.3that the user is using.
44
5Copyright 2009 Canonical Ltd.5Copyright 2012 Canonical Ltd.
66
7Authors:7Authors:
8 Lars Uebernickel <lars.uebernickel@canonical.com>
8 Ted Gould <ted@canonical.com>9 Ted Gould <ted@canonical.com>
910
10This program is free software: you can redistribute it and/or modify it 11This program is free software: you can redistribute it and/or modify it
@@ -26,554 +27,790 @@
2627
27#include <glib/gi18n.h>28#include <glib/gi18n.h>
28#include <gio/gdesktopappinfo.h>29#include <gio/gdesktopappinfo.h>
29#include <libdbusmenu-glib/client.h>30#include <gio/gio.h>
30#include <libdbusmenu-glib/menuitem-proxy.h>31#include <libindicator/indicator-desktop-shortcuts.h>
31#include "app-menu-item.h"32#include "app-section.h"
32#include "dbus-data.h"33#include "dbus-data.h"
33#include "default-applications.h"34#include "gmenuutils.h"
34#include "seen-db.h"35#include "gactionmuxer.h"
36
37struct _AppSectionPrivate
38{
39 GDesktopAppInfo * appinfo;
40 GFileMonitor *desktop_file_monitor;
41
42 IndicatorDesktopShortcuts * ids;
43
44 GMenu *menu;
45 GMenuModel *source_menu;
46
47 GSimpleActionGroup *static_shortcuts;
48 GActionGroup *source_actions;
49 GActionMuxer *muxer;
50
51 gboolean draws_attention;
52 gboolean uses_chat_status;
53 gchar *chat_status;
54
55 guint name_watch_id;
56};
3557
36enum {58enum {
37 COUNT_CHANGED,59 PROP_0,
38 NAME_CHANGED,60 PROP_APPINFO,
39 SHORTCUT_ADDED,61 PROP_ACTIONS,
40 SHORTCUT_REMOVED,62 PROP_DRAWS_ATTENTION,
41 LAST_SIGNAL63 PROP_USES_CHAT_STATUS,
42};64 PROP_CHAT_STATUS,
4365 NUM_PROPERTIES
44static guint signals[LAST_SIGNAL] = { 0 };66};
4567
46typedef struct _AppMenuItemPrivate AppMenuItemPrivate;68static GParamSpec *properties[NUM_PROPERTIES];
4769static guint destroy_signal;
48struct _AppMenuItemPrivate
49{
50 IndicateListener * listener;
51 IndicateListenerServer * server;
52
53 gchar * type;
54 GAppInfo * appinfo;
55 GKeyFile * keyfile;
56 gchar * desktop;
57 guint unreadcount;
58
59 DbusmenuClient * client;
60 DbusmenuMenuitem * root;
61 GList * shortcuts;
62};
63
64#define APP_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_MENU_ITEM_TYPE, AppMenuItemPrivate))
6570
66/* Prototypes */71/* Prototypes */
67static void app_menu_item_class_init (AppMenuItemClass *klass);72static void app_section_class_init (AppSectionClass *klass);
68static void app_menu_item_init (AppMenuItem *self);73static void app_section_init (AppSection *self);
69static void app_menu_item_dispose (GObject *object);74static void app_section_get_property (GObject *object,
70static void app_menu_item_finalize (GObject *object);75 guint property_id,
71static void activate_cb (AppMenuItem * self, guint timestamp, gpointer data);76 GValue *value,
72static void count_changed (IndicateListener * listener, IndicateListenerServer * server, guint count, gpointer data);77 GParamSpec *pspec);
73static void count_cb (IndicateListener * listener, IndicateListenerServer * server, guint value, gpointer data);78static void app_section_set_property (GObject *object,
74static void menu_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * menupath, gpointer data);79 guint property_id,
75static void desktop_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * value, gpointer data);80 const GValue *value,
76static void update_label (AppMenuItem * self);81 GParamSpec *pspec);
82static void app_section_dispose (GObject *object);
83static void app_section_finalize (GObject *object);
84static void activate_cb (GSimpleAction *action,
85 GVariant *param,
86 gpointer userdata);
87static void launch_action_change_state (GSimpleAction *action,
88 GVariant *value,
89 gpointer user_data);
90static void app_section_set_app_info (AppSection *self,
91 GDesktopAppInfo *appinfo);
92static gboolean any_action_draws_attention (GActionGroup *group,
93 const gchar *ignored_action);
94static void action_added (GActionGroup *group,
95 const gchar *action_name,
96 gpointer user_data);
97static void action_state_changed (GActionGroup *group,
98 const gchar *action_name,
99 GVariant *value,
100 gpointer user_data);
101static void action_removed (GActionGroup *group,
102 const gchar *action_name,
103 gpointer user_data);
104static gboolean action_draws_attention (GVariant *state);
105static void desktop_file_changed_cb (GFileMonitor *monitor,
106 GFile *file,
107 GFile *other_file,
108 GFileMonitorEvent event,
109 gpointer user_data);
77110
78/* GObject Boilerplate */111/* GObject Boilerplate */
79G_DEFINE_TYPE (AppMenuItem, app_menu_item, DBUSMENU_TYPE_MENUITEM);112G_DEFINE_TYPE (AppSection, app_section, G_TYPE_OBJECT);
80113
81static void114static void
82app_menu_item_class_init (AppMenuItemClass *klass)115app_section_class_init (AppSectionClass *klass)
83{116{
84 GObjectClass *object_class = G_OBJECT_CLASS (klass);117 GObjectClass *object_class = G_OBJECT_CLASS (klass);
85118
86 g_type_class_add_private (klass, sizeof (AppMenuItemPrivate));119 g_type_class_add_private (klass, sizeof (AppSectionPrivate));
87120
88 object_class->dispose = app_menu_item_dispose;121 object_class->get_property = app_section_get_property;
89 object_class->finalize = app_menu_item_finalize;122 object_class->set_property = app_section_set_property;
90123 object_class->dispose = app_section_dispose;
91 signals[COUNT_CHANGED] = g_signal_new(APP_MENU_ITEM_SIGNAL_COUNT_CHANGED,124 object_class->finalize = app_section_finalize;
92 G_TYPE_FROM_CLASS(klass),125
93 G_SIGNAL_RUN_LAST,126 properties[PROP_APPINFO] = g_param_spec_object ("app-info",
94 G_STRUCT_OFFSET (AppMenuItemClass, count_changed),127 "AppInfo",
95 NULL, NULL,128 "The GAppInfo for the app that this menu represents",
96 g_cclosure_marshal_VOID__UINT,129 G_TYPE_APP_INFO,
97 G_TYPE_NONE, 1, G_TYPE_UINT);130 G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
98 signals[NAME_CHANGED] = g_signal_new(APP_MENU_ITEM_SIGNAL_NAME_CHANGED,131
99 G_TYPE_FROM_CLASS(klass),132 properties[PROP_ACTIONS] = g_param_spec_object ("actions",
100 G_SIGNAL_RUN_LAST,133 "Actions",
101 G_STRUCT_OFFSET (AppMenuItemClass, name_changed),134 "The actions exported by this application",
102 NULL, NULL,135 G_TYPE_ACTION_GROUP,
103 g_cclosure_marshal_VOID__STRING,136 G_PARAM_READABLE);
104 G_TYPE_NONE, 1, G_TYPE_STRING);137
105 signals[SHORTCUT_ADDED] = g_signal_new(APP_MENU_ITEM_SIGNAL_SHORTCUT_ADDED,138 properties[PROP_DRAWS_ATTENTION] = g_param_spec_boolean ("draws-attention",
106 G_TYPE_FROM_CLASS(klass),139 "Draws attention",
107 G_SIGNAL_RUN_LAST,140 "Whether the section currently draws attention",
108 G_STRUCT_OFFSET (AppMenuItemClass, shortcut_added),141 FALSE,
109 NULL, NULL,142 G_PARAM_READABLE);
110 g_cclosure_marshal_VOID__OBJECT,143
111 G_TYPE_NONE, 1, G_TYPE_OBJECT);144 properties[PROP_USES_CHAT_STATUS] = g_param_spec_boolean ("uses-chat-status",
112 signals[SHORTCUT_REMOVED] = g_signal_new(APP_MENU_ITEM_SIGNAL_SHORTCUT_REMOVED,145 "Uses chat status",
113 G_TYPE_FROM_CLASS(klass),146 "Whether the section uses the global chat status",
114 G_SIGNAL_RUN_LAST,147 FALSE,
115 G_STRUCT_OFFSET (AppMenuItemClass, shortcut_removed),148 G_PARAM_READABLE);
116 NULL, NULL,149
117 g_cclosure_marshal_VOID__OBJECT,150 properties[PROP_CHAT_STATUS] = g_param_spec_string ("chat-status",
118 G_TYPE_NONE, 1, G_TYPE_OBJECT);151 "Chat status",
119152 "Current chat status of the application",
120 return;153 NULL,
154 G_PARAM_READWRITE |
155 G_PARAM_STATIC_STRINGS);
156
157 g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
158
159 destroy_signal = g_signal_new ("destroy",
160 APP_SECTION_TYPE,
161 G_SIGNAL_RUN_FIRST,
162 0,
163 NULL, NULL,
164 g_cclosure_marshal_VOID__VOID,
165 G_TYPE_NONE, 0);
121}166}
122167
123static void168static void
124app_menu_item_init (AppMenuItem *self)169app_section_init (AppSection *self)
125{170{
126 g_debug("Building new App Menu Item");171 AppSectionPrivate *priv;
127 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);172
128173 self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
129 priv->listener = NULL;174 APP_SECTION_TYPE,
130 priv->server = NULL;175 AppSectionPrivate);
131 priv->type = NULL;176 priv = self->priv;
177
132 priv->appinfo = NULL;178 priv->appinfo = NULL;
133 priv->keyfile = NULL;179
134 priv->desktop = NULL;180 priv->menu = g_menu_new ();
135 priv->unreadcount = 0;181 priv->static_shortcuts = g_simple_action_group_new ();
136182
137 priv->client = NULL;183 priv->muxer = g_action_muxer_new ();
138 priv->root = NULL;184 g_action_muxer_insert (priv->muxer, NULL, G_ACTION_GROUP (priv->static_shortcuts));
139 priv->shortcuts = NULL;185
140186 priv->draws_attention = FALSE;
141 dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);187
142188 return;
143 return;189}
144}190
145191static void
146/* A wrapper to make the prototypes work for GFunc */192app_section_get_property (GObject *object,
147static void193 guint property_id,
148func_unref (gpointer data, gpointer user_data)194 GValue *value,
149{195 GParamSpec *pspec)
150 g_signal_emit(user_data, signals[SHORTCUT_REMOVED], 0, data, TRUE);196{
151 g_object_unref(G_OBJECT(data));197 AppSection *self = APP_SECTION (object);
152 return;198
153}199 switch (property_id)
154200 {
155/* Disconnect the count_changed signal and unref the listener */201 case PROP_APPINFO:
156static void202 g_value_set_object (value, app_section_get_app_info (self));
157app_menu_item_dispose (GObject *object)203 break;
158{204
159 AppMenuItem * self = APP_MENU_ITEM(object);205 case PROP_DRAWS_ATTENTION:
160 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);206 g_value_set_boolean (value, app_section_get_draws_attention (self));
161207 break;
162 if (priv->listener != NULL) {208
163 g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), count_changed, self);209 case PROP_USES_CHAT_STATUS:
164 g_object_unref(priv->listener);210 g_value_set_boolean (value, app_section_get_uses_chat_status (self));
165 priv->listener = NULL;211 break;
166 }212
167213 case PROP_CHAT_STATUS:
168 if (priv->shortcuts != NULL) {214 g_value_set_string (value, app_section_get_status (self));
169 g_list_foreach(priv->shortcuts, func_unref, object);215 break;
170 g_list_free(priv->shortcuts);216
171 priv->shortcuts = NULL;217 default:
172 }218 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
173219 }
174 if (priv->root != NULL) {220}
175 g_object_unref(priv->root);221
176 priv->root = NULL;222static void
177 }223app_section_set_property (GObject *object,
178224 guint property_id,
179 if (priv->client != NULL) {225 const GValue *value,
180 g_object_unref(priv->client);226 GParamSpec *pspec)
181 priv->client = NULL;227{
182 }228 AppSection *self = APP_SECTION (object);
183229
184 if (priv->appinfo != NULL) {230 switch (property_id)
185 g_object_unref(priv->appinfo);231 {
186 priv->appinfo = NULL;232 case PROP_APPINFO:
187 }233 app_section_set_app_info (self, g_value_get_object (value));
188234 break;
189 if (priv->keyfile != NULL) {235
190 g_object_unref(priv->keyfile);236 case PROP_CHAT_STATUS:
191 priv->keyfile = NULL;237 app_section_set_status (self, g_value_get_string (value));
192 }238 break;
193239
194 G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object);240 default:
195}241 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
196242 }
197/* Free the memory used by our type, desktop file and application243}
198 info structures. */244
199static void245static void
200app_menu_item_finalize (GObject *object)246app_section_dispose (GObject *object)
201{247{
202 AppMenuItem * self = APP_MENU_ITEM(object);248 AppSection * self = APP_SECTION(object);
203 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);249 AppSectionPrivate * priv = self->priv;
204250
205 if (priv->type != NULL) {251 if (priv->desktop_file_monitor) {
206 g_free(priv->type);252 g_signal_handlers_disconnect_by_func (priv->desktop_file_monitor, desktop_file_changed_cb, self);
207 priv->type = NULL;253 g_clear_object (&priv->desktop_file_monitor);
208 }254 }
209255
210 if (priv->desktop != NULL) {256 g_clear_object (&priv->menu);
211 g_free(priv->desktop);257 g_clear_object (&priv->static_shortcuts);
212 priv->desktop = NULL;258
213 }259 if (priv->name_watch_id) {
214260 g_bus_unwatch_name (priv->name_watch_id);
215 G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (object);
216
217 return;
218}
219
220AppMenuItem *
221app_menu_item_new (IndicateListener * listener, IndicateListenerServer * server)
222{
223 AppMenuItem * self = g_object_new(APP_MENU_ITEM_TYPE, NULL);
224
225 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
226
227 /* Copy the listener so we can use it later */
228 priv->listener = listener;
229 g_object_ref(G_OBJECT(listener));
230
231 /* Can not ref as not real GObject */
232 priv->server = server;
233
234 dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_TYPE, APPLICATION_MENUITEM_TYPE);
235
236 /* Set up listener signals */
237 g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_SERVER_COUNT_CHANGED, G_CALLBACK(count_changed), self);
238
239 /* Get the values we care about from the server */
240 indicate_listener_server_get_desktop(listener, server, desktop_cb, self);
241 indicate_listener_server_get_count(listener, server, count_cb, self);
242 indicate_listener_server_get_menu(listener, server, menu_cb, self);
243
244 g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL);
245
246 indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_DISPLAY);
247 indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_SIGNAL);
248 indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_COUNT);
249 indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_DISPLAY);
250 indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_SIGNAL);
251 indicate_listener_set_server_max_indicators(listener, server, MAX_NUMBER_OF_INDICATORS);
252
253 return self;
254}
255
256static void
257update_label (AppMenuItem * self)
258{
259 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
260 const gchar * name = get_default_name(priv->desktop);
261
262 if (name == NULL) {
263 name = app_menu_item_get_name(self);
264 }
265
266 if (priv->unreadcount > 0) {
267 /* TRANSLATORS: This is the name of the program and the number of indicators. So it
268 would read something like "Mail Client (5)" */
269 gchar * label = g_strdup_printf(_("%s (%d)"), _(name), priv->unreadcount);
270 dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_NAME, label);
271 g_free(label);
272 } else {
273 dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_NAME, _(name));
274 }
275
276 return;
277}
278
279/* Callback to the signal that the server count
280 has changed to a new value. This checks to see if
281 it's actually changed and if so signals everyone and
282 updates the label. */
283static void
284count_changed (IndicateListener * listener, IndicateListenerServer * server, guint count, gpointer data)
285{
286 g_return_if_fail(IS_APP_MENU_ITEM(data));
287 AppMenuItem * self = APP_MENU_ITEM(data);
288 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
289
290 if (priv->unreadcount != count) {
291 priv->unreadcount = count;
292 update_label(self);
293 g_signal_emit(G_OBJECT(self), signals[COUNT_CHANGED], 0, priv->unreadcount, TRUE);
294 }
295
296 return;
297}
298
299/* Callback for getting the count property off
300 of the server. */
301static void
302count_cb (IndicateListener * listener, IndicateListenerServer * server, guint value, gpointer data)
303{
304 count_changed(listener, server, value, data);
305 return;
306}
307
308/* Callback for when we ask the server for the path
309 to it's desktop file. We then turn it into an
310 app structure and start sucking data out of it.
311 Mostly the name. And the icon. */
312static void
313desktop_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * value, gpointer data)
314{
315 g_return_if_fail(IS_APP_MENU_ITEM(data));
316 AppMenuItem * self = APP_MENU_ITEM(data);
317 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
318
319 if (priv->appinfo != NULL) {
320 g_object_unref(G_OBJECT(priv->appinfo));
321 priv->appinfo = NULL;
322 }
323
324 if (priv->desktop != NULL) {
325 g_free(priv->desktop);
326 priv->desktop = NULL;
327 }
328
329 if (value == NULL || value[0] == '\0') {
330 return;
331 }
332
333 seen_db_add(value);
334
335 priv->appinfo = G_APP_INFO(g_desktop_app_info_new_from_filename(value));
336 g_return_if_fail(priv->appinfo != NULL);
337
338 priv->keyfile = g_key_file_new();
339 g_key_file_load_from_file(priv->keyfile, value, G_KEY_FILE_NONE, NULL);
340
341 priv->desktop = g_strdup(value);
342
343 dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
344 dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_RUNNING, TRUE);
345
346 update_label(self);
347
348 const gchar * def_icon = get_default_icon(priv->desktop);
349 if (def_icon == NULL) {
350 gchar * iconstr = NULL;
351
352 /* Check for the over ride key and see if we should be using that
353 icon. If we can't get it, then go back to the app info */
354 if (g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, NULL) && iconstr == NULL) {
355 GError * error = NULL;
356
357 iconstr = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, &error);
358
359 if (error != NULL) {
360 /* Can't figure out why this would happen, but sure, let's print something */
361 g_warning("Error getting '" ICON_KEY "' from desktop file: %s", error->message);
362 g_error_free(error);
363 }
364 }
365
366 /* For some reason that didn't work, let's try the app info */
367 if (iconstr == NULL) {
368 GIcon * icon = g_app_info_get_icon(priv->appinfo);
369 iconstr = g_icon_to_string(icon);
370 }
371
372 dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_ICON, iconstr);
373 g_free(iconstr);
374 } else {
375 dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_ICON, def_icon);
376 }
377
378 g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE);
379
380 return;
381}
382
383/* Relay this signal into causing a rebuild of the shortcuts
384 from those above us. */
385static void
386child_added_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint position, gpointer data)
387{
388 g_return_if_fail(IS_APP_MENU_ITEM(data));
389 AppMenuItem * self = APP_MENU_ITEM(data);
390 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
391 DbusmenuMenuitemProxy * mip = dbusmenu_menuitem_proxy_new(child);
392
393 priv->shortcuts = g_list_insert(priv->shortcuts, mip, position);
394
395 g_signal_emit(G_OBJECT(data), signals[SHORTCUT_ADDED], 0, mip, TRUE);
396 return;
397}
398
399/* Relay this signal into causing a rebuild of the shortcuts
400 from those above us. */
401static void
402child_removed_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, gpointer data)
403{
404 g_return_if_fail(IS_APP_MENU_ITEM(data));
405 AppMenuItem * self = APP_MENU_ITEM(data);
406 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
407
408 GList * pitems = priv->shortcuts;
409 while (pitems != NULL) {
410 DbusmenuMenuitemProxy * mip = DBUSMENU_MENUITEM_PROXY(pitems->data);
411
412 if (dbusmenu_menuitem_proxy_get_wrapped(mip) == child) {
413 break;
414 }
415
416 pitems = g_list_next(pitems);
417 }
418
419 if (pitems != NULL) {
420 DbusmenuMenuitemProxy * mip = DBUSMENU_MENUITEM_PROXY(pitems->data);
421 priv->shortcuts = g_list_remove(priv->shortcuts, mip);
422
423 g_signal_emit(G_OBJECT(data), signals[SHORTCUT_REMOVED], 0, mip, TRUE);
424 g_object_unref(mip);
425 }
426
427 return;
428}
429
430/* Relay this signal into causing a rebuild of the shortcuts
431 from those above us. */
432static void
433child_moved_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint newpos, guint oldpos, gpointer data)
434{
435 g_return_if_fail(IS_APP_MENU_ITEM(data));
436 AppMenuItem * self = APP_MENU_ITEM(data);
437 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
438
439 DbusmenuMenuitemProxy * mip = DBUSMENU_MENUITEM_PROXY(g_list_nth_data(priv->shortcuts, oldpos));
440
441 if (mip != NULL) {
442 if (dbusmenu_menuitem_proxy_get_wrapped(mip) != child) {
443 mip = NULL;
444 }
445 }
446
447 if (mip != NULL) {
448 priv->shortcuts = g_list_remove(priv->shortcuts, mip);
449 priv->shortcuts = g_list_insert(priv->shortcuts, mip, newpos);
450 g_signal_emit(G_OBJECT(data), signals[SHORTCUT_ADDED], 0, NULL, TRUE);
451 }
452
453 return;
454}
455
456/* We've got a new root. We need to proxy it and handle it's children
457 if that's a relevant thing to do. */
458static void
459root_changed (DbusmenuClient * client, DbusmenuMenuitem * newroot, gpointer data)
460{
461 g_debug("Root Changed");
462 AppMenuItem * self = APP_MENU_ITEM(data);
463 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
464
465 if (priv->root != NULL) {
466 if (dbusmenu_menuitem_get_children(DBUSMENU_MENUITEM(priv->root)) != NULL) {
467 g_list_foreach(priv->shortcuts, func_unref, data);
468 g_list_free(priv->shortcuts);
469 priv->shortcuts = NULL;
470 }
471 g_object_unref(priv->root);
472 priv->root = NULL;
473 }
474
475 /* We need to proxy the new root across to the old
476 world of indicator land. */
477 priv->root = newroot;
478
479 if (priv->root != NULL) {
480 g_object_ref(priv->root);
481 g_signal_connect(G_OBJECT(priv->root), DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED, G_CALLBACK(child_added_cb), self);
482 g_signal_connect(G_OBJECT(priv->root), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(child_removed_cb), self);
483 g_signal_connect(G_OBJECT(priv->root), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(child_moved_cb), self);
484
485 /* See if we have any menuitems to worry about,
486 otherwise we'll just move along. */
487 GList * children = dbusmenu_menuitem_get_children(DBUSMENU_MENUITEM(priv->root));
488 if (children != NULL) {
489 g_debug("\tProcessing %d children", g_list_length(children));
490 while (children != NULL) {
491 DbusmenuMenuitemProxy * mip = dbusmenu_menuitem_proxy_new(DBUSMENU_MENUITEM(children->data));
492 priv->shortcuts = g_list_append(priv->shortcuts, mip);
493 g_signal_emit(G_OBJECT(self), signals[SHORTCUT_ADDED], 0, mip, TRUE);
494 children = g_list_next(children);
495 }
496 }
497 }
498
499 return;
500}
501
502/* Gets the path to menuitems if there are some. Now we need to
503 make them special. */
504static void
505menu_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * menupath, gpointer data)
506{
507 g_debug("Got Menu: %s", menupath);
508 g_return_if_fail(IS_APP_MENU_ITEM(data));
509 AppMenuItem * self = APP_MENU_ITEM(data);
510 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
511
512 priv->client = dbusmenu_client_new(indicate_listener_server_get_dbusname(server), menupath);
513 g_signal_connect(G_OBJECT(priv->client), DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED, G_CALLBACK(root_changed), self);
514
515 DbusmenuMenuitem * root = dbusmenu_client_get_root(priv->client);
516 if (root != NULL) {
517 root_changed(priv->client, root, self);
518 }
519
520 return;
521}
522
523static void
524activate_cb (AppMenuItem * self, guint timestamp, gpointer data)
525{
526 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
527
528 indicate_listener_display(priv->listener, priv->server, NULL, timestamp);
529
530 return;
531}
532
533guint
534app_menu_item_get_count (AppMenuItem * appitem)
535{
536 g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), 0);
537 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
538
539 return priv->unreadcount;
540}
541
542IndicateListenerServer *
543app_menu_item_get_server (AppMenuItem * appitem) {
544 g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
545 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
546
547 return priv->server;
548}
549
550const gchar *
551app_menu_item_get_name (AppMenuItem * appitem)
552{
553 g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
554 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
555
556 if (priv->appinfo == NULL) {
557 return INDICATE_LISTENER_SERVER_DBUS_NAME(priv->server);
558 } else {
559 return g_app_info_get_name(priv->appinfo);
560 }
561}
562
563const gchar *
564app_menu_item_get_desktop (AppMenuItem * appitem)
565{
566 g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
567 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
568 return priv->desktop;
569}
570
571/* Get the dynamic items added onto the end of
572 and app entry. */
573GList *
574app_menu_item_get_items (AppMenuItem * appitem)
575{
576 g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
577 AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
578 return priv->shortcuts;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches