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
1=== added directory '.bzr-builddeb'
2=== added file '.bzr-builddeb/default.conf'
3--- .bzr-builddeb/default.conf 1970-01-01 00:00:00 +0000
4+++ .bzr-builddeb/default.conf 2013-06-07 21:39:23 +0000
5@@ -0,0 +1,2 @@
6+[BUILDDEB]
7+split = True
8
9=== modified file '.bzrignore'
10--- .bzrignore 2011-07-13 15:41:33 +0000
11+++ .bzrignore 2013-06-07 21:39:23 +0000
12@@ -1,49 +1,65 @@
13-compile
14-m4
15-po
16-src/libmessaging.la
17-src/libmessaging_la-indicator-messages.lo
18-config.guess.cdbs-orig
19-config.sub.cdbs-orig
20-debian/compat
21-debian/files
22-debian/indicator-messages
23-debian/indicator-messages.debhelper.log
24-debian/indicator-messages.postinst.debhelper
25-debian/indicator-messages.postrm.debhelper
26-debian/indicator-messages.substvars
27-debian/stamp-autotools-files
28-debian/stamp-makefile-build
29-libmessaging_la-im-menu-item.lo
30-src/libmessaging_la-app-menu-item.lo
31-data/indicator-messages.service
32-indicator-messages-service
33-indicator-messages-service-activate
34-src/messages-service-client.h
35-src/messages-service-server.h
36-po/indicator-messages.pot
37-src/libmessaging_la-app-gtk-menu-item.lo
38-src/gen-messages-service.xml.c
39-src/gen-messages-service.xml.h
40-src/libemesene.la
41-src/libemesene_la-status-provider-emesene.lo
42-src/libmc5.la
43-src/libmc5_la-status-provider-mc5-marshal.lo
44-src/libmc5_la-status-provider-mc5.lo
45-src/libmessaging_la-gen-messages-service.xml.lo
46-src/libpidgin.la
47-src/libpidgin_la-status-provider-pidgin-marshal.lo
48-src/libpidgin_la-status-provider-pidgin.lo
49-src/libtelepathy.la
50-src/libtelepathy_la-status-provider-telepathy-marshal.lo
51-src/libtelepathy_la-status-provider-telepathy.lo
52-src/status-provider-mc5-marshal.c
53-src/status-provider-mc5-marshal.h
54-src/status-provider-pidgin-marshal.c
55-src/status-provider-pidgin-marshal.h
56-src/status-provider-telepathy-marshal.c
57-src/status-provider-telepathy-marshal.h
58-src/libindicator-messages-status-provider.la
59-src/libindicator_messages_status_provider_la-status-provider.lo
60-indicator-messages-status-provider-0.5.pc
61-indicator-messages-status-provider-0.5.pc.in
62+Makefile
63+Makefile.in
64+Makefile.in.in
65+*.o
66+*.lo
67+*.la
68+*.pot
69+.deps
70+.libs
71+*.valid
72+stamp-*
73+*.gcno
74+*.gcda
75+*.stamp
76+*.gir
77+*.typelib
78+
79+/COPYING
80+/INSTALL
81+/compile
82+/libtool
83+/config.*
84+/configure
85+/aclocal.m4
86+/ltmain.sh
87+/install-sh
88+/missing
89+/autom4te.cache
90+/depcomp
91+/mkinstalldirs
92+/coverage.info
93+/coveragereport
94+/gtk-doc.make
95+/indicator-messages-*.tar.gz
96+
97+/m4/*
98+/po/POTFILES
99+/data/indicator-messages.service
100+/src/indicator-messages-service
101+/src/indicator-messages-service.c
102+/src/indicator-messages-service.h
103+
104+/libmessaging-menu/messaging-menu.pc
105+/libmessaging-menu/indicator-messages-service.c
106+/libmessaging-menu/indicator-messages-service.h
107+
108+/doc/reference/html
109+/doc/reference/xml
110+/doc/reference/messaging-menu-decl-list.txt
111+/doc/reference/messaging-menu-decl.txt
112+/doc/reference/messaging-menu-docs.sgml
113+/doc/reference/messaging-menu-docs.xml
114+/doc/reference/messaging-menu-overrides.txt
115+/doc/reference/messaging-menu-sections.txt
116+/doc/reference/messaging-menu-undeclared.txt
117+/doc/reference/messaging-menu-undocumented.txt
118+/doc/reference/messaging-menu-unused.txt
119+/doc/reference/messaging-menu.args
120+/doc/reference/messaging-menu.hierarchy
121+/doc/reference/messaging-menu.interfaces
122+/doc/reference/messaging-menu.prerequisites
123+/doc/reference/messaging-menu.signals
124+/doc/reference/messaging-menu.types
125+
126+/test/test-gactionmuxer
127
128=== modified file 'Makefile.am'
129--- Makefile.am 2010-10-08 22:13:11 +0000
130+++ Makefile.am 2013-06-07 21:39:23 +0000
131@@ -1,10 +1,27 @@
132
133 SUBDIRS = \
134 src \
135+ libmessaging-menu \
136 data \
137 po
138
139-DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall --enable-deprecations
140+if ENABLE_GTK_DOC
141+SUBDIRS += doc
142+endif
143+
144+if BUILD_TESTS
145+SUBDIRS += \
146+ test
147+
148+# build src first
149+test: src
150+
151+endif
152+
153+
154+
155+
156+DISTCHECK_CONFIGURE_FLAGS = --enable-localinstall --enable-deprecations --enable-introspection --enable-gtk-doc
157
158 dist-hook:
159 @if test -d "$(top_srcdir)/.bzr"; \
160@@ -31,3 +48,6 @@
161 else \
162 echo Failed to generate AUTHORS: not a branch >&2; \
163 fi
164+
165+
166+include $(top_srcdir)/Makefile.am.coverage
167
168=== added file 'Makefile.am.coverage'
169--- Makefile.am.coverage 1970-01-01 00:00:00 +0000
170+++ Makefile.am.coverage 2013-06-07 21:39:23 +0000
171@@ -0,0 +1,48 @@
172+
173+# Coverage targets
174+
175+.PHONY: clean-gcno clean-gcda \
176+ coverage-html generate-coverage-html clean-coverage-html \
177+ coverage-gcovr generate-coverage-gcovr clean-coverage-gcovr
178+
179+clean-local: clean-gcno clean-coverage-html clean-coverage-gcovr
180+
181+if HAVE_GCOV
182+
183+clean-gcno:
184+ @echo Removing old coverage instrumentation
185+ -find -name '*.gcno' -print | xargs -r rm
186+
187+clean-gcda:
188+ @echo Removing old coverage results
189+ -find -name '*.gcda' -print | xargs -r rm
190+
191+coverage-html: clean-gcda
192+ -$(MAKE) $(AM_MAKEFLAGS) -k check
193+ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-html
194+
195+generate-coverage-html:
196+ @echo Collecting coverage data
197+ $(LCOV) --directory $(top_builddir) --capture --output-file coverage.info --no-checksum --compat-libtool
198+ LANG=C $(GENHTML) --prefix $(top_builddir) --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info
199+
200+clean-coverage-html: clean-gcda
201+ -$(LCOV) --directory $(top_builddir) -z
202+ -rm -rf coverage.info coveragereport
203+
204+if HAVE_GCOVR
205+
206+coverage-gcovr: clean-gcda
207+ -$(MAKE) $(AM_MAKEFLAGS) -k check
208+ $(MAKE) $(AM_MAKEFLAGS) generate-coverage-gcovr
209+
210+generate-coverage-gcovr:
211+ @echo Generating coverage GCOVR report
212+ $(GCOVR) -x -r $(top_builddir) -o $(top_builddir)/coverage.xml
213+
214+clean-coverage-gcovr: clean-gcda
215+ -rm -rf $(top_builddir)/coverage.xml
216+
217+endif # HAVE_GCOVR
218+
219+endif # HAVE_GCOV
220
221=== modified file 'NEWS'
222--- NEWS 2008-12-05 03:13:41 +0000
223+++ NEWS 2013-06-07 21:39:23 +0000
224@@ -0,0 +1,42 @@
225+
226+12.10.5
227+
228+* fix crash caused by GError not being cleared (lp #1064314)
229+* fix crash when registering an app that was previously unregistered (lp #1065169)
230+* remove the icon if NULL is passed to source_set_icon (lp #1070421)
231+* call gtk-update-icon-cache (lp #1060618)
232+
233+12.10.4
234+
235+* specify fallback icons for the ones with status emblem (lp #1056595)
236+* make icon size consistent with the other indicators (lp #1055966)
237+* libmessaging-menu: fix crash when receiving a invalid desktop id (lp #1058386)
238+
239+
240+12.10.3
241+
242+* hide indicator when no application shows in the menu (lp #661059)
243+* remove apps as soon as they are uninstalled (lp #864545)
244+* make generated .gir compatible with vala (lp #104496)
245+* draw counts as lozenges (lp #1046331)
246+* show separators (lp #1048245)
247+* show chat presence in the panel (lp #859905)
248+* improve documentation
249+
250+
251+12.10.2
252+
253+* libmessaging-menu:
254+ - expand source documentation and add gtk-doc to the build system
255+ - added new API: messaging_menu_app_set_source_{label,icon}
256+ - fix bug: only one MessagingMenuApp was exported to the messaging menu
257+
258+
259+12.10.1
260+
261+* presence icons are shown again
262+* the icon is changed when a source draws attention
263+* the time in source menu items is always kep current
264+* fixed all g-ir-scanner warnings
265+* libmessaging-menu now removes sources when they are activated
266+* fixed several bugs
267
268=== modified file 'autogen.sh'
269--- autogen.sh 2009-04-05 11:03:12 +0000
270+++ autogen.sh 2013-06-07 21:39:23 +0000
271@@ -1,11 +1,5 @@
272-#!/bin/sh
273-
274-PKG_NAME="indicator-messages"
275-
276-which gnome-autogen.sh || {
277- echo "You need gnome-common from GNOME SVN"
278- exit 1
279-}
280-
281-USE_GNOME2_MACROS=1 \
282-. gnome-autogen.sh
283+#!/bin/sh -e
284+
285+gtkdocize
286+autoreconf -i -f
287+intltoolize
288
289=== modified file 'configure.ac'
290--- configure.ac 2011-09-28 15:33:24 +0000
291+++ configure.ac 2013-06-07 21:39:23 +0000
292@@ -1,10 +1,10 @@
293
294-AC_INIT(src/indicator-messages.c)
295+AC_INIT(indicator-messages, 12.10.5)
296
297-AC_PREREQ(2.53)
298+AC_PREREQ(2.62)
299
300 AM_CONFIG_HEADER(config.h)
301-AM_INIT_AUTOMAKE(indicator-messages, 0.5.0)
302+AM_INIT_AUTOMAKE([check-news])
303
304 AM_MAINTAINER_MODE
305
306@@ -31,64 +31,73 @@
307 [CFLAGS="$CFLAGS -DG_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED -DGSEAL_ENABLE -DGTK_DISABLE_SINGLE_INCLUDES"]
308 )
309
310+# the Google Test targets are cpp
311+AC_PROG_CXX
312+
313 ###########################
314 # Dependencies
315 ###########################
316
317-GTK_REQUIRED_VERSION=2.12
318-GTK3_REQUIRED_VERSION=3.0
319-GIO_UNIX_REQUIRED_VERSION=2.18
320-PANEL_REQUIRED_VERSION=2.0.0
321-INDICATE_REQUIRED_VERSION=0.4.90
322+GTK_REQUIRED_VERSION=3.5.18
323+GIO_UNIX_REQUIRED_VERSION=2.33.10
324 INDICATOR_REQUIRED_VERSION=0.3.19
325-DBUSMENUGTK_REQUIRED_VERSION=0.3.94
326-
327-AC_ARG_WITH([gtk],
328- [AS_HELP_STRING([--with-gtk],
329- [Which version of gtk to use for the indicator @<:@default=3@:>@])],
330- [],
331- [with_gtk=3])
332-
333-AS_IF([test "x$with_gtk" = x3],
334- [PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK3_REQUIRED_VERSION
335- gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
336- indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
337- indicate-0.6 >= $INDICATE_REQUIRED_VERSION
338- dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
339- ],
340- [test "x$with_gtk" = x2],
341- [PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
342- gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
343- indicator-0.4 >= $INDICATOR_REQUIRED_VERSION
344- indicate-0.6 >= $INDICATE_REQUIRED_VERSION
345- dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION)
346- ],
347- [AC_MSG_FAILURE([Value for --with-indicator-gtk was neither 2 nor 3])]
348-)
349+GLIB_REQUIRED_VERSION=2.35.4
350+INTROSPECTION_REQUIRED_VERSION=1.32.0
351+
352+PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK_REQUIRED_VERSION
353+ gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION
354+ indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION
355+ glib-2.0 >= $GLIB_REQUIRED_VERSION
356+ gmodule-2.0 >= $GLIB_REQUIRED_VERSION)
357+
358+PKG_CHECK_MODULES(GIO, gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION)
359+
360 AC_SUBST(APPLET_CFLAGS)
361 AC_SUBST(APPLET_LIBS)
362
363-###########################
364-# Status Provider Deps
365-###########################
366-
367-PKG_CHECK_MODULES(STATUS_PROVIDER_PIDGIN, dbus-glib-1)
368-AC_SUBST(STATUS_PROVIDER_PIDGIN_CFLAGS)
369-AC_SUBST(STATUS_PROVIDER_PIDGIN_LIBS)
370-
371-PKG_CHECK_MODULES(STATUS_PROVIDER_TELEPATHY, dbus-glib-1)
372-AC_SUBST(STATUS_PROVIDER_TELEPATHY_CFLAGS)
373-AC_SUBST(STATUS_PROVIDER_TELEPATHY_LIBS)
374-
375-TELEPATHYGLIB_REQUIRED_VERSION=0.9.0
376-PKG_CHECK_MODULES(STATUS_PROVIDER_MC5, dbus-glib-1
377- telepathy-glib >= $TELEPATHYGLIB_REQUIRED_VERSION)
378-AC_SUBST(STATUS_PROVIDER_MC5_CFLAGS)
379-AC_SUBST(STATUS_PROVIDER_MC5_LIBS)
380-
381-PKG_CHECK_MODULES(STATUS_PROVIDER_EMESENE, dbus-glib-1)
382-AC_SUBST(STATUS_PROVIDER_EMESENE_CFLAGS)
383-AC_SUBST(STATUS_PROVIDER_EMESENE_LIBS)
384+GLIB_GSETTINGS
385+
386+GTK_DOC_CHECK([1.18], [--flavour no-tmpl])
387+
388+GOBJECT_INTROSPECTION_CHECK([$INTROSPECTION_REQUIRED_VERSION])
389+
390+###########################
391+# gcov coverage reporting
392+###########################
393+
394+m4_include([m4/gcov.m4])
395+AC_TDD_GCOV
396+AM_CONDITIONAL([HAVE_GCOV], [test "x$ac_cv_check_gcov" = xyes])
397+AM_CONDITIONAL([HAVE_LCOV], [test "x$ac_cv_check_lcov" = xyes])
398+AM_CONDITIONAL([HAVE_GCOVR], [test "x$ac_cv_check_gcovr" = xyes])
399+AC_SUBST(COVERAGE_CFLAGS)
400+AC_SUBST(COVERAGE_CXXFLAGS)
401+AC_SUBST(COVERAGE_LDFLAGS)
402+
403+###########################
404+# Tests
405+###########################
406+
407+AC_ARG_ENABLE([tests],
408+ [AS_HELP_STRING([--disable-tests], [Disable test scripts and tools (default=auto)])],
409+ [enable_tests=${enableval}],
410+ [enable_tests=auto])
411+if test "x$enable_tests" != "xno"; then
412+ m4_include([m4/gtest.m4])
413+ CHECK_GTEST
414+ AM_PATH_PYTHON(3.0,, [:])
415+ AC_PYTHON_MODULE(dbusmock)
416+ if test "x$have_gtest" = "xyes" -a "x$HAVE_PYMOD_DBUSMOCK" = "xyes"; then
417+ enable_tests="yes"
418+ else
419+ if test "x$enable_tests" = "xyes"; then
420+ AC_MSG_ERROR([tests were requested but gtest or dbusmock are not installed.])
421+ else
422+ enable_tests="no"
423+ fi
424+ fi
425+fi
426+AM_CONDITIONAL([BUILD_TESTS],[test "x$enable_tests" = "xyes"])
427
428 ###########################
429 # Check to see if we're local
430@@ -103,16 +112,10 @@
431
432 if test "x$with_localinstall" = "xyes"; then
433 INDICATORDIR="${libdir}/indicators/2/"
434- INDICATORICONSDIR="${datadir}/libindicate/icons/"
435-elif test "x$with_gtk" = x2; then
436- INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4`
437- INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4`
438 else
439 INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator3-0.4`
440- INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator3-0.4`
441 fi
442 AC_SUBST(INDICATORDIR)
443-AC_SUBST(INDICATORICONSDIR)
444
445 ###########################
446 # DBus Service Info
447@@ -159,7 +162,6 @@
448 AC_OUTPUT([
449 Makefile
450 src/Makefile
451-src/indicator-messages-status-provider-0.5.pc.in
452 data/Makefile
453 data/icons/Makefile
454 data/icons/16x16/Makefile
455@@ -179,6 +181,12 @@
456 data/icons/scalable/status/Makefile
457 data/icons/scalable/categories/Makefile
458 po/Makefile.in
459+test/Makefile
460+libmessaging-menu/Makefile
461+libmessaging-menu/messaging-menu.pc
462+doc/Makefile
463+doc/reference/Makefile
464+doc/reference/messaging-menu-docs.xml
465 ])
466
467 ###########################
468@@ -191,4 +199,8 @@
469
470 Prefix: $prefix
471 Indicator Dir: $INDICATORDIR
472+ tests: $enable_tests
473+ gcov: $use_gcov
474+ introspecion: $enable_introspection
475+ documentation: $enable_gtk_doc
476 ])
477
478=== modified file 'data/Makefile.am'
479--- data/Makefile.am 2009-09-09 18:58:33 +0000
480+++ data/Makefile.am 2013-06-07 21:39:23 +0000
481@@ -6,6 +6,11 @@
482 %.service: %.service.in
483 sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@
484
485-EXTRA_DIST = indicator-messages.service.in
486+gsettings_SCHEMAS = com.canonical.indicator.messages.gschema.xml
487+@GSETTINGS_RULES@
488+
489+EXTRA_DIST = \
490+ $(gsettings_SCHEMAS) \
491+ indicator-messages.service.in
492
493 CLEANFILES = indicator-messages.service
494
495=== added file 'data/com.canonical.indicator.messages.gschema.xml'
496--- data/com.canonical.indicator.messages.gschema.xml 1970-01-01 00:00:00 +0000
497+++ data/com.canonical.indicator.messages.gschema.xml 2013-06-07 21:39:23 +0000
498@@ -0,0 +1,12 @@
499+<schemalist>
500+ <schema id="com.canonical.indicator.messages" path="/com/canonical/indicator/messages/" gettext-domain="indicator-messages">
501+ <key name="applications" type="as">
502+ <summary>List of applications that are shown in the messaging menu</summary>
503+ <description>
504+ Applications corresponding to the desktop file ids in this list are shown in the messaging menu.
505+ </description>
506+ <default>[]</default>
507+ </key>
508+ </schema>
509+</schemalist>
510+
511
512=== modified file 'data/icons/16x16/categories/Makefile.am'
513--- data/icons/16x16/categories/Makefile.am 2010-03-04 20:23:07 +0000
514+++ data/icons/16x16/categories/Makefile.am 2013-06-07 21:39:23 +0000
515@@ -1,5 +1,5 @@
516
517-iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/categories
518+iconsdir = $(datadir)/icons/hicolor/16x16/categories
519
520 icons_DATA = \
521 applications-email-panel.png \
522
523=== modified file 'data/icons/16x16/status/Makefile.am'
524--- data/icons/16x16/status/Makefile.am 2010-02-18 04:59:43 +0000
525+++ data/icons/16x16/status/Makefile.am 2013-06-07 21:39:23 +0000
526@@ -1,5 +1,5 @@
527
528-iconsdir = $(INDICATORICONSDIR)/hicolor/16x16/status
529+iconsdir = $(datadir)/icons/hicolor/16x16/status
530
531 icons_DATA = \
532 application-running.png \
533
534=== modified file 'data/icons/22x22/categories/Makefile.am'
535--- data/icons/22x22/categories/Makefile.am 2010-03-04 20:23:07 +0000
536+++ data/icons/22x22/categories/Makefile.am 2013-06-07 21:39:23 +0000
537@@ -1,5 +1,5 @@
538
539-iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/categories
540+iconsdir = $(datadir)/icons/hicolor/22x22/categories
541
542 icons_DATA = \
543 applications-email-panel.png
544
545=== modified file 'data/icons/22x22/status/Makefile.am'
546--- data/icons/22x22/status/Makefile.am 2009-09-25 01:28:38 +0000
547+++ data/icons/22x22/status/Makefile.am 2013-06-07 21:39:23 +0000
548@@ -1,5 +1,5 @@
549
550-iconsdir = $(INDICATORICONSDIR)/hicolor/22x22/status
551+iconsdir = $(datadir)/icons/hicolor/22x22/status
552
553 icons_DATA = \
554 indicator-messages.png \
555
556=== modified file 'data/icons/24x24/status/Makefile.am'
557--- data/icons/24x24/status/Makefile.am 2010-02-18 04:59:43 +0000
558+++ data/icons/24x24/status/Makefile.am 2013-06-07 21:39:23 +0000
559@@ -1,5 +1,5 @@
560
561-iconsdir = $(INDICATORICONSDIR)/hicolor/24x24/status
562+iconsdir = $(datadir)/icons/hicolor/24x24/status
563
564 icons_DATA = \
565 application-running.png \
566
567=== modified file 'data/icons/32x32/categories/Makefile.am'
568--- data/icons/32x32/categories/Makefile.am 2010-03-04 20:23:07 +0000
569+++ data/icons/32x32/categories/Makefile.am 2013-06-07 21:39:23 +0000
570@@ -1,5 +1,5 @@
571
572-iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/categories
573+iconsdir = $(datadir)/icons/hicolor/32x32/categories
574
575 icons_DATA = \
576 applications-email-panel.png \
577
578=== modified file 'data/icons/32x32/status/Makefile.am'
579--- data/icons/32x32/status/Makefile.am 2010-02-18 04:59:43 +0000
580+++ data/icons/32x32/status/Makefile.am 2013-06-07 21:39:23 +0000
581@@ -1,5 +1,5 @@
582
583-iconsdir = $(INDICATORICONSDIR)/hicolor/32x32/status
584+iconsdir = $(datadir)/icons/hicolor/32x32/status
585
586 icons_DATA = \
587 application-running.png \
588
589=== modified file 'data/icons/48x48/status/Makefile.am'
590--- data/icons/48x48/status/Makefile.am 2010-02-18 04:59:43 +0000
591+++ data/icons/48x48/status/Makefile.am 2013-06-07 21:39:23 +0000
592@@ -1,5 +1,5 @@
593
594-iconsdir = $(INDICATORICONSDIR)/hicolor/48x48/status
595+iconsdir = $(datadir)/icons/hicolor/48x48/status
596
597 icons_DATA = \
598 application-running.png \
599
600=== modified file 'data/icons/Makefile.am'
601--- data/icons/Makefile.am 2009-02-04 16:01:51 +0000
602+++ data/icons/Makefile.am 2013-06-07 21:39:23 +0000
603@@ -1,6 +1,6 @@
604 SUBDIRS = scalable 16x16 22x22 24x24 32x32 48x48
605
606-gtk_update_icon_cache = gtk-update-icon-cache -f -t $(pkgdatadir)/icons/hicolor
607+gtk_update_icon_cache = gtk-update-icon-cache -f -t $(datadir)/icons/hicolor
608
609 install-data-hook: update-icon-cache
610 uninstall-hook: update-icon-cache
611
612=== modified file 'data/icons/scalable/categories/Makefile.am'
613--- data/icons/scalable/categories/Makefile.am 2010-03-04 20:23:07 +0000
614+++ data/icons/scalable/categories/Makefile.am 2013-06-07 21:39:23 +0000
615@@ -1,5 +1,5 @@
616
617-iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/categories
618+iconsdir = $(datadir)/icons/hicolor/scalable/categories
619
620 icons_DATA = \
621 applications-email-panel.svg \
622
623=== modified file 'data/icons/scalable/status/Makefile.am'
624--- data/icons/scalable/status/Makefile.am 2010-02-18 04:59:43 +0000
625+++ data/icons/scalable/status/Makefile.am 2013-06-07 21:39:23 +0000
626@@ -1,5 +1,5 @@
627
628-iconsdir = $(INDICATORICONSDIR)/hicolor/scalable/status
629+iconsdir = $(datadir)/icons/hicolor/scalable/status
630
631 icons_DATA = \
632 application-running.svg \
633
634=== added directory 'debian'
635=== added file 'debian/changelog'
636--- debian/changelog 1970-01-01 00:00:00 +0000
637+++ debian/changelog 2013-06-07 21:39:23 +0000
638@@ -0,0 +1,856 @@
639+indicator-messages (12.10.6daily13.01.25-0ubuntu1) raring; urgency=low
640+
641+ [ Charles Kerr ]
642+ * indicators call deprecated glib function g_type_init() (LP:
643+ #1103087)
644+
645+ [ Automatic PS uploader ]
646+ * Automatic snapshot from revision 335
647+
648+ -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Fri, 25 Jan 2013 02:01:11 +0000
649+
650+indicator-messages (12.10.6daily12.11.22-0ubuntu1) raring; urgency=low
651+
652+ [ Lars Uebernickel ]
653+ * Crash in g_variant_valist_get_leaf when highlighted (LP: #1081754)
654+
655+ [ Automatic PS uploader ]
656+ * Automatic snapshot from revision 333
657+
658+ -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Thu, 22 Nov 2012 10:02:35 +0000
659+
660+indicator-messages (12.10.6daily12.11.21.1-0ubuntu1) raring; urgency=low
661+
662+ [ Mathieu Trudel-Lapierre ]
663+ * debian/rules:
664+ - Use autogen.sh for dh_autoreconf.
665+ - Drop the override for dh_makeshlibs.
666+ - Add DPKG_GENSYMBOLS_CHECK_LEVEL=4.
667+ * debian/control:
668+ - Fix styling: add trailing commas at the end of lists.
669+ - Update Vcs-Bzr, Vcs-Browser fields and add a notice for developers.
670+ - Add libgtest-dev to Build-Depends.
671+ * Automatic snapshot from revision 329 (bootstrap):
672+ - Clear the detail (count or time) of a source when another type of detail
673+ is set. (LP: #1071640)
674+
675+ [ Automatic PS uploader ]
676+ * Automatic snapshot from revision 331
677+
678+ -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Wed, 21 Nov 2012 10:41:37 +0000
679+
680+indicator-messages (12.10.5-0ubuntu2) raring; urgency=low
681+
682+ * Upload to raring
683+
684+ -- Sebastien Bacher <seb128@ubuntu.com> Wed, 07 Nov 2012 15:16:08 +0100
685+
686+indicator-messages (12.10.5-0ubuntu1) quantal-proposed; urgency=low
687+
688+ * New upstream release:
689+ - fix crash caused by GError not being cleared (lp #1064314)
690+ - fix crash when registering an app that was previously unregistered
691+ (lp #1065169)
692+ - remove the icon if NULL is passed to source_set_icon (lp #1070421)
693+
694+ -- Sebastien Bacher <seb128@ubuntu.com> Wed, 24 Oct 2012 17:30:45 +0200
695+
696+indicator-messages (12.10.4-0ubuntu1) quantal; urgency=low
697+
698+ * New upstream release:
699+ - don't segfault if .desktop file is not installed (lp: #1058386)
700+ - Use fallback icon names (without status emblems).
701+ (lp: #1056595)
702+
703+ -- Sebastien Bacher <seb128@ubuntu.com> Tue, 02 Oct 2012 23:20:19 +0200
704+
705+indicator-messages (12.10.2-0ubuntu1) quantal; urgency=low
706+
707+ * New upstream release, includes apis to allow changing the label and
708+ the icon of sources and add documentation
709+ * debian/libmessaging-menu0.symbols:
710+ - new version update
711+ * debian/libmessaging-menu-dev.install:
712+ - install the documentation
713+ * debian/rules:
714+ - build the documentation
715+ - updated shlibs version
716+ - use --with gir so gir:Depends work as it should
717+ (lp: #1044125)
718+
719+ -- Sebastien Bacher <seb128@ubuntu.com> Sat, 01 Sep 2012 12:36:35 +0200
720+
721+indicator-messages (12.10.1-0ubuntu1) quantal-proposed; urgency=low
722+
723+ * New upstream version
724+ * debian/control:
725+ - breaks on version of ported clients using libindicate
726+ - set some conflicts on the old deprecated status provider binaries
727+ - updated Build-Depends
728+ * debian/control, debian/*.install:
729+ - drop indicator-status-provider-*, those are deprecated
730+ - new binaries for the libmessaging-menu library
731+ * debian/libmessaging-menu0.symbols:
732+ - symbol file for the new library
733+ * Updated packaging to dh9, current standards
734+ * Drop gtk2 build from the packaging since support for it was
735+ dropped in trunk, thanks Lars Uebernickel
736+
737+ -- Sebastien Bacher <seb128@ubuntu.com> Mon, 27 Aug 2012 18:56:59 +0200
738+
739+indicator-messages (0.6.0-0ubuntu1) precise; urgency=low
740+
741+ * New upstream release.
742+ * Handle blank icons properly (LP: #956147)
743+ * Fix telepathy offline/disconnected state bug
744+
745+ -- Charles Kerr <charles.kerr@canonical.com> Wed, 11 Apr 2012 11:09:46 -0500
746+
747+indicator-messages (0.5.95-0ubuntu1) precise; urgency=low
748+
749+ [ Charles Kerr ]
750+ * New upstream release.
751+ * Fix 0.5.94 blacklist regression.
752+
753+ [ Ken VanDine ]
754+ * src/indicator-messages.c
755+ * revert fix for the broken images in indicator-messages-service, it
756+ caused the service to build against gtk and we can't parallel install
757+ the service anyway
758+
759+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 05 Apr 2012 16:47:19 -0400
760+
761+indicator-messages (0.5.94-0ubuntu1) precise; urgency=low
762+
763+ [ Ted Gould ]
764+ * New upstream release.
765+ * Fix for missing icons in the messaging menu (LP: #960553)
766+ * Fix i18n for description (LP: #957525)
767+ * Implementing initial testing
768+ * Fixing blacklists (LP: #939258)
769+ * debian/control: Adding dep on libgtest-dev
770+
771+ [ Ken VanDine ]
772+ * debian/control: Don't build depend on libgtest-dev, it isn't in main
773+ * debian/rules: disable tests, they require libgtest-dev
774+
775+ -- Ken VanDine <ken.vandine@canonical.com> Wed, 21 Mar 2012 17:00:10 -0400
776+
777+indicator-messages (0.5.93-0ubuntu2) precise; urgency=low
778+
779+ * src/im-menu-item.c
780+ - cherry picked fix for missing icons in the messaging menu (LP: #960553)
781+
782+ -- Ken VanDine <ken.vandine@canonical.com> Tue, 20 Mar 2012 16:41:13 -0400
783+
784+indicator-messages (0.5.93-0ubuntu1) precise; urgency=low
785+
786+ * debian/control:
787+ - drop build-depends on gnome-doc-utils and scrollkeeper, not required
788+
789+ [ Ted Gould ]
790+ * New upstream release.
791+ * Fixing alignment of menu items (LP: #939953)
792+ * Vertically centering alignment of double high items (LP: #770486)
793+ * Fixing setting of status on telepathy (LP: #943757)
794+
795+ -- Sebastien Bacher <seb128@ubuntu.com> Thu, 08 Mar 2012 22:11:24 +0100
796+
797+indicator-messages (0.5.92-0ubuntu1) precise; urgency=low
798+
799+ [ Ted Gould ]
800+ * New upstream release.
801+ * Fix goto handling (by removing) (LP: #937441, LP: #937438)
802+ * Tell accountsservice when user has messages for the benefit of
803+ LightDM.
804+ * Dropping debian/patches: Merged upstream
805+
806+ [ Ken VanDine ]
807+ * debian/source/format
808+ - dropped "3.0 (quilt), it doesn't play well with bzr maintained packages
809+
810+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 23 Feb 2012 02:48:09 -0500
811+
812+indicator-messages (0.5.91-0ubuntu3) precise; urgency=low
813+
814+ * debian/source/format:
815+ - Make "3.0 (quilt)"
816+ * debian/patches/tell-accounts-service.patch:
817+ - Tell accountsservice when user has messages for the benefit of
818+ LightDM.
819+
820+ -- Michael Terry <mterry@ubuntu.com> Wed, 15 Feb 2012 15:32:16 -0500
821+
822+indicator-messages (0.5.91-0ubuntu2) precise; urgency=low
823+
824+ * debian/control: build-depends on dh-autoreconf as well
825+
826+ -- Sebastien Bacher <seb128@ubuntu.com> Tue, 14 Feb 2012 23:50:15 +0100
827+
828+indicator-messages (0.5.91-0ubuntu1) precise; urgency=low
829+
830+ * New upstream release.
831+ * Better lozenges that look nice
832+ * debian/rules: Adding autoreconf and running make check
833+ * debian/compat: 5
834+ * debian/source/format: Dropping
835+
836+ -- Ted Gould <ted@ubuntu.com> Tue, 14 Feb 2012 15:29:52 -0600
837+
838+indicator-messages (0.5.90-0ubuntu1) precise; urgency=low
839+
840+ [ Ted Gould ]
841+ * New upstream release.
842+ * Adding code coverage targets
843+ * Match libindicate 0.6.90
844+ * Updating for Dbusmenu 0.5.90
845+ * Plug leak in launcher_menu_item_new
846+ * Fix memory leak: Free path string.
847+ * Compare server and path for multi-server clients
848+ * Using the new GTK3 box API to avoid deprecations
849+ * Adding a name hint
850+ * debian/control: Requiring libindicate 0.6.90 and dbusmenu 0.5.90
851+
852+ [ Ken VanDine ]
853+ * debian/rules
854+ - drop no-error=deprecated-declarations from CFLAGS
855+
856+ -- Ken VanDine <ken.vandine@canonical.com> Fri, 10 Feb 2012 14:29:59 -0500
857+
858+indicator-messages (0.5.0-1ubuntu1) precise; urgency=low
859+
860+ * rebuild for libindicator7
861+ * debian/rules
862+ - build with no-error=deprecated-declarations
863+ * debian/control
864+ - set ubuntu-desktop VCS and maintainer
865+
866+ -- Ken VanDine <ken.vandine@canonical.com> Wed, 25 Jan 2012 09:56:59 -0500
867+
868+indicator-messages (0.5.0-1) experimental; urgency=low
869+
870+ * Merge new upstream from Ubuntu.
871+
872+ -- Evgeni Golov <evgeni@debian.org> Wed, 19 Oct 2011 13:36:00 +0200
873+
874+indicator-messages (0.5.0-0ubuntu1) oneiric; urgency=low
875+
876+ * New upstream release.
877+ * Fix memory leak (LP: #690668)
878+ * Drop debian/patches/lp_690668.patch: Merged upstream
879+
880+ -- Ted Gould <ted@ubuntu.com> Wed, 28 Sep 2011 10:39:26 -0500
881+
882+indicator-messages (0.4.95-0ubuntu1) oneiric; urgency=low
883+
884+ * New upstream release.
885+ * Fix naming of "Clear" item
886+ * Fix alignment of items to there is a consistent gutter
887+ * debian/patches/lp_690668.patch: Updating
888+
889+ -- Ted Gould <ted@ubuntu.com> Thu, 25 Aug 2011 09:09:20 -0500
890+
891+indicator-messages (0.4.94-0ubuntu1) oneiric; urgency=low
892+
893+ * New upstream release.
894+ ∘ Fix drawing of triangles and capsules in GTK3
895+ ∘ Fix Emesene statuses (LP: #817504)
896+
897+ -- Ted Gould <ted@ubuntu.com> Thu, 18 Aug 2011 10:57:40 -0500
898+
899+indicator-messages (0.4.93-0ubuntu2) oneiric; urgency=low
900+
901+ * debian/rules
902+ - run intltool-update to update the translations template
903+
904+ -- Ken VanDine <ken.vandine@canonical.com> Fri, 12 Aug 2011 10:05:01 -0400
905+
906+indicator-messages (0.4.93-0ubuntu1) oneiric; urgency=low
907+
908+ [ Ted Gould ]
909+ * New upstream release.
910+ * Add an item to clear the alert
911+ * Choose mail applications based on the default application
912+ * Clear based on middle click
913+
914+ [ Ken VanDine ]
915+ * debian/control
916+ - Bumped build depends for libindicate to >= 0.5.90
917+ * debian/rules
918+ - Fixed configure arg for gtk version
919+
920+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 11 Aug 2011 14:18:05 -0400
921+
922+indicator-messages (0.4.92-0ubuntu4) oneiric; urgency=low
923+
924+ * debian/control
925+ - Dropped recommends for gwibber now that it is seeded
926+ * cherry picked r220 from trunk
927+ - Make sure to insert in the right locations
928+ * cherry picked r221 from trunk
929+ - Making mail applications based on the default mail client not a
930+ hardcoded desktop file.
931+
932+ -- Ken VanDine <ken.vandine@canonical.com> Fri, 05 Aug 2011 14:33:39 -0400
933+
934+indicator-messages (0.4.92-0ubuntu3) oneiric; urgency=low
935+
936+ * debian/control
937+ - Added recommends for gwibber, it got missed when we dropped indicator-me
938+ should get removed after we get it seeded properly
939+
940+ -- Ken VanDine <ken.vandine@canonical.com> Sun, 31 Jul 2011 16:36:09 -0400
941+
942+indicator-messages (0.4.92-0ubuntu2) oneiric; urgency=low
943+
944+ * debian/control:
945+ - use conflicts against indicator-me
946+
947+ -- Michael Vogt <michael.vogt@ubuntu.com> Fri, 29 Jul 2011 15:49:40 +0200
948+
949+indicator-messages (0.4.92-0ubuntu1) oneiric; urgency=low
950+
951+ * New upstream release.
952+ * debian/control
953+ - Added Replaces indicator-me
954+ - Added build depends for libtelepathy-glib-dev
955+ - Added new binary packages, libindicator-messages-status-provider-dev,
956+ libindicator-messages-status-provider1, and each provider
957+ - Make indicator-messages recommend indicator-status-provider-mc5
958+ * debian/libindicator-messages-status-provider1.symbols
959+ - Added symbols file
960+
961+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 14 Jul 2011 16:28:23 -0400
962+
963+indicator-messages (0.4.91-0ubuntu1) oneiric; urgency=low
964+
965+ [ Ted Gould ]
966+ * New upstream release.
967+ * Update for libindicator 0.4
968+
969+ [ Ken VanDine ]
970+ * debian/control
971+ - Bumped build depends for libindicator to >= 0.3.90
972+
973+ -- Ken VanDine <ken.vandine@canonical.com> Fri, 08 Jul 2011 11:23:58 -0400
974+
975+indicator-messages (0.4.90-0ubuntu2) oneiric; urgency=low
976+
977+ * Rebuild for libdbusmenu-gtk3-4
978+ * debian/control
979+ - Removed duplicate build depends
980+ - Dropped build depends on indicator-messages-gtk2
981+
982+ -- Ken VanDine <ken.vandine@canonical.com> Tue, 28 Jun 2011 09:01:12 -0400
983+
984+indicator-messages (0.4.90-0ubuntu1) oneiric; urgency=low
985+
986+ [ Ted Gould ]
987+ * New upstream release.
988+ * GTK 3
989+
990+ [ Ken VanDine ]
991+ * debian/control
992+ - Bumped standards version to 3.9.2
993+ - Add new binary for indicator-messages-gtk2
994+ - Make indicator-messages recommend indicator-messages-gtk2 (until unity
995+ can load gtk3 indicators)
996+ - indicator-messages-gtk2 replaces indicator-messages << 0.4.90
997+ - Added build depends for libdbusmenu-gtk3-dev and libindicator3-dev
998+ * debian/rules
999+ - build for both gtk2 and gtk3
1000+
1001+ -- Ken VanDine <ken.vandine@canonical.com> Wed, 22 Jun 2011 12:34:43 -0400
1002+
1003+indicator-messages (0.4.0-1) unstable; urgency=low
1004+
1005+ * Merge new upstream from Ubuntu.
1006+ * Standards-Version: 3.9.2
1007+
1008+ -- Evgeni Golov <evgeni@debian.org> Sun, 05 Jun 2011 13:16:03 +0200
1009+
1010+indicator-messages (0.4.0-0ubuntu1) natty; urgency=low
1011+
1012+ * New upstream release.
1013+ ∘ Set the type before other variables to get default handling more
1014+ reliable (LP: #723873)
1015+ ∘ Add support for overriding the default icon with a specific one
1016+ for the messaging menu (LP: #741068)
1017+
1018+ -- Ted Gould <ted@ubuntu.com> Thu, 07 Apr 2011 12:35:36 -0500
1019+
1020+indicator-messages (0.3.92-1) unstable; urgency=low
1021+
1022+ * Merge new upstream from Ubuntu.
1023+ * Fix 0.3.11-0ubuntu3 changelog entry (missed a space), so that
1024+ bzr builddeb won't go crazy (see Debian Bug #620242)
1025+ * Fix debian/copyright, was refering to libdbusmenu by mistake.
1026+
1027+ -- Evgeni Golov <evgeni@debian.org> Sun, 03 Apr 2011 13:37:33 +0200
1028+
1029+indicator-messages (0.3.92-0ubuntu3) natty; urgency=low
1030+
1031+ * debian/patches/lp_690668.patch
1032+ - Memory leak fixes (LP: #690668)
1033+ * debian/control
1034+ - Bump standards version to 3.9.1
1035+ * debian/source/format
1036+ - Use source format 3.0 (quilt)
1037+
1038+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 24 Feb 2011 12:13:33 -0500
1039+
1040+indicator-messages (0.3.92-0ubuntu2) natty; urgency=low
1041+
1042+ * src/launcher-menu-item.c
1043+ - Make sure menu entries are displayed for launchers that aren't running (LP: #723873)
1044+
1045+ -- Ken VanDine <ken.vandine@canonical.com> Wed, 23 Feb 2011 16:06:37 -0500
1046+
1047+indicator-messages (0.3.92-0ubuntu1) natty; urgency=low
1048+
1049+ * New upstream release.
1050+ * Adding in accessible description support
1051+ * debian/control: libindicator version 0.3.19
1052+
1053+ -- Ted Gould <ted@ubuntu.com> Thu, 17 Feb 2011 12:18:32 -0600
1054+
1055+indicator-messages (0.3.91-0ubuntu1) natty; urgency=low
1056+
1057+ * New upstream release.
1058+ * Fixing the service file
1059+ * Adding a log domain
1060+ * Fixing type handler for dbusmenu 0.3.94
1061+ * debian/control: dbusmenu to 0.3.94
1062+
1063+ -- Ted Gould <ted@ubuntu.com> Thu, 27 Jan 2011 17:01:34 -0600
1064+
1065+indicator-messages (0.3.90-0ubuntu1) natty; urgency=low
1066+
1067+ [ Ted Gould ]
1068+ * New upstream release.
1069+ * GDBus Port
1070+ * New libindicate and dbusmenu
1071+
1072+ [ Ken VanDine ]
1073+ * debian/control
1074+ - Build depends on libindicate-dev to 0.4.91
1075+ - Build depends on dbusmenu to 0.3.91
1076+ - Set Vcs to ~ubuntu-desktop
1077+ * data/indicator-messages.service.in
1078+ - Fixed dbus interface name
1079+
1080+ -- Ken VanDine <ken.vandine@canonical.com> Fri, 14 Jan 2011 14:50:30 -0600
1081+
1082+indicator-messages (0.3.11-0ubuntu4) natty; urgency=low
1083+
1084+ * debian/control
1085+ - Bump build depends for libdbusmenu-* to >= 0.3.90
1086+
1087+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 09 Dec 2010 11:39:40 -0500
1088+
1089+indicator-messages (0.3.11-0ubuntu3) UNRELEASED; urgency=low
1090+
1091+ * debian/control: package description spelling (LP: #658096)
1092+
1093+ -- Greg Auger <gregory.auger@googlemail.com> Tue, 09 Nov 2010 18:49:38 +0000
1094+
1095+indicator-messages (0.3.11-0ubuntu2) maverick; urgency=low
1096+
1097+ * Rebuild for libindicator ABI change (LP: #637692)
1098+ * debian/control: depends on latest libindicator-dev
1099+
1100+ -- Didier Roche <didrocks@ubuntu.com> Wed, 22 Sep 2010 18:39:27 +0200
1101+
1102+indicator-messages (0.3.11-0ubuntu1) maverick; urgency=low
1103+
1104+ * New upstream release.
1105+ * Fixing triangles by passing data to callback (LP: #623453)
1106+
1107+ -- Ted Gould <ted@ubuntu.com> Thu, 09 Sep 2010 13:24:13 -0500
1108+
1109+indicator-messages (0.3.10-0ubuntu1) maverick; urgency=low
1110+
1111+ * New upstream release.
1112+ * Shifting icons into the gutter and adjusting the arrow
1113+ padding.
1114+
1115+ -- Ted Gould <ted@ubuntu.com> Thu, 26 Aug 2010 15:08:31 -0500
1116+
1117+indicator-messages (0.3.9-0ubuntu1) maverick; urgency=low
1118+
1119+ * New upstream release.
1120+ * Remove parens from counts
1121+
1122+ -- Ted Gould <ted@ubuntu.com> Thu, 12 Aug 2010 13:10:10 -0500
1123+
1124+indicator-messages (0.3.8-0ubuntu1) maverick; urgency=low
1125+
1126+ * New upstream release.
1127+ - running apps triangle indicator overlay
1128+ - message counters are now rendered with a nice rounded background
1129+
1130+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 29 Jul 2010 13:33:14 -0400
1131+
1132+indicator-messages (0.3.7-1) unstable; urgency=low
1133+
1134+ * Merge from Ubuntu.
1135+ Closes: #586132
1136+ * debian/control:
1137+ - Homepage is at LP/indicator-messages, not -applet.
1138+ - Update package description.
1139+ - Update Vcs-* fields.
1140+ - Standards-Version: 3.8.4.
1141+ * debian/copyright:
1142+ - Convert to DEP5 format.
1143+ - Add missing copyright holders of debian/.
1144+
1145+ -- Evgeni Golov <evgeni@debian.org> Thu, 17 Jun 2010 13:02:37 +0200
1146+
1147+indicator-messages (0.3.7-0ubuntu1~ppa1) lucid; urgency=low
1148+
1149+ * New upstream release.
1150+ * When loading desktop files check to see if they've
1151+ already been eclipsed by an app. (LP: #549096)
1152+ * Track better application shortcuts and ensure that they
1153+ get removed when the application is. (LP: #539167)
1154+ * Track blacklisted apps to ensure that the messaging menu
1155+ hides when there is no app. (LP: #533021)
1156+
1157+ -- Ted Gould <ted@ubuntu.com> Fri, 21 May 2010 15:02:16 -0500
1158+
1159+indicator-messages (0.3.6-0ubuntu2) lucid; urgency=low
1160+
1161+ * Upstream Merge
1162+ * When loading desktop files check to see if they've
1163+ already been eclipsed by an app. (LP: #549096)
1164+ * Track better application shortcuts and ensure that they
1165+ get removed when the application is. (LP: #539167)
1166+
1167+ -- Ted Gould <ted@ubuntu.com> Sat, 17 Apr 2010 13:10:42 -0500
1168+
1169+indicator-messages (0.3.6-0ubuntu1) lucid; urgency=low
1170+
1171+ * New upstream release.
1172+ * Fixing several bugs with regards to visibility and placement
1173+ if items and separators in the menu. (LP: #446914)
1174+ * Changing the service management over to using libindicator
1175+ services and service manager for robustness.
1176+
1177+ -- Ted Gould <ted@ubuntu.com> Thu, 01 Apr 2010 10:13:38 -0500
1178+
1179+indicator-messages (0.3.5-0ubuntu2) lucid; urgency=low
1180+
1181+ * debian/control:
1182+ - change the indicator-applet depends to a recommends to let other
1183+ desktops use other options rather than having to trigger GNOME
1184+
1185+ -- Sebastien Bacher <seb128@ubuntu.com> Tue, 30 Mar 2010 10:35:59 +0200
1186+
1187+indicator-messages (0.3.5-0ubuntu1) lucid; urgency=low
1188+
1189+ * Upstream release 0.3.5
1190+ * Show which applications are running with a small icon
1191+ next to their entry. (LP: #438526)
1192+ * Shift command items to line up with application names.
1193+ (LP: #537312)
1194+ * Track applications we've seen so that we can show "Set Up"
1195+ text if we've not seen the app before.
1196+ * Fix avatar spacing to match other menu items
1197+ * Use standard libindicator icon handling in panel
1198+ * Fix translation of non-running applications (LP: #540148)
1199+ * Handling bools for requesting attention from apps
1200+ * Changing microblogging to broadcast to match Me Menu (LP: #534952)
1201+ * debian/control:
1202+ - Updating requirement to libindicator 0.3.5
1203+ - Increasing dbusmenu-glib dep to 0.2.8
1204+
1205+ -- Ted Gould <ted@ubuntu.com> Thu, 25 Mar 2010 10:53:01 -0500
1206+
1207+indicator-messages (0.3.4-0ubuntu1~ppa1) lucid; urgency=low
1208+
1209+ * Upstream release 0.3.4
1210+ * Fix avatar spacing to match other menu items
1211+ * Use standard libindicator icon handling in panel
1212+ * Fix translation of non-running applications (LP: #540148)
1213+ * Handling bools for requesting attention from apps
1214+ * Changing microblogging to broadcast to match Me Menu (LP: #534952)
1215+ * debian/control: Updating requirement to libindicator 0.3.5
1216+
1217+ -- Ted Gould <ted@ubuntu.com> Thu, 18 Mar 2010 13:45:19 -0500
1218+
1219+indicator-messages (0.3.3-0ubuntu2) lucid; urgency=low
1220+
1221+ * src/default-applications.c
1222+ - string change for consistency (LP: #534952)
1223+
1224+ -- Ken VanDine <ken.vandine@canonical.com> Fri, 12 Mar 2010 11:44:46 -0500
1225+
1226+indicator-messages (0.3.3-0ubuntu1) lucid; urgency=low
1227+
1228+ * Upstream release 0.3.3
1229+ * Changing names of default applications to generic names
1230+ * Making icons of default applications match panel theme
1231+
1232+ -- Ted Gould <ted@ubuntu.com> Thu, 04 Mar 2010 16:02:11 -0600
1233+
1234+indicator-messages (0.3.2-0ubuntu1) lucid; urgency=low
1235+
1236+ * Upstream release 0.3.2
1237+ * Removing extra ref
1238+ * Moving locally defined variable to use the one defined in
1239+ the function to fix a NULL pointer. (lp: #518547)
1240+ * Disconnect the count changed signal property
1241+ * Adding static desktop shortcuts to application items
1242+ * Adding dynamic application menuitems
1243+ * Switching application menu items to remove descriptions
1244+ and add in application icons
1245+ * debian/control:
1246+ * libindicator build dependency to 0.3.3
1247+ * dbusmenu build dependency to 0.2.5
1248+
1249+ -- Ted Gould <ted@ubuntu.com> Thu, 18 Feb 2010 12:23:29 -0600
1250+
1251+indicator-messages (0.3.1-0ubuntu2) lucid; urgency=low
1252+
1253+ * Upstream Merge
1254+ * Removing extra ref
1255+ * Moving locally defined variable to use the one defined in
1256+ the function to fix a NULL pointer. (lp: #518547)
1257+
1258+ -- Ted Gould <ted@ubuntu.com> Tue, 09 Feb 2010 09:30:10 -0600
1259+
1260+indicator-messages (0.3.1-0ubuntu1) lucid; urgency=low
1261+
1262+ * Upstream release 0.3.1
1263+ * Updates for dbusmenu 0.2.2
1264+ * Updates for libindicate 0.3.0
1265+ * debian/control:
1266+ * dbusmenu* depends to 0.2.2
1267+ * libindicate* depends to 0.3.0
1268+
1269+ -- Ted Gould <ted@ubuntu.com> Thu, 04 Feb 2010 18:23:34 -0800
1270+
1271+indicator-messages (0.3.0-0ubuntu1) lucid; urgency=low
1272+
1273+ * Upstream release 0.3.0
1274+ - Disabling static builds.
1275+ - Porting to libindicator 0.3.0
1276+ - Adding translator comments from hours and minutes strings.
1277+ (LP: #456437)
1278+ - Upgrading to dbusmenu 0.2.0
1279+ * debian/control: Updating dbusmenu dependency to 0.2.0
1280+ * debian/control: Increasing libindicator-dev dependency to
1281+ 0.3.0
1282+
1283+ -- Ted Gould <ted@ubuntu.com> Fri, 08 Jan 2010 12:05:25 -0600
1284+
1285+indicator-messages (0.2.6+r156-0ubuntu2) lucid; urgency=low
1286+
1287+ * debian/control
1288+ - add a Breaks for indicator-applet (<< 0.3.0)
1289+
1290+ -- Ken VanDine <ken.vandine@canonical.com> Tue, 15 Dec 2009 11:57:42 -0500
1291+
1292+indicator-messages (0.2.6+r156-0ubuntu1) lucid; urgency=low
1293+
1294+ * New snapshot for libindicator 0.3.0
1295+ * debian/control
1296+ - Build-Depends on libindicator >= 0.3.0
1297+
1298+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 10 Dec 2009 14:35:46 -0500
1299+
1300+indicator-messages (0.2.6-0ubuntu1) karmic; urgency=low
1301+
1302+ * Upstream release 0.2.6 (LP: #446629)
1303+ * Building the menu after checking the blacklist so that the
1304+ separators are all correct.
1305+ * Small fix for a perspective memory leak.
1306+
1307+ -- Ted Gould <ted@ubuntu.com> Fri, 09 Oct 2009 08:14:27 +0200
1308+
1309+indicator-messages (0.2.5-0ubuntu1) karmic; urgency=low
1310+
1311+ * Upstream release 0.2.5 (LP: #440217)
1312+ * Adding a check on addition of launchers to ensure icon is correctly
1313+ visible. (LP: #433274)
1314+ * Making it so that if applications don't set the time on an indicator
1315+ the time isn't shown in the menu. (LP: #438237)
1316+ * Putting icons in the right places. (LP: #436460)
1317+
1318+ -- Ted Gould <ted@ubuntu.com> Thu, 01 Oct 2009 23:34:28 +0200
1319+
1320+indicator-messages (0.2.4-0ubuntu1) karmic; urgency=low
1321+
1322+ * Upstream release 0.2.4 (LP: #436093)
1323+ - Merging in the min menu width feature (LP: #428292)
1324+ - Merging in icon scaling branch from trunk. Now better icons (LP: #433143)
1325+ - Merging in updated trunk (LP: #434097 and LP: #435184)
1326+ - add i18n support
1327+ - Prevent null entries (LP: #435184)
1328+ - add a path for indicators in /usr/share (LP: #434097)
1329+
1330+ -- Ted Gould <ted@ubuntu.com> Thu, 24 Sep 2009 13:07:46 -0500
1331+
1332+indicator-messages (0.2.2-0ubuntu2) karmic; urgency=low
1333+
1334+ * src/messages-service.c: initialise the translations
1335+
1336+ -- Sebastien Bacher <seb128@ubuntu.com> Tue, 15 Sep 2009 16:41:03 +0200
1337+
1338+indicator-messages (0.2.2-0ubuntu1) karmic; urgency=low
1339+
1340+ * New release (LP: #427357)
1341+ * Adds in separators between application groups
1342+ * Merging in v2-api stuff which will become 0.2.1
1343+ * debian/control:
1344+ - Requiring > 0.2.0 of libindicate-*
1345+ - bump dbusmenu dependencies.
1346+
1347+ -- Ted Gould <ted@ubuntu.com> Thu, 10 Sep 2009 09:11:57 -0500
1348+
1349+indicator-messages (0.2.0-0ubuntu2) karmic; urgency=low
1350+
1351+ * debian/control
1352+ - Bump build depends on dbusmenu to 0.1.0
1353+
1354+ -- Ken VanDine <ken.vandine@canonical.com> Thu, 27 Aug 2009 21:14:46 +0200
1355+
1356+indicator-messages (0.2.0-0ubuntu1) karmic; urgency=low
1357+
1358+ [ Ted Gould ]
1359+ * Upstream version 0.2.0
1360+ * debian/control: Adding dependency information for libdbusmenu
1361+ to say >= 0.0.2 to match upstream build system.
1362+ * debian/watch: Changing to use indicator-messages project.
1363+
1364+ [ Martin Pitt ]
1365+ * debian/control: Update Vcs-Bzr: for new branch location.
1366+
1367+ -- Ted Gould <ted@ubuntu.com> Thu, 27 Aug 2009 20:46:27 +0200
1368+
1369+indicator-messages (0.2.0~bzr124-0ubuntu1) karmic; urgency=low
1370+
1371+ * Update to fix build issue
1372+
1373+ -- Sebastien Bacher <seb128@ubuntu.com> Fri, 07 Aug 2009 17:12:40 +0100
1374+
1375+indicator-messages (0.2.0~bzr121-0ubuntu3) karmic; urgency=low
1376+
1377+ * Fix to dereference the application menu items correctly so that
1378+ the signal handlers are dropped as well. (lp: #410251)
1379+
1380+ -- Ted Gould <ted@ubuntu.com> Wed, 05 Aug 2009 19:00:31 +0100
1381+
1382+indicator-messages (0.2.0~bzr121-0ubuntu2) karmic; urgency=low
1383+
1384+ * Run autogen.sh before upload
1385+
1386+ -- Jonathan Riddell <jriddell@ubuntu.com> Wed, 05 Aug 2009 00:42:39 +0100
1387+
1388+indicator-messages (0.2.0~bzr121-0ubuntu1) karmic; urgency=low
1389+
1390+ [ Ted Gould ]
1391+ * debian/control: Adding in a build dep on libindicate-gtk-dev
1392+ * Changes for the changing libindicate stuff.
1393+ * Merge in the dbusmenu changes from the dbusmenu branch
1394+ * debian/control: Adding in a build dependency on libdbusmenu-glib and
1395+ libdbusmenu-gtk to catch up with the merge.
1396+
1397+ -- Jonathan Riddell <jriddell@ubuntu.com> Wed, 05 Aug 2009 00:21:50 +0100
1398+
1399+indicator-messages (0.2.0~bzr120-0ubuntu1) jaunty; urgency=low
1400+
1401+ * Fix to track the timer. (LP: #365187)
1402+
1403+ -- Ted Gould <ted@ubuntu.com> Wed, 13 May 2009 09:56:20 -0500
1404+
1405+indicator-messages (0.2.0~bzr119-0ubuntu1) jaunty; urgency=low
1406+
1407+ * Upstream update
1408+
1409+ -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 23:34:21 -0500
1410+
1411+indicator-messages (0.2.0~bzr116-0ubuntu3) jaunty; urgency=low
1412+
1413+ * debian/rules: Adding a rule to remove the .la/.a clutter
1414+
1415+ -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 16:46:59 -0500
1416+
1417+indicator-messages (0.2.0~bzr116-0ubuntu2) jaunty; urgency=low
1418+
1419+ * debian/control: libindicator-dev to ~bzr301
1420+
1421+ -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 15:58:45 -0500
1422+
1423+indicator-messages (0.2.0~bzr116-0ubuntu1) jaunty; urgency=low
1424+
1425+ * Upstream release
1426+ * Bug fixes
1427+ * Update API to new libindicator
1428+ * debian/control: Adding new dependency on libindicator-dev
1429+
1430+ -- Ted Gould <ted@ubuntu.com> Wed, 22 Apr 2009 15:45:21 -0500
1431+
1432+indicator-messages (0.1.6-0ubuntu1) jaunty; urgency=low
1433+
1434+ * New upstream version
1435+ * Patch from Cody Russell to fix LP: #359018 by correctly implementing
1436+ the finalize functions.
1437+
1438+ -- Ted Gould <ted@ubuntu.com> Tue, 14 Apr 2009 11:32:00 +0200
1439+
1440+indicator-messages (0.1.5-0ubuntu1) jaunty; urgency=low
1441+
1442+ * New upstream version
1443+ * Fixes the lifecycle of the various structures tracking the messages
1444+ and applications. Fixing bugs like (LP: #355616) (LP: #352881)
1445+ * Fixes the visual appearance by setting the widget name to grab the
1446+ style settings from the main applet. (LP: #351979)
1447+ * debian/control: Upgrading dependency on libindicate-dev to 0.1.5 or
1448+ higher as the new version requires that.
1449+
1450+ -- Ted Gould <ted@ubuntu.com> Fri, 03 Apr 2009 16:32:49 -0500
1451+
1452+indicator-messages (0.1.4-0ubuntu1) jaunty; urgency=low
1453+
1454+ * New upstream version
1455+ * Adding the display of indicators that are login messages coming from
1456+ other applications. (LP: #345494)
1457+ * Making all times displayed for IM messages relative instead of
1458+ absolute. (LP: #346345)
1459+ * Cleaning up the server removal code. May fix (LP: #345599), I can't
1460+ recreate it anymore afterwards.
1461+
1462+ -- Ted Gould <ted@ubuntu.com> Mon, 30 Mar 2009 09:40:40 +0200
1463+
1464+indicator-messages (0.1.3-0ubuntu1) jaunty; urgency=low
1465+
1466+ [ Ted Gould ]
1467+ * New upstream version.
1468+ - Now changes the icon based on non-IM indicators so that Evolution
1469+ works much better. (LP: #342480)
1470+ - Now the menu items are in a predictable order, alphabetical.
1471+ - The Messages for a particular client (i.e. Pidgin) are grouped with
1472+ the client they're associated with.
1473+ - Adjusting the icon size to match the new one in the Human theme.
1474+ - Adjusting the build so that all the different libraries are not
1475+ built in a versioned manner. Now it's just one .so, which is
1476+ what it should have been originally.
1477+
1478+ [ Martin Pitt ]
1479+ * Add debian/watch.
1480+ * Add bzr-builddeb configuration.
1481+ * debian/copyright: Fix download location.
1482+
1483+ -- Martin Pitt <martin.pitt@ubuntu.com> Thu, 19 Mar 2009 12:23:17 +0100
1484+
1485+indicator-messages (0.1-0ubuntu1) jaunty; urgency=low
1486+
1487+ * Initial release, based on DX team's PPA packaging branch.
1488+ (lp:~indicator-applet-developers/indicator-applet/messages-packaging)
1489+ * debian/control: Add Homepage:, Vcs-Bzr:, and fix package
1490+ description.
1491+ * debian/copyright: Properly describe license.
1492+
1493+ -- Martin Pitt <martin.pitt@ubuntu.com> Tue, 17 Feb 2009 11:35:38 +0100
1494+
1495
1496=== added file 'debian/compat'
1497--- debian/compat 1970-01-01 00:00:00 +0000
1498+++ debian/compat 2013-06-07 21:39:23 +0000
1499@@ -0,0 +1,1 @@
1500+9
1501
1502=== added file 'debian/control'
1503--- debian/control 1970-01-01 00:00:00 +0000
1504+++ debian/control 2013-06-07 21:39:23 +0000
1505@@ -0,0 +1,86 @@
1506+Source: indicator-messages
1507+Section: gnome
1508+Priority: optional
1509+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
1510+XSBC-Original-Maintainer: The Ayatana Packagers <pkg-ayatana-devel@lists.alioth.debian.org>
1511+Uploaders: Evgeni Golov <evgeni@debian.org>
1512+Build-Depends: debhelper (>= 9),
1513+ dh-autoreconf,
1514+ dh-translations,
1515+ libglib2.0-dev (>= 2.35.4),
1516+ libgtk-3-dev (>= 3.5.12),
1517+ libdbus-glib-1-dev,
1518+ intltool,
1519+ libindicator3-dev,
1520+ libdbusmenu-glib-dev (>= 0.5.90),
1521+ libdbusmenu-gtk3-dev (>= 0.5.90),
1522+ libtelepathy-glib-dev (>= 0.9.0),
1523+ gobject-introspection (>= 0.9.12-4~),
1524+ libgirepository1.0-dev (>= 0.9.12),
1525+ gtk-doc-tools,
1526+ libgtest-dev,
1527+ python3-dbusmock,
1528+Standards-Version: 3.9.3
1529+Homepage: https://launchpad.net/indicator-messages
1530+# If you aren't a member of ~indicator-applet-developers but need to upload
1531+# packaging changes, just go ahead. ~indicator-applet-developers will notice
1532+# and sync up the code again.
1533+Vcs-Bzr: https://code.launchpad.net/~indicator-applet-developers/indicator-messages/trunk.13.04
1534+Vcs-Browser: https://bazaar.launchpad.net/~indicator-applet-developers/indicator-messages/trunk.13.04/files
1535+
1536+Package: indicator-messages
1537+Architecture: any
1538+Depends: ${shlibs:Depends}, ${misc:Depends}
1539+Recommends: indicator-applet | indicator-renderer
1540+Replaces: libindicator-messages-status-provider1,
1541+ libindicator-messages-status-provider-dev,
1542+ indicator-status-provider-mc5,
1543+ indicator-status-provider-pidgin,
1544+ indicator-status-provider-telepathy,
1545+ indicator-status-provider-emesene,
1546+Conflicts: libindicator-messages-status-provider1,
1547+ libindicator-messages-status-provider-dev,
1548+ indicator-status-provider-mc5,
1549+ indicator-status-provider-pidgin,
1550+ indicator-status-provider-telepathy,
1551+ indicator-status-provider-emesene,
1552+Breaks: gwibber-services (<< 3.5.4-0ubuntu1~),
1553+ telepathy-indicator (<< 0.3.0-0ubuntu1~),
1554+ thunderbird (<< 15.0+build1-0ubuntu1~),
1555+ xchat-indicator (<< 0.3.11-0ubuntu2~),
1556+ xchat-gnome-indicator (<< 0.3.11-0ubuntu2~),
1557+Description: indicator that collects messages that need a response
1558+ A place on the user's desktop that collects messages that need a response.
1559+ This menu provides a condensed and collected view of all of those messages
1560+ for quick access, but without making them annoying in times that you want
1561+ to ignore them.
1562+
1563+Package: libmessaging-menu0
1564+Architecture: any
1565+Section: libs
1566+Depends: ${shlibs:Depends},
1567+ ${misc:Depends},
1568+Description: Messaging Menu - shared library
1569+ This library contains information to build status providers to go into
1570+ the messaging menu.
1571+
1572+Package: libmessaging-menu-dev
1573+Architecture: any
1574+Section: libdevel
1575+Depends: ${shlibs:Depends},
1576+ ${misc:Depends},
1577+ libmessaging-menu0 (=${binary:Version}),
1578+ libglib2.0-dev,
1579+Description: Messaging Menu - library development files
1580+ This library contains information to build status providers to go into
1581+ the messaging menu.
1582+
1583+Package: gir1.2-messagingmenu-1.0
1584+Section: libs
1585+Architecture: any
1586+Depends: ${misc:Depends},
1587+ ${gir:Depends},
1588+Description: Messaging Menu - gir bindings
1589+ .
1590+ This package can be used by other packages using the GIRepository format
1591+ to generate dynamic bindings.
1592
1593=== added file 'debian/copyright'
1594--- debian/copyright 1970-01-01 00:00:00 +0000
1595+++ debian/copyright 2013-06-07 21:39:23 +0000
1596@@ -0,0 +1,19 @@
1597+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
1598+Name: indicator-messages
1599+Maintainer: Ted Gould <ted@canonical.com>
1600+Source: https://launchpad.net/indicator-messages
1601+
1602+Files: *
1603+Copyright: 2009-2010 Ted Gould <ted@canonical.com>, Canonical Ltd.
1604+License: GPL-3
1605+
1606+Files: debian/*
1607+Copyright: 2009-2010 Evgeni Golov <evgeni@debian.org>
1608+Copyright: 2009-2010 Ted Gould <ted@canonical.com>, Canonical Ltd.
1609+Copyright: 2009-2010 Sebastien Bacher <seb128@ubuntu.com>
1610+Copyright: 2009-2010 Ken VanDine <ken.vandine@canonical.com>
1611+License: GPL-3
1612+
1613+License: GPL-3
1614+ On Debian systems, the complete text of the GNU General
1615+ Public License version 3 can be found in `/usr/share/common-licenses/GPL-3'.
1616
1617=== added file 'debian/gir1.2-messagingmenu-1.0.install'
1618--- debian/gir1.2-messagingmenu-1.0.install 1970-01-01 00:00:00 +0000
1619+++ debian/gir1.2-messagingmenu-1.0.install 2013-06-07 21:39:23 +0000
1620@@ -0,0 +1,1 @@
1621+usr/lib/girepository-1.0/*.typelib
1622
1623=== added file 'debian/indicator-messages.install'
1624--- debian/indicator-messages.install 1970-01-01 00:00:00 +0000
1625+++ debian/indicator-messages.install 2013-06-07 21:39:23 +0000
1626@@ -0,0 +1,5 @@
1627+usr/lib/indicators3
1628+usr/lib/indicator-messages/indicator-messages-service
1629+usr/share/dbus-1
1630+usr/share/glib-2.0
1631+usr/share/icons
1632
1633=== added file 'debian/libmessaging-menu-dev.install'
1634--- debian/libmessaging-menu-dev.install 1970-01-01 00:00:00 +0000
1635+++ debian/libmessaging-menu-dev.install 2013-06-07 21:39:23 +0000
1636@@ -0,0 +1,5 @@
1637+usr/lib/libmessaging-menu.so
1638+usr/lib/pkgconfig
1639+usr/include /usr/
1640+usr/share/gir-1.0/
1641+usr/share/gtk-doc
1642
1643=== added file 'debian/libmessaging-menu0.install'
1644--- debian/libmessaging-menu0.install 1970-01-01 00:00:00 +0000
1645+++ debian/libmessaging-menu0.install 2013-06-07 21:39:23 +0000
1646@@ -0,0 +1,1 @@
1647+usr/lib/libmessaging-menu.so.* /usr/lib/
1648
1649=== added file 'debian/libmessaging-menu0.symbols'
1650--- debian/libmessaging-menu0.symbols 1970-01-01 00:00:00 +0000
1651+++ debian/libmessaging-menu0.symbols 2013-06-07 21:39:23 +0000
1652@@ -0,0 +1,23 @@
1653+libmessaging-menu.so.0 libmessaging-menu0 #MINVER#
1654+ messaging_menu_app_append_source@Base 12.10.0
1655+ messaging_menu_app_append_source_with_count@Base 12.10.0
1656+ messaging_menu_app_append_source_with_string@Base 12.10.0
1657+ messaging_menu_app_append_source_with_time@Base 12.10.0
1658+ messaging_menu_app_draw_attention@Base 12.10.0
1659+ messaging_menu_app_get_type@Base 12.10.0
1660+ messaging_menu_app_has_source@Base 12.10.0
1661+ messaging_menu_app_insert_source@Base 12.10.0
1662+ messaging_menu_app_insert_source_with_count@Base 12.10.0
1663+ messaging_menu_app_insert_source_with_string@Base 12.10.0
1664+ messaging_menu_app_insert_source_with_time@Base 12.10.0
1665+ messaging_menu_app_new@Base 12.10.0
1666+ messaging_menu_app_register@Base 12.10.0
1667+ messaging_menu_app_remove_attention@Base 12.10.0
1668+ messaging_menu_app_remove_source@Base 12.10.0
1669+ messaging_menu_app_set_source_count@Base 12.10.0
1670+ messaging_menu_app_set_source_icon@Base 12.10.2
1671+ messaging_menu_app_set_source_label@Base 12.10.2
1672+ messaging_menu_app_set_source_string@Base 12.10.0
1673+ messaging_menu_app_set_source_time@Base 12.10.0
1674+ messaging_menu_app_set_status@Base 12.10.0
1675+ messaging_menu_app_unregister@Base 12.10.0
1676
1677=== added file 'debian/rules'
1678--- debian/rules 1970-01-01 00:00:00 +0000
1679+++ debian/rules 2013-06-07 21:39:23 +0000
1680@@ -0,0 +1,17 @@
1681+#!/usr/bin/make -f
1682+
1683+export DPKG_GENSYMBOLS_CHECK_LEVEL=4
1684+
1685+%:
1686+ dh $@ --with autoreconf,translations,gir
1687+
1688+override_dh_autoreconf:
1689+ NO_CONFIGURE=1 dh_autoreconf ./autogen.sh
1690+
1691+override_dh_auto_configure:
1692+ dh_auto_configure -- --libdir="\$${prefix}/lib" --libexecdir="\$${prefix}/lib/indicator-messages" --enable-gtk-doc
1693+
1694+override_dh_install:
1695+ find debian/tmp/usr/lib -name *.la -delete
1696+ dh_install --fail-missing
1697+
1698
1699=== added file 'debian/watch'
1700--- debian/watch 1970-01-01 00:00:00 +0000
1701+++ debian/watch 2013-06-07 21:39:23 +0000
1702@@ -0,0 +1,2 @@
1703+version=3
1704+http://launchpad.net/indicator-messages/+download .*/indicator-messages-([0-9.]+)\.tar\.gz
1705
1706=== added directory 'doc'
1707=== added file 'doc/Makefile.am'
1708--- doc/Makefile.am 1970-01-01 00:00:00 +0000
1709+++ doc/Makefile.am 2013-06-07 21:39:23 +0000
1710@@ -0,0 +1,1 @@
1711+SUBDIRS = reference
1712
1713=== added directory 'doc/reference'
1714=== added file 'doc/reference/Makefile.am'
1715--- doc/reference/Makefile.am 1970-01-01 00:00:00 +0000
1716+++ doc/reference/Makefile.am 2013-06-07 21:39:23 +0000
1717@@ -0,0 +1,20 @@
1718+DOC_MODULE = messaging-menu
1719+
1720+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
1721+
1722+DOC_SOURCE_DIR = $(top_srcdir)/libmessaging-menu
1723+
1724+MKDB_OPTIONS=--xml-mode --output-format=xml
1725+
1726+# Used for dependencies. The docs will be rebuilt if any of these change.
1727+HFILE_GLOB = $(top_srcdir)/libmessaging-menu/*.h
1728+CFILE_GLOB = $(top_srcdir)/libmessaging-menu/*.c
1729+
1730+IGNORE_HFILES= \
1731+ indicator-messages-service.h \
1732+ gtupleaction.h
1733+
1734+INCLUDES=-I$(top_srcdir)/libmessaging-menu $(GIO_CFLAGS)
1735+GTKDOC_LIBS=$(top_builddir)/libmessaging-menu/libmessaging-menu.la
1736+
1737+include $(top_srcdir)/gtk-doc.make
1738
1739=== added file 'doc/reference/messaging-menu-docs.xml.in'
1740--- doc/reference/messaging-menu-docs.xml.in 1970-01-01 00:00:00 +0000
1741+++ doc/reference/messaging-menu-docs.xml.in 2013-06-07 21:39:23 +0000
1742@@ -0,0 +1,38 @@
1743+<?xml version="1.0"?>
1744+<!DOCTYPE book PUBLIC '-//OASIS//DTD DocBook XML V4.5//EN'
1745+ 'http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd' [
1746+<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
1747+<!ENTITY version "@PACKAGE_VERSION@">
1748+]>
1749+<book lang="en" id="messaging-menu" xmlns:xi="http://www.w3.org/2003/XInclude">
1750+<title>Messaging Menu Reference Manual</title>
1751+ <bookinfo>
1752+ <title>Messaging Menu Reference Manual</title>
1753+ <releaseinfo>for libmessaging-menu &version;</releaseinfo>
1754+
1755+ <copyright>
1756+ <year>2012</year>
1757+ <holder>Canonical Ltd.</holder>
1758+ </copyright>
1759+ </bookinfo>
1760+
1761+ <chapter>
1762+ <title>API Reference</title>
1763+ <xi:include href="xml/messaging-menu.xml"/>
1764+ </chapter>
1765+
1766+ <chapter id="object-tree">
1767+ <title>Object Hierarchy</title>
1768+ <xi:include href="xml/tree_index.sgml"/>
1769+ </chapter>
1770+ <index id="api-index-full">
1771+ <title>API Index</title>
1772+ <xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
1773+ </index>
1774+ <index id="deprecated-api-index" role="deprecated">
1775+ <title>Index of deprecated API</title>
1776+ <xi:include href="xml/api-index-deprecated.xml"><xi:fallback /></xi:include>
1777+ </index>
1778+
1779+ <xi:include href="xml/annotation-glossary.xml"><xi:fallback /></xi:include>
1780+</book>
1781
1782=== added directory 'libmessaging-menu'
1783=== added file 'libmessaging-menu/Makefile.am'
1784--- libmessaging-menu/Makefile.am 1970-01-01 00:00:00 +0000
1785+++ libmessaging-menu/Makefile.am 2013-06-07 21:39:23 +0000
1786@@ -0,0 +1,66 @@
1787+
1788+lib_LTLIBRARIES = libmessaging-menu.la
1789+
1790+libmessaging_menu_ladir = $(includedir)/messaging-menu
1791+
1792+libmessaging_menu_la_SOURCES = \
1793+ messaging-menu.c \
1794+ gtupleaction.c \
1795+ gtupleaction.h \
1796+ $(BUILT_SOURCES)
1797+
1798+libmessaging_menu_la_HEADERS = \
1799+ messaging-menu.h
1800+
1801+libmessaging_menu_la_LIBADD = $(GIO_LIBS)
1802+
1803+libmessaging_menu_la_CFLAGS = \
1804+ $(GIO_CFLAGS) \
1805+ -Wall
1806+
1807+libmessaging_menu_la_LDFLAGS = -export-symbols-regex "^messaging_menu_.*"
1808+
1809+BUILT_SOURCES = \
1810+ indicator-messages-service.c \
1811+ indicator-messages-service.h
1812+
1813+CLEANFILES = $(BUILT_SOURCES)
1814+
1815+indicator-messages-service.c: $(top_srcdir)/src/messages-service.xml
1816+ $(AM_V_GEN) gdbus-codegen \
1817+ --interface-prefix com.canonical.indicator.messages. \
1818+ --generate-c-code indicator-messages-service \
1819+ --c-namespace IndicatorMessages \
1820+ $^
1821+indicator-messages-service.h: indicator-messages-service.c
1822+
1823+pkgconfigdir = $(libdir)/pkgconfig
1824+pkgconfig_DATA = messaging-menu.pc
1825+
1826+
1827+-include $(INTROSPECTION_MAKEFILE)
1828+
1829+INTROSPECTION_GIRS =
1830+INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all
1831+INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)
1832+
1833+if HAVE_INTROSPECTION
1834+
1835+MessagingMenu-1.0.gir: libmessaging-menu.la
1836+MessagingMenu_1_0_gir_NAMESPACE = MessagingMenu
1837+MessagingMenu_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
1838+MessagingMenu_1_0_gir_CFLAGS = $(INCLUDES) $(GIO_CFLAGS)
1839+MessagingMenu_1_0_gir_SCANNERFLAGS = --c-include="messaging-menu.h"
1840+MessagingMenu_1_0_gir_LIBS = libmessaging-menu.la
1841+MessagingMenu_1_0_gir_FILES = messaging-menu.c messaging-menu.h
1842+MessagingMenu_1_0_gir_EXPORT_PACKAGES = messaging-menu
1843+INTROSPECTION_GIRS += MessagingMenu-1.0.gir
1844+
1845+girdir = $(datadir)/gir-1.0
1846+gir_DATA = $(INTROSPECTION_GIRS)
1847+
1848+typelibdir = $(libdir)/girepository-1.0
1849+typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
1850+
1851+CLEANFILES +=$(gir_DATA) $(typelib_DATA)
1852+endif
1853
1854=== added file 'libmessaging-menu/gtupleaction.c'
1855--- libmessaging-menu/gtupleaction.c 1970-01-01 00:00:00 +0000
1856+++ libmessaging-menu/gtupleaction.c 2013-06-07 21:39:23 +0000
1857@@ -0,0 +1,354 @@
1858+/*
1859+ * Copyright 2012 Canonical Ltd.
1860+ *
1861+ * This program is free software: you can redistribute it and/or modify it
1862+ * under the terms of the GNU General Public License version 3, as
1863+ * published by the Free Software Foundation.
1864+ *
1865+ * This program is distributed in the hope that it will be useful, but
1866+ * WITHOUT ANY WARRANTY; without even the implied warranties of
1867+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
1868+ * PURPOSE. See the GNU General Public License for more details.
1869+ *
1870+ * You should have received a copy of the GNU General Public License along
1871+ * with this program. If not, see <http://www.gnu.org/licenses/>.
1872+ *
1873+ * Authors:
1874+ * Lars Uebernickel <lars.uebernickel@canonical.com>
1875+ */
1876+
1877+#include "gtupleaction.h"
1878+
1879+typedef GObjectClass GTupleActionClass;
1880+
1881+struct _GTupleAction
1882+{
1883+ GObject parent;
1884+
1885+ gchar *name;
1886+ GVariantType *type;
1887+ gboolean enabled;
1888+
1889+ gsize n_children;
1890+ GVariant **children;
1891+};
1892+
1893+static void action_interface_init (GActionInterface *iface);
1894+
1895+G_DEFINE_TYPE_WITH_CODE (GTupleAction, g_tuple_action, G_TYPE_OBJECT,
1896+ G_IMPLEMENT_INTERFACE (G_TYPE_ACTION, action_interface_init));
1897+
1898+enum
1899+{
1900+ PROP_0,
1901+ PROP_NAME,
1902+ PROP_PARAMETER_TYPE,
1903+ PROP_ENABLED,
1904+ PROP_STATE_TYPE,
1905+ PROP_STATE,
1906+ N_PROPERTIES
1907+};
1908+
1909+enum
1910+{
1911+ SIGNAL_ACTIVATE,
1912+ N_SIGNALS
1913+};
1914+
1915+static GParamSpec *properties[N_PROPERTIES];
1916+static guint signal_ids[N_SIGNALS];
1917+
1918+static const gchar *
1919+g_tuple_action_get_name (GAction *action)
1920+{
1921+ GTupleAction *tuple = G_TUPLE_ACTION (action);
1922+
1923+ return tuple->name;
1924+}
1925+
1926+static const GVariantType *
1927+g_tuple_action_get_parameter_type (GAction *action)
1928+{
1929+ return NULL;
1930+}
1931+
1932+static const GVariantType *
1933+g_tuple_action_get_state_type (GAction *action)
1934+{
1935+ GTupleAction *tuple = G_TUPLE_ACTION (action);
1936+
1937+ return tuple->type;
1938+}
1939+
1940+static GVariant *
1941+g_tuple_action_get_state_hint (GAction *action)
1942+{
1943+ return NULL;
1944+}
1945+
1946+static gboolean
1947+g_tuple_action_get_enabled (GAction *action)
1948+{
1949+ GTupleAction *tuple = G_TUPLE_ACTION (action);
1950+
1951+ return tuple->enabled;
1952+}
1953+
1954+static GVariant *
1955+g_tuple_action_get_state (GAction *action)
1956+{
1957+ GTupleAction *tuple = G_TUPLE_ACTION (action);
1958+ GVariant *result;
1959+
1960+ result = g_variant_new_tuple (tuple->children, tuple->n_children);
1961+ return g_variant_ref_sink (result);
1962+}
1963+
1964+static void
1965+g_tuple_action_set_state (GTupleAction *tuple,
1966+ GVariant *state)
1967+{
1968+ int i;
1969+
1970+ g_return_if_fail (g_variant_type_is_tuple (g_variant_get_type (state)));
1971+
1972+ if (tuple->type == NULL)
1973+ {
1974+ tuple->type = g_variant_type_copy (g_variant_get_type (state));
1975+ tuple->n_children = g_variant_n_children (state);
1976+ tuple->children = g_new0 (GVariant *, tuple->n_children);
1977+ }
1978+
1979+ for (i = 0; i < tuple->n_children; i++)
1980+ {
1981+ if (tuple->children[i])
1982+ g_variant_unref (tuple->children[i]);
1983+ tuple->children[i] = g_variant_get_child_value (state, i);
1984+ }
1985+
1986+ g_object_notify_by_pspec (G_OBJECT (tuple), properties[PROP_STATE]);
1987+}
1988+
1989+static void
1990+g_tuple_action_change_state (GAction *action,
1991+ GVariant *value)
1992+{
1993+ GTupleAction *tuple = G_TUPLE_ACTION (action);
1994+
1995+ g_return_if_fail (value != NULL);
1996+ g_return_if_fail (g_variant_is_of_type (value, tuple->type));
1997+
1998+ g_variant_ref_sink (value);
1999+
2000+ /* TODO add a change-state signal similar to GSimpleAction */
2001+ g_tuple_action_set_state (tuple, value);
2002+
2003+ g_variant_unref (value);
2004+}
2005+
2006+static void
2007+g_tuple_action_activate (GAction *action,
2008+ GVariant *parameter)
2009+{
2010+ GTupleAction *tuple = G_TUPLE_ACTION (action);
2011+
2012+ g_return_if_fail (parameter == NULL);
2013+
2014+ if (tuple->enabled)
2015+ g_signal_emit (tuple, signal_ids[SIGNAL_ACTIVATE], 0, NULL);
2016+}
2017+
2018+static void
2019+g_tuple_action_get_property (GObject *object,
2020+ guint prop_id,
2021+ GValue *value,
2022+ GParamSpec *pspec)
2023+{
2024+ GAction *action = G_ACTION (object);
2025+
2026+ switch (prop_id)
2027+ {
2028+ case PROP_NAME:
2029+ g_value_set_string (value, g_tuple_action_get_name (action));
2030+ break;
2031+
2032+ case PROP_PARAMETER_TYPE:
2033+ g_value_set_boxed (value, g_tuple_action_get_parameter_type (action));
2034+ break;
2035+
2036+ case PROP_ENABLED:
2037+ g_value_set_boolean (value, g_tuple_action_get_enabled (action));
2038+ break;
2039+
2040+ case PROP_STATE_TYPE:
2041+ g_value_set_boxed (value, g_tuple_action_get_state_type (action));
2042+ break;
2043+
2044+ case PROP_STATE:
2045+ g_value_take_variant (value, g_tuple_action_get_state (action));
2046+ break;
2047+
2048+ default:
2049+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
2050+ }
2051+}
2052+
2053+static void
2054+g_tuple_action_set_property (GObject *object,
2055+ guint prop_id,
2056+ const GValue *value,
2057+ GParamSpec *pspec)
2058+{
2059+ GTupleAction *tuple = G_TUPLE_ACTION (object);
2060+
2061+ switch (prop_id)
2062+ {
2063+ case PROP_NAME:
2064+ tuple->name = g_value_dup_string (value);
2065+ g_object_notify_by_pspec (object, properties[PROP_NAME]);
2066+ break;
2067+
2068+ case PROP_ENABLED:
2069+ tuple->enabled = g_value_get_boolean (value);
2070+ g_object_notify_by_pspec (object, properties[PROP_ENABLED]);
2071+ break;
2072+
2073+ case PROP_STATE:
2074+ g_tuple_action_set_state (tuple, g_value_get_variant (value));
2075+ break;
2076+
2077+ default:
2078+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
2079+ }
2080+}
2081+
2082+static void
2083+g_tuple_action_finalize (GObject *object)
2084+{
2085+ GTupleAction *tuple = G_TUPLE_ACTION (object);
2086+ int i;
2087+
2088+ g_free (tuple->name);
2089+ g_variant_type_free (tuple->type);
2090+
2091+ for (i = 0; i < tuple->n_children; i++)
2092+ g_variant_unref (tuple->children[i]);
2093+
2094+ g_free (tuple->children);
2095+
2096+ G_OBJECT_CLASS (g_tuple_action_parent_class)->finalize (object);
2097+}
2098+
2099+static void
2100+action_interface_init (GActionInterface *iface)
2101+{
2102+ iface->get_name = g_tuple_action_get_name;
2103+ iface->get_parameter_type = g_tuple_action_get_parameter_type;
2104+ iface->get_state_type = g_tuple_action_get_state_type;
2105+ iface->get_state_hint = g_tuple_action_get_state_hint;
2106+ iface->get_enabled = g_tuple_action_get_enabled;
2107+ iface->get_state = g_tuple_action_get_state;
2108+ iface->change_state = g_tuple_action_change_state;
2109+ iface->activate = g_tuple_action_activate;
2110+}
2111+
2112+static void
2113+g_tuple_action_class_init (GTupleActionClass *class)
2114+{
2115+ GObjectClass *object_class = G_OBJECT_CLASS (class);
2116+
2117+ object_class->get_property = g_tuple_action_get_property;
2118+ object_class->set_property = g_tuple_action_set_property;
2119+ object_class->finalize = g_tuple_action_finalize;
2120+
2121+ properties[PROP_NAME] = g_param_spec_string ("name",
2122+ "Name",
2123+ "The name of the action",
2124+ NULL,
2125+ G_PARAM_READWRITE |
2126+ G_PARAM_CONSTRUCT_ONLY |
2127+ G_PARAM_STATIC_STRINGS);
2128+
2129+ properties[PROP_PARAMETER_TYPE] = g_param_spec_boxed ("parameter-type",
2130+ "Parameter Type",
2131+ "The variant type passed to activate",
2132+ G_TYPE_VARIANT_TYPE,
2133+ G_PARAM_READABLE |
2134+ G_PARAM_STATIC_STRINGS);
2135+
2136+ properties[PROP_ENABLED] = g_param_spec_boolean ("enabled",
2137+ "Enabled",
2138+ "Whether the action can be activated",
2139+ TRUE,
2140+ G_PARAM_READWRITE |
2141+ G_PARAM_STATIC_STRINGS);
2142+
2143+ properties[PROP_STATE_TYPE] = g_param_spec_boxed ("state-type",
2144+ "State Type",
2145+ "The variant type of the state, must be a tuple",
2146+ G_TYPE_VARIANT_TYPE,
2147+ G_PARAM_READABLE |
2148+ G_PARAM_STATIC_STRINGS);
2149+
2150+ properties[PROP_STATE] = g_param_spec_variant ("state",
2151+ "State",
2152+ "The state of the action",
2153+ G_VARIANT_TYPE_TUPLE,
2154+ NULL,
2155+ G_PARAM_READWRITE |
2156+ G_PARAM_STATIC_STRINGS);
2157+
2158+ g_object_class_install_properties (object_class, N_PROPERTIES, properties);
2159+
2160+ signal_ids[SIGNAL_ACTIVATE] = g_signal_new ("activate",
2161+ G_TYPE_TUPLE_ACTION,
2162+ G_SIGNAL_RUN_LAST | G_SIGNAL_MUST_COLLECT,
2163+ 0, NULL, NULL,
2164+ g_cclosure_marshal_VOID__VARIANT,
2165+ G_TYPE_NONE, 1,
2166+ G_TYPE_VARIANT);
2167+}
2168+
2169+static void
2170+g_tuple_action_init (GTupleAction *action)
2171+{
2172+ action->enabled = TRUE;
2173+}
2174+
2175+GTupleAction *
2176+g_tuple_action_new (const gchar *name,
2177+ GVariant *initial_state)
2178+{
2179+ const GVariantType *type;
2180+
2181+ g_return_val_if_fail (name != NULL, NULL);
2182+ g_return_val_if_fail (initial_state != NULL, NULL);
2183+
2184+ type = g_variant_get_type (initial_state);
2185+ g_return_val_if_fail (g_variant_type_is_tuple (type), NULL);
2186+
2187+ return g_object_new (G_TYPE_TUPLE_ACTION,
2188+ "name", name,
2189+ "state", initial_state,
2190+ NULL);
2191+}
2192+
2193+void
2194+g_tuple_action_set_child (GTupleAction *action,
2195+ gsize index,
2196+ GVariant *value)
2197+{
2198+ const GVariantType *type;
2199+
2200+ g_return_if_fail (G_IS_TUPLE_ACTION (action));
2201+ g_return_if_fail (index < action->n_children);
2202+ g_return_if_fail (value != NULL);
2203+
2204+ type = g_variant_get_type (value);
2205+ g_return_if_fail (g_variant_is_of_type (value, type));
2206+
2207+ g_variant_unref (action->children[index]);
2208+ action->children[index] = g_variant_ref_sink (value);
2209+
2210+ g_object_notify_by_pspec (G_OBJECT (action), properties[PROP_STATE]);
2211+}
2212
2213=== added file 'libmessaging-menu/gtupleaction.h'
2214--- libmessaging-menu/gtupleaction.h 1970-01-01 00:00:00 +0000
2215+++ libmessaging-menu/gtupleaction.h 2013-06-07 21:39:23 +0000
2216@@ -0,0 +1,40 @@
2217+/*
2218+ * Copyright 2012 Canonical Ltd.
2219+ *
2220+ * This program is free software: you can redistribute it and/or modify it
2221+ * under the terms of the GNU General Public License version 3, as
2222+ * published by the Free Software Foundation.
2223+ *
2224+ * This program is distributed in the hope that it will be useful, but
2225+ * WITHOUT ANY WARRANTY; without even the implied warranties of
2226+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2227+ * PURPOSE. See the GNU General Public License for more details.
2228+ *
2229+ * You should have received a copy of the GNU General Public License along
2230+ * with this program. If not, see <http://www.gnu.org/licenses/>.
2231+ *
2232+ * Authors:
2233+ * Lars Uebernickel <lars.uebernickel@canonical.com>
2234+ */
2235+
2236+#ifndef __g_tuple_action_h__
2237+#define __g_tuple_action_h__
2238+
2239+#include <gio/gio.h>
2240+
2241+#define G_TYPE_TUPLE_ACTION (g_tuple_action_get_type ())
2242+#define G_TUPLE_ACTION(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), G_TYPE_TUPLE_ACTION, GTupleAction))
2243+#define G_IS_TUPLE_ACTION(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), G_TYPE_TUPLE_ACTION))
2244+
2245+typedef struct _GTupleAction GTupleAction;
2246+
2247+GType g_tuple_action_get_type (void) G_GNUC_CONST;
2248+
2249+GTupleAction * g_tuple_action_new (const gchar *name,
2250+ GVariant *initial_state);
2251+
2252+void g_tuple_action_set_child (GTupleAction *action,
2253+ gsize index,
2254+ GVariant *value);
2255+
2256+#endif
2257
2258=== added file 'libmessaging-menu/messaging-menu.c'
2259--- libmessaging-menu/messaging-menu.c 1970-01-01 00:00:00 +0000
2260+++ libmessaging-menu/messaging-menu.c 2013-06-07 21:39:23 +0000
2261@@ -0,0 +1,1199 @@
2262+/*
2263+ * Copyright 2012 Canonical Ltd.
2264+ *
2265+ * This program is free software: you can redistribute it and/or modify it
2266+ * under the terms of the GNU General Public License version 3, as
2267+ * published by the Free Software Foundation.
2268+ *
2269+ * This program is distributed in the hope that it will be useful, but
2270+ * WITHOUT ANY WARRANTY; without even the implied warranties of
2271+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
2272+ * PURPOSE. See the GNU General Public License for more details.
2273+ *
2274+ * You should have received a copy of the GNU General Public License along
2275+ * with this program. If not, see <http://www.gnu.org/licenses/>.
2276+ *
2277+ * Authors:
2278+ * Lars Uebernickel <lars.uebernickel@canonical.com>
2279+ */
2280+
2281+#include "messaging-menu.h"
2282+#include "indicator-messages-service.h"
2283+
2284+#include <gio/gdesktopappinfo.h>
2285+
2286+/**
2287+ * SECTION:messaging-menu
2288+ * @title: MessagingMenuApp
2289+ * @short_description: An application section in the messaging menu
2290+ * @include: messaging-menu.h
2291+ *
2292+ * A #MessagingMenuApp represents an application section in the
2293+ * Messaging Menu. An application section is tied to an installed
2294+ * application through a desktop file id, which must be passed to
2295+ * messaging_menu_app_new().
2296+ *
2297+ * To register the application with the Messaging Menu, call
2298+ * messaging_menu_app_register(). This signifies that the application
2299+ * should be present in the menu and be marked as "running".
2300+ *
2301+ * The first menu item in an application section represents the
2302+ * application itself, using the name and icon found in the associated
2303+ * desktop file. Activating this item starts the application.
2304+ *
2305+ * Following the application item, the Messaging Menu inserts all
2306+ * shortcut actions found in the desktop file. Actions whose
2307+ * <code>NotShowIn</code> keyword contains "Messaging Menu" or whose
2308+ * <code>OnlyShowIn</code> keyword does not contain "Messaging Menu"
2309+ * will not appear (the <ulink
2310+ * url="http://standards.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.1.html#extra-actions">
2311+ * desktop file specification</ulink> contains a detailed explanation of
2312+ * shortcut actions.) An application cannot add, remove, or change
2313+ * these shortcut items while it is running.
2314+ *
2315+ * Next, an application section contains menu items for message sources.
2316+ * What exactly constitutes a message source depends on the type of
2317+ * application: an email client's message sources are folders
2318+ * containing new messages, while those of a chat program are persons
2319+ * that have contacted the user.
2320+ *
2321+ * A message source is represented in the menu by a label and optionally
2322+ * also an icon. It can be associated with either a count, a time, or
2323+ * an arbitrary string, which will appear on the right side of the menu
2324+ * item.
2325+ *
2326+ * When the user activates a source, the source is immediately removed
2327+ * from the menu and the "activate-source" signal is emitted.
2328+ *
2329+ * Applications should always expose all the message sources available.
2330+ * However, the Messaging Menu might limit the amount of sources it
2331+ * displays to the user.
2332+ *
2333+ * The Messaging Menu offers users a way to set their chat status
2334+ * (available, away, busy, invisible, or offline) for multiple
2335+ * applications at once. Applications that appear in the Messaging Menu
2336+ * can integrate with this by setting the
2337+ * "X-MessagingMenu-UsesChatSection" key in their desktop file to True.
2338+ * Use messaging_menu_app_set_status() to signify that the application's
2339+ * chat status has changed. When the user changes status through the
2340+ * Messaging Menu, the ::status-changed signal will be emitted.
2341+ *
2342+ * If the application stops running without calling
2343+ * messaging_menu_app_unregister(), it will be marked as "not running".
2344+ * Its application and shortcut items stay in the menu, but all message
2345+ * sources are removed. If messaging_menu_app_unregister() is called,
2346+ * the application section is removed completely.
2347+ *
2348+ * More information about the design and recommended usage of the
2349+ * Messaging Menu is available at <ulink
2350+ * url="https://wiki.ubuntu.com/MessagingMenu">https://wiki.ubuntu.com/MessagingMenu</ulink>.
2351+ */
2352+
2353+/**
2354+ * MessagingMenuApp:
2355+ *
2356+ * #MessagingMenuApp is an opaque structure.
2357+ */
2358+struct _MessagingMenuApp
2359+{
2360+ GObject parent_instance;
2361+
2362+ GDesktopAppInfo *appinfo;
2363+ int registered; /* -1 for unknown */
2364+ MessagingMenuStatus status;
2365+ gboolean status_set;
2366+ GSimpleActionGroup *source_actions;
2367+ GMenu *menu;
2368+ GDBusConnection *bus;
2369+
2370+ IndicatorMessagesService *messages_service;
2371+ guint watch_id;
2372+ guint action_export_id;
2373+ guint menu_export_id;
2374+
2375+ GCancellable *cancellable;
2376+};
2377+
2378+G_DEFINE_TYPE (MessagingMenuApp, messaging_menu_app, G_TYPE_OBJECT);
2379+
2380+enum {
2381+ PROP_0,
2382+ PROP_DESKTOP_ID,
2383+ N_PROPERTIES
2384+};
2385+
2386+enum {
2387+ ACTIVATE_SOURCE,
2388+ STATUS_CHANGED,
2389+ N_SIGNALS
2390+};
2391+
2392+static GParamSpec *properties[N_PROPERTIES];
2393+static guint signals[N_SIGNALS];
2394+
2395+static const gchar *status_ids[] = { "available", "away", "busy", "invisible", "offline" };
2396+
2397+static void global_status_changed (IndicatorMessagesService *service,
2398+ const gchar *status_str,
2399+ gpointer user_data);
2400+
2401+static gchar *
2402+messaging_menu_app_get_dbus_object_path (MessagingMenuApp *app)
2403+{
2404+ gchar *path;
2405+
2406+ if (!app->appinfo)
2407+ return NULL;
2408+
2409+ path = g_strconcat ("/com/canonical/indicator/messages/",
2410+ g_app_info_get_id (G_APP_INFO (app->appinfo)),
2411+ NULL);
2412+
2413+ g_strcanon (path, "/ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", '_');
2414+
2415+ return path;
2416+}
2417+
2418+static void
2419+export_menus_and_actions (GObject *source,
2420+ GAsyncResult *res,
2421+ gpointer user_data)
2422+{
2423+ MessagingMenuApp *app = user_data;
2424+ GError *error = NULL;
2425+ gchar *object_path;
2426+
2427+ object_path = messaging_menu_app_get_dbus_object_path (app);
2428+ if (!object_path)
2429+ return;
2430+
2431+ app->bus = g_bus_get_finish (res, &error);
2432+ if (app->bus == NULL)
2433+ {
2434+ g_warning ("unable to connect to session bus: %s", error->message);
2435+ g_error_free (error);
2436+ return;
2437+ }
2438+
2439+ app->action_export_id = g_dbus_connection_export_action_group (app->bus,
2440+ object_path,
2441+ G_ACTION_GROUP (app->source_actions),
2442+ &error);
2443+ if (!app->action_export_id)
2444+ {
2445+ g_warning ("unable to export action group: %s", error->message);
2446+ g_clear_error (&error);
2447+ }
2448+
2449+ app->menu_export_id = g_dbus_connection_export_menu_model (app->bus,
2450+ object_path,
2451+ G_MENU_MODEL (app->menu),
2452+ &error);
2453+ if (!app->menu_export_id)
2454+ {
2455+ g_warning ("unable to export menu: %s", error->message);
2456+ g_clear_error (&error);
2457+ }
2458+
2459+ g_free (object_path);
2460+}
2461+
2462+static void
2463+messaging_menu_app_set_desktop_id (MessagingMenuApp *app,
2464+ const gchar *desktop_id)
2465+{
2466+ g_return_if_fail (desktop_id != NULL);
2467+
2468+ /* no need to clean up, it's construct only */
2469+ app->appinfo = g_desktop_app_info_new (desktop_id);
2470+ if (app->appinfo == NULL)
2471+ {
2472+ g_warning ("could not find the desktop file for '%s'",
2473+ desktop_id);
2474+ }
2475+
2476+ g_bus_get (G_BUS_TYPE_SESSION,
2477+ app->cancellable,
2478+ export_menus_and_actions,
2479+ app);
2480+}
2481+
2482+static void
2483+messaging_menu_app_set_property (GObject *object,
2484+ guint prop_id,
2485+ const GValue *value,
2486+ GParamSpec *pspec)
2487+{
2488+ MessagingMenuApp *app = MESSAGING_MENU_APP (object);
2489+
2490+ switch (prop_id)
2491+ {
2492+ case PROP_DESKTOP_ID:
2493+ messaging_menu_app_set_desktop_id (app, g_value_get_string (value));
2494+ break;
2495+
2496+ default:
2497+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
2498+ }
2499+}
2500+
2501+static void
2502+messaging_menu_app_finalize (GObject *object)
2503+{
2504+ G_OBJECT_CLASS (messaging_menu_app_parent_class)->finalize (object);
2505+}
2506+
2507+static void
2508+messaging_menu_app_dispose (GObject *object)
2509+{
2510+ MessagingMenuApp *app = MESSAGING_MENU_APP (object);
2511+
2512+ if (app->bus)
2513+ {
2514+ if (app->action_export_id > 0)
2515+ g_dbus_connection_unexport_action_group (app->bus, app->action_export_id);
2516+
2517+ if (app->menu_export_id > 0)
2518+ g_dbus_connection_unexport_menu_model (app->bus, app->menu_export_id);
2519+
2520+ app->action_export_id = 0;
2521+ app->menu_export_id = 0;
2522+ g_object_unref (app->bus);
2523+ app->bus = NULL;
2524+ }
2525+
2526+ if (app->watch_id > 0)
2527+ {
2528+ g_bus_unwatch_name (app->watch_id);
2529+ app->watch_id = 0;
2530+ }
2531+
2532+ if (app->cancellable)
2533+ {
2534+ g_cancellable_cancel (app->cancellable);
2535+ g_object_unref (app->cancellable);
2536+ app->cancellable = NULL;
2537+ }
2538+
2539+ if (app->messages_service)
2540+ {
2541+ indicator_messages_service_call_application_stopped_running (app->messages_service,
2542+ g_app_info_get_id (G_APP_INFO (app->appinfo)),
2543+ NULL, NULL, NULL);
2544+
2545+ g_signal_handlers_disconnect_by_func (app->messages_service,
2546+ global_status_changed,
2547+ app);
2548+ g_clear_object (&app->messages_service);
2549+ }
2550+
2551+ g_clear_object (&app->appinfo);
2552+ g_clear_object (&app->source_actions);
2553+ g_clear_object (&app->menu);
2554+
2555+ G_OBJECT_CLASS (messaging_menu_app_parent_class)->dispose (object);
2556+}
2557+
2558+static void
2559+messaging_menu_app_class_init (MessagingMenuAppClass *class)
2560+{
2561+ GObjectClass *object_class = G_OBJECT_CLASS (class);
2562+
2563+ object_class->set_property = messaging_menu_app_set_property;
2564+ object_class->finalize = messaging_menu_app_finalize;
2565+ object_class->dispose = messaging_menu_app_dispose;
2566+
2567+ /**
2568+ * MessagingMenuApp:desktop-id:
2569+ *
2570+ * The desktop id of the application associated with this application
2571+ * section. Must be given when the #MessagingMenuApp is created.
2572+ */
2573+ properties[PROP_DESKTOP_ID] = g_param_spec_string ("desktop-id",
2574+ "Desktop Id",
2575+ "The desktop id of the associated application",
2576+ NULL,
2577+ G_PARAM_WRITABLE |
2578+ G_PARAM_CONSTRUCT_ONLY |
2579+ G_PARAM_STATIC_STRINGS);
2580+
2581+ g_object_class_install_properties (object_class, N_PROPERTIES, properties);
2582+
2583+ /**
2584+ * MessagingMenuApp::activate-source:
2585+ * @mmapp: the #MessagingMenuApp
2586+ * @source_id: the source id that was activated
2587+ *
2588+ * Emitted when the user has activated the message source with id
2589+ * @source_id. The source is immediately removed from the menu,
2590+ * handlers of this signal do not need to call
2591+ * messaging_menu_app_remove_source().
2592+ */
2593+ signals[ACTIVATE_SOURCE] = g_signal_new ("activate-source",
2594+ MESSAGING_MENU_TYPE_APP,
2595+ G_SIGNAL_RUN_FIRST |
2596+ G_SIGNAL_DETAILED,
2597+ 0,
2598+ NULL, NULL,
2599+ g_cclosure_marshal_VOID__STRING,
2600+ G_TYPE_NONE, 1, G_TYPE_STRING);
2601+
2602+ /**
2603+ * MessagingMenuApp::status-changed:
2604+ * @mmapp: the #MessagingMenuApp
2605+ * @status: a #MessagingMenuStatus
2606+ *
2607+ * Emitted when the chat status is changed through the messaging menu.
2608+ *
2609+ * Applications which are registered to use the chat status should
2610+ * change their status to @status upon receiving this signal. Call
2611+ * messaging_menu_app_set_status() to acknowledge that the application
2612+ * changed its status.
2613+ */
2614+ signals[STATUS_CHANGED] = g_signal_new ("status-changed",
2615+ MESSAGING_MENU_TYPE_APP,
2616+ G_SIGNAL_RUN_FIRST,
2617+ 0,
2618+ NULL, NULL,
2619+ g_cclosure_marshal_VOID__INT,
2620+ G_TYPE_NONE, 1, G_TYPE_INT);
2621+}
2622+
2623+static void
2624+created_messages_service (GObject *source_object,
2625+ GAsyncResult *result,
2626+ gpointer user_data)
2627+{
2628+ MessagingMenuApp *app = user_data;
2629+ GError *error = NULL;
2630+
2631+ app->messages_service = indicator_messages_service_proxy_new_finish (result, &error);
2632+ if (!app->messages_service)
2633+ {
2634+ g_warning ("unable to connect to the mesaging menu service: %s", error->message);
2635+ g_error_free (error);
2636+ return;
2637+ }
2638+
2639+ g_signal_connect (app->messages_service, "status-changed",
2640+ G_CALLBACK (global_status_changed), app);
2641+
2642+ /* sync current status */
2643+ if (app->registered == TRUE)
2644+ messaging_menu_app_register (app);
2645+ else if (app->registered == FALSE)
2646+ messaging_menu_app_unregister (app);
2647+ if (app->status_set)
2648+ messaging_menu_app_set_status (app, app->status);
2649+}
2650+
2651+static void
2652+indicator_messages_appeared (GDBusConnection *bus,
2653+ const gchar *name,
2654+ const gchar *name_owner,
2655+ gpointer user_data)
2656+{
2657+ MessagingMenuApp *app = user_data;
2658+
2659+ indicator_messages_service_proxy_new (bus,
2660+ G_DBUS_PROXY_FLAGS_NONE,
2661+ "com.canonical.indicator.messages",
2662+ "/com/canonical/indicator/messages/service",
2663+ app->cancellable,
2664+ created_messages_service,
2665+ app);
2666+}
2667+
2668+static void
2669+indicator_messages_vanished (GDBusConnection *bus,
2670+ const gchar *name,
2671+ gpointer user_data)
2672+{
2673+ MessagingMenuApp *app = user_data;
2674+
2675+ if (app->messages_service)
2676+ {
2677+ g_signal_handlers_disconnect_by_func (app->messages_service,
2678+ global_status_changed,
2679+ app);
2680+ g_clear_object (&app->messages_service);
2681+ }
2682+}
2683+
2684+static void
2685+messaging_menu_app_init (MessagingMenuApp *app)
2686+{
2687+ app->registered = -1;
2688+ app->status_set = FALSE;
2689+ app->bus = NULL;
2690+
2691+ app->action_export_id = 0;
2692+ app->menu_export_id = 0;
2693+
2694+ app->cancellable = g_cancellable_new ();
2695+
2696+ app->source_actions = g_simple_action_group_new ();
2697+ app->menu = g_menu_new ();
2698+
2699+ app->cancellable = g_cancellable_new ();
2700+
2701+ app->watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION,
2702+ "com.canonical.indicator.messages",
2703+ G_BUS_NAME_WATCHER_FLAGS_NONE,
2704+ indicator_messages_appeared,
2705+ indicator_messages_vanished,
2706+ app,
2707+ NULL);
2708+}
2709+
2710+/**
2711+ * messaging_menu_new:
2712+ * @desktop_id: a desktop file id. See g_desktop_app_info_new()
2713+ *
2714+ * Creates a new #MessagingMenuApp for the application associated with
2715+ * @desktop_id.
2716+ *
2717+ * The application will not show up (nor be marked as "running") in the
2718+ * Messaging Menu before messaging_menu_app_register() has been called.
2719+ *
2720+ * Returns: (transfer full): a new #MessagingMenuApp
2721+ */
2722+MessagingMenuApp *
2723+messaging_menu_app_new (const gchar *desktop_id)
2724+{
2725+ return g_object_new (MESSAGING_MENU_TYPE_APP,
2726+ "desktop-id", desktop_id,
2727+ NULL);
2728+}
2729+
2730+/**
2731+ * messaging_menu_app_register:
2732+ * @app: a #MessagingMenuApp
2733+ *
2734+ * Registers @app with the Messaging Menu.
2735+ *
2736+ * If the application doesn't already have a section in the Messaging
2737+ * Menu, one will be created for it. The application will also be
2738+ * marked as "running".
2739+ *
2740+ * The application will be marked as "not running" as soon as @app is
2741+ * destroyed. The application launcher as well as shortcut actions will
2742+ * remain in the menu. To completely remove the application section
2743+ * from the Messaging Menu, call messaging_menu_app_unregister().
2744+ */
2745+void
2746+messaging_menu_app_register (MessagingMenuApp *app)
2747+{
2748+ gchar *object_path;
2749+
2750+ g_return_if_fail (MESSAGING_MENU_IS_APP (app));
2751+
2752+ app->registered = TRUE;
2753+
2754+ /* state will be synced right after connecting to the service */
2755+ if (!app->messages_service)
2756+ return;
2757+
2758+ object_path = messaging_menu_app_get_dbus_object_path (app);
2759+ if (!object_path)
2760+ return;
2761+
2762+ indicator_messages_service_call_register_application (app->messages_service,
2763+ g_app_info_get_id (G_APP_INFO (app->appinfo)),
2764+ object_path,
2765+ app->cancellable,
2766+ NULL, NULL);
2767+
2768+ g_free (object_path);
2769+}
2770+
2771+/**
2772+ * messaging_menu_app_unregister:
2773+ * @app: a #MessagingMenuApp
2774+ *
2775+ * Completely removes the @app from the Messaging Menu. If the
2776+ * application's launcher and shortcut actions should remain in the
2777+ * menu, destroying @app with g_object_unref() suffices.
2778+ *
2779+ * Note: @app will remain valid and usable after this call.
2780+ */
2781+void
2782+messaging_menu_app_unregister (MessagingMenuApp *app)
2783+{
2784+ g_return_if_fail (MESSAGING_MENU_IS_APP (app));
2785+
2786+ app->registered = FALSE;
2787+
2788+ /* state will be synced right after connecting to the service */
2789+ if (!app->messages_service)
2790+ return;
2791+
2792+ if (!app->appinfo)
2793+ return;
2794+
2795+ indicator_messages_service_call_unregister_application (app->messages_service,
2796+ g_app_info_get_id (G_APP_INFO (app->appinfo)),
2797+ app->cancellable,
2798+ NULL, NULL);
2799+}
2800+
2801+/**
2802+ * messaging_menu_app_set_status:
2803+ * @app: a #MessagingMenuApp
2804+ * @status: a #MessagingMenuStatus
2805+ *
2806+ * Notify the Messaging Menu that the chat status of @app has changed to
2807+ * @status.
2808+ *
2809+ * Connect to the ::status-changed signal to receive notification about
2810+ * the user changing their global chat status through the Messaging
2811+ * Menu.
2812+ *
2813+ * This function does nothing for applications whose desktop file does
2814+ * not include X-MessagingMenu-UsesChatSection.
2815+ */
2816+void
2817+messaging_menu_app_set_status (MessagingMenuApp *app,
2818+ MessagingMenuStatus status)
2819+{
2820+ g_return_if_fail (MESSAGING_MENU_IS_APP (app));
2821+ g_return_if_fail (status >= MESSAGING_MENU_STATUS_AVAILABLE &&
2822+ status <= MESSAGING_MENU_STATUS_OFFLINE);
2823+
2824+ app->status = status;
2825+ app->status_set = TRUE;
2826+
2827+ /* state will be synced right after connecting to the service */
2828+ if (!app->messages_service)
2829+ return;
2830+
2831+ if (!app->appinfo)
2832+ return;
2833+
2834+ indicator_messages_service_call_set_status (app->messages_service,
2835+ g_app_info_get_id (G_APP_INFO (app->appinfo)),
2836+ status_ids [status],
2837+ app->cancellable,
2838+ NULL, NULL);
2839+}
2840+
2841+static int
2842+status_from_string (const gchar *s)
2843+{
2844+ int i;
2845+
2846+ if (!s)
2847+ return -1;
2848+
2849+ for (i = 0; i <= MESSAGING_MENU_STATUS_OFFLINE; i++)
2850+ {
2851+ if (g_str_equal (s, status_ids[i]))
2852+ return i;
2853+ }
2854+
2855+ return -1;
2856+}
2857+
2858+static void
2859+global_status_changed (IndicatorMessagesService *service,
2860+ const gchar *status_str,
2861+ gpointer user_data)
2862+{
2863+ MessagingMenuApp *app = user_data;
2864+ int status;
2865+
2866+ status = status_from_string (status_str);
2867+ g_return_if_fail (status >= 0);
2868+
2869+ g_signal_emit (app, signals[STATUS_CHANGED], 0, status);
2870+}
2871+
2872+static void
2873+source_action_activated (GSimpleAction *action,
2874+ GVariant *parameter,
2875+ gpointer user_data)
2876+{
2877+ MessagingMenuApp *app = user_data;
2878+ const gchar *name = g_action_get_name (G_ACTION (action));
2879+ GQuark q = g_quark_from_string (name);
2880+
2881+ messaging_menu_app_remove_source (app, name);
2882+
2883+ g_signal_emit (app, signals[ACTIVATE_SOURCE], q, name);
2884+}
2885+
2886+static void
2887+messaging_menu_app_insert_source_action (MessagingMenuApp *app,
2888+ gint position,
2889+ const gchar *id,
2890+ GIcon *icon,
2891+ const gchar *label,
2892+ GVariant *state)
2893+{
2894+ GSimpleAction *action;
2895+ GMenuItem *menuitem;
2896+
2897+ g_return_if_fail (MESSAGING_MENU_IS_APP (app));
2898+ g_return_if_fail (id != NULL);
2899+
2900+ if (g_simple_action_group_lookup (app->source_actions, id))
2901+ {
2902+ g_warning ("a source with id '%s' already exists", id);
2903+ return;
2904+ }
2905+
2906+ action = g_simple_action_new_stateful (id, NULL, state);
2907+ g_signal_connect (action, "activate",
2908+ G_CALLBACK (source_action_activated), app);
2909+ g_simple_action_group_insert (app->source_actions, G_ACTION (action));
2910+ g_object_unref (action);
2911+
2912+ menuitem = g_menu_item_new (label, id);
2913+ g_menu_item_set_attribute (menuitem, "x-canonical-type", "s", "ImSourceMenuItem");
2914+ if (icon)
2915+ {
2916+ gchar *iconstr = g_icon_to_string (icon);
2917+ g_menu_item_set_attribute (menuitem, "x-canonical-icon", "s", iconstr);
2918+ g_free (iconstr);
2919+ }
2920+ g_menu_insert_item (app->menu, position, menuitem);
2921+ g_object_unref (menuitem);
2922+}
2923+
2924+static GSimpleAction *
2925+messaging_menu_app_get_source_action (MessagingMenuApp *app,
2926+ const gchar *source_id)
2927+
2928+{
2929+ GAction *action;
2930+
2931+ g_return_val_if_fail (MESSAGING_MENU_IS_APP (app), NULL);
2932+ g_return_val_if_fail (source_id != NULL, NULL);
2933+
2934+ action = g_simple_action_group_lookup (app->source_actions, source_id);
2935+ if (action == NULL)
2936+ g_warning ("a source with id '%s' doesn't exist", source_id);
2937+
2938+ return G_SIMPLE_ACTION (action);
2939+}
2940+
2941+static void
2942+messaging_menu_app_set_source_action (MessagingMenuApp *app,
2943+ const gchar *source_id,
2944+ guint count,
2945+ gint64 time,
2946+ const gchar *string)
2947+{
2948+ GSimpleAction *action;
2949+ GVariant *state;
2950+ gboolean draws_attention;
2951+ GVariant *new_state;
2952+
2953+ action = messaging_menu_app_get_source_action (app, source_id);
2954+ if (!action)
2955+ return;
2956+
2957+ state = g_action_get_state (G_ACTION (action));
2958+ g_variant_get_child (state, 3, "b", &draws_attention);
2959+
2960+ new_state = g_variant_new ("(uxsb)", count, time, string, draws_attention);
2961+ g_simple_action_set_state (action, new_state);
2962+
2963+ g_variant_unref (state);
2964+}
2965+
2966+static void
2967+messaging_menu_app_set_draws_attention (MessagingMenuApp *app,
2968+ const gchar *source_id,
2969+ gboolean draws_attention)
2970+{
2971+ GSimpleAction *action;
2972+ GVariant *state;
2973+ guint count;
2974+ gint64 time;
2975+ const gchar *string;
2976+ GVariant *new_state;
2977+
2978+ action = messaging_menu_app_get_source_action (app, source_id);
2979+ if (!action)
2980+ return;
2981+
2982+ state = g_action_get_state (G_ACTION (action));
2983+ g_variant_get (state, "(ux&sb)", &count, &time, &string, NULL);
2984+
2985+ new_state = g_variant_new ("(uxsb)", count, time, string, TRUE);
2986+ g_simple_action_set_state (action, new_state);
2987+
2988+ g_variant_unref (state);
2989+}
2990+
2991+/**
2992+ * messaging_menu_app_insert_source:
2993+ * @app: a #MessagingMenuApp
2994+ * @position: the position at which to insert the source
2995+ * @id: a unique identifier for the source to be added
2996+ * @icon: the icon associated with the source
2997+ * @label: a user-visible string best describing the source
2998+ *
2999+ * Inserts a new message source into the section representing @app. Equivalent
3000+ * to calling messaging_menu_app_insert_source_with_time() with the current
3001+ * time.
3002+ *
3003+ * It is an error to insert a source with an @id which already exists. Use
3004+ * messaging_menu_app_has_source() to find out whether there is such a source.
3005+ */
3006+void
3007+messaging_menu_app_insert_source (MessagingMenuApp *app,
3008+ gint position,
3009+ const gchar *id,
3010+ GIcon *icon,
3011+ const gchar *label)
3012+{
3013+ messaging_menu_app_insert_source_with_time (app, position, id, icon, label,
3014+ g_get_real_time ());
3015+}
3016+
3017+/**
3018+ * messaging_menu_app_append_source:
3019+ * @app: a #MessagingMenuApp
3020+ * @id: a unique identifier for the source to be added
3021+ * @icon: (allow-none): the icon associated with the source
3022+ * @label: a user-visible string best describing the source
3023+ *
3024+ * Appends a new message source to the end of the section representing @app.
3025+ * Equivalent to calling messaging_menu_app_append_source_with_time() with the
3026+ * current time.
3027+ *
3028+ * It is an error to add a source with an @id which already exists. Use
3029+ * messaging_menu_app_has_source() to find out whether there is such a source.
3030+ */
3031+void
3032+messaging_menu_app_append_source (MessagingMenuApp *app,
3033+ const gchar *id,
3034+ GIcon *icon,
3035+ const gchar *label)
3036+{
3037+ messaging_menu_app_insert_source (app, -1, id, icon, label);
3038+}
3039+
3040+/**
3041+ * messaging_menu_app_insert_source_with_count:
3042+ * @app: a #MessagingMenuApp
3043+ * @position: the position at which to insert the source
3044+ * @id: a unique identifier for the source to be added
3045+ * @icon: (allow-none): the icon associated with the source
3046+ * @label: a user-visible string best describing the source
3047+ * @count: the count for the source
3048+ *
3049+ * Inserts a new message source into the section representing @app and
3050+ * initializes it with @count.
3051+ *
3052+ * To update the count, use messaging_menu_app_set_source_count().
3053+ *
3054+ * It is an error to insert a source with an @id which already exists. Use
3055+ * messaging_menu_app_has_source() to find out whether there is such a source.
3056+ */
3057+void
3058+messaging_menu_app_insert_source_with_count (MessagingMenuApp *app,
3059+ gint position,
3060+ const gchar *id,
3061+ GIcon *icon,
3062+ const gchar *label,
3063+ guint count)
3064+{
3065+ messaging_menu_app_insert_source_action (app, position, id, icon, label,
3066+ g_variant_new ("(uxsb)", count, 0, "", FALSE));
3067+}
3068+
3069+/**
3070+ * messaging_menu_app_append_source_with_count:
3071+ * @app: a #MessagingMenuApp
3072+ * @id: a unique identifier for the source to be added
3073+ * @icon: (allow-none): the icon associated with the source
3074+ * @label: a user-visible string best describing the source
3075+ * @count: the count for the source
3076+ *
3077+ * Appends a new message source to the end of the section representing @app and
3078+ * initializes it with @count.
3079+ *
3080+ * To update the count, use messaging_menu_app_set_source_count().
3081+ *
3082+ * It is an error to add a source with an @id which already exists. Use
3083+ * messaging_menu_app_has_source() to find out whether there is such a source.
3084+ */
3085+void messaging_menu_app_append_source_with_count (MessagingMenuApp *app,
3086+ const gchar *id,
3087+ GIcon *icon,
3088+ const gchar *label,
3089+ guint count)
3090+{
3091+ messaging_menu_app_insert_source_with_count (app, -1, id, icon, label, count);
3092+}
3093+
3094+/**
3095+ * messaging_menu_app_insert_source_with_time:
3096+ * @app: a #MessagingMenuApp
3097+ * @position: the position at which to insert the source
3098+ * @id: a unique identifier for the source to be added
3099+ * @icon: (allow-none): the icon associated with the source
3100+ * @label: a user-visible string best describing the source
3101+ * @time: the time when the source was created, in microseconds
3102+ *
3103+ * Inserts a new message source into the section representing @app and
3104+ * initializes it with @time. Use messaging_menu_app_insert_source() to
3105+ * insert a source with the current time.
3106+ *
3107+ * To change the time, use messaging_menu_app_set_source_time().
3108+ *
3109+ * It is an error to insert a source with an @id which already exists. Use
3110+ * messaging_menu_app_has_source() to find out whether there is such a source.
3111+ */
3112+void
3113+messaging_menu_app_insert_source_with_time (MessagingMenuApp *app,
3114+ gint position,
3115+ const gchar *id,
3116+ GIcon *icon,
3117+ const gchar *label,
3118+ gint64 time)
3119+{
3120+ messaging_menu_app_insert_source_action (app, position, id, icon, label,
3121+ g_variant_new ("(uxsb)", 0, time, "", FALSE));
3122+}
3123+
3124+/**
3125+ * messaging_menu_app_append_source_with_time:
3126+ * @app: a #MessagingMenuApp
3127+ * @id: a unique identifier for the source to be added
3128+ * @icon: (allow-none): the icon associated with the source
3129+ * @label: a user-visible string best describing the source
3130+ * @time: the time when the source was created, in microseconds
3131+ *
3132+ * Appends a new message source to the end of the section representing
3133+ * @app and initializes it with @time. Use
3134+ * messaging_menu_app_append_source() to append a source with the
3135+ * current time.
3136+ *
3137+ * To change the time, use messaging_menu_app_set_source_time().
3138+ *
3139+ * It is an error to insert a source with an @id which already exists. Use
3140+ * messaging_menu_app_has_source() to find out whether there is such a source.
3141+ */
3142+void
3143+messaging_menu_app_append_source_with_time (MessagingMenuApp *app,
3144+ const gchar *id,
3145+ GIcon *icon,
3146+ const gchar *label,
3147+ gint64 time)
3148+{
3149+ messaging_menu_app_insert_source_with_time (app, -1, id, icon, label, time);
3150+}
3151+
3152+/**
3153+ * messaging_menu_app_insert_source_with_string:
3154+ * @app: a #MessagingMenuApp
3155+ * @position: the position at which to insert the source
3156+ * @id: a unique identifier for the source to be added
3157+ * @icon: (allow-none): the icon associated with the source
3158+ * @label: a user-visible string best describing the source
3159+ * @str: a string associated with the source
3160+ *
3161+ * Inserts a new message source into the section representing @app and
3162+ * initializes it with @str.
3163+ *
3164+ * To update the string, use messaging_menu_app_set_source_string().
3165+ *
3166+ * It is an error to insert a source with an @id which already exists. Use
3167+ * messaging_menu_app_has_source() to find out whether there is such a source.
3168+ */
3169+void
3170+messaging_menu_app_insert_source_with_string (MessagingMenuApp *app,
3171+ gint position,
3172+ const gchar *id,
3173+ GIcon *icon,
3174+ const gchar *label,
3175+ const gchar *str)
3176+{
3177+ messaging_menu_app_insert_source_action (app, position, id, icon, label,
3178+ g_variant_new ("(uxsb)", 0, 0, str, FALSE));
3179+}
3180+
3181+/**
3182+ * messaging_menu_app_append_source_with_string:
3183+ * @app: a #MessagingMenuApp
3184+ * @id: a unique identifier for the source to be added
3185+ * @icon: (allow-none): the icon associated with the source
3186+ * @label: a user-visible string best describing the source
3187+ * @str: a string associated with the source
3188+ *
3189+ * Appends a new message source to the end of the section representing @app and
3190+ * initializes it with @str.
3191+ *
3192+ * To update the string, use messaging_menu_app_set_source_string().
3193+ *
3194+ * It is an error to insert a source with an @id which already exists. Use
3195+ * messaging_menu_app_has_source() to find out whether there is such a source.
3196+ */
3197+void
3198+messaging_menu_app_append_source_with_string (MessagingMenuApp *app,
3199+ const gchar *id,
3200+ GIcon *icon,
3201+ const gchar *label,
3202+ const gchar *str)
3203+{
3204+ messaging_menu_app_insert_source_with_string (app, -1, id, icon, label, str);
3205+}
3206+
3207+/**
3208+ * messaging_menu_app_remove_source:
3209+ * @app: a #MessagingMenuApp
3210+ * @source_id: the id of the source to remove
3211+ *
3212+ * Removes the source corresponding to @source_id from the menu.
3213+ */
3214+void
3215+messaging_menu_app_remove_source (MessagingMenuApp *app,
3216+ const gchar *source_id)
3217+{
3218+ int n_items;
3219+ int i;
3220+
3221+ g_return_if_fail (MESSAGING_MENU_IS_APP (app));
3222+ g_return_if_fail (source_id != NULL);
3223+
3224+ if (g_simple_action_group_lookup (app->source_actions, source_id) == NULL)
3225+ return;
3226+
3227+ n_items = g_menu_model_get_n_items (G_MENU_MODEL (app->menu));
3228+ for (i = 0; i < n_items; i++)
3229+ {
3230+ gchar *action;
3231+
3232+ if (g_menu_model_get_item_attribute (G_MENU_MODEL (app->menu), i,
3233+ "action", "s", &action))
3234+ {
3235+ if (!g_strcmp0 (action, source_id))
3236+ {
3237+ g_menu_remove (app->menu, i);
3238+ break;
3239+ }
3240+
3241+ g_free (action);
3242+ }
3243+ }
3244+
3245+ g_simple_action_group_remove (app->source_actions, source_id);
3246+}
3247+
3248+/**
3249+ * messaging_menu_app_has_source:
3250+ * @app: a #MessagingMenuApp
3251+ * @source_id: a source id
3252+ *
3253+ * Returns: TRUE if there is a source associated with @source_id
3254+ */
3255+gboolean
3256+messaging_menu_app_has_source (MessagingMenuApp *app,
3257+ const gchar *source_id)
3258+{
3259+ g_return_val_if_fail (MESSAGING_MENU_IS_APP (app), FALSE);
3260+ g_return_val_if_fail (source_id != NULL, FALSE);
3261+
3262+ return g_simple_action_group_lookup (app->source_actions, source_id) != NULL;
3263+}
3264+
3265+static GMenuItem *
3266+g_menu_find_item_with_action (GMenu *menu,
3267+ const gchar *action,
3268+ gint *out_pos)
3269+{
3270+ gint i;
3271+ gint n_elements;
3272+ GMenuItem *item = NULL;
3273+
3274+ n_elements = g_menu_model_get_n_items (G_MENU_MODEL (menu));
3275+
3276+ for (i = 0; i < n_elements && item == NULL; i++)
3277+ {
3278+ GVariant *attr;
3279+
3280+ item = g_menu_item_new_from_model (G_MENU_MODEL (menu), i);
3281+ attr = g_menu_item_get_attribute_value (item, G_MENU_ATTRIBUTE_ACTION, G_VARIANT_TYPE_STRING);
3282+
3283+ if (!g_str_equal (action, g_variant_get_string (attr, NULL)))
3284+ g_clear_object (&item);
3285+
3286+ g_variant_unref (attr);
3287+ }
3288+
3289+ if (item && out_pos)
3290+ *out_pos = i - 1;
3291+
3292+ return item;
3293+}
3294+
3295+static void
3296+g_menu_replace_item (GMenu *menu,
3297+ gint pos,
3298+ GMenuItem *item)
3299+{
3300+ g_menu_remove (menu, pos);
3301+ g_menu_insert_item (menu, pos, item);
3302+}
3303+
3304+/**
3305+ * messaging_menu_app_set_source_label:
3306+ * @app: a #MessagingMenuApp
3307+ * @source_id: a source id
3308+ * @label: the new label for the source
3309+ *
3310+ * Changes the label of @source_id to @label.
3311+ */
3312+void
3313+messaging_menu_app_set_source_label (MessagingMenuApp *app,
3314+ const gchar *source_id,
3315+ const gchar *label)
3316+{
3317+ gint pos;
3318+ GMenuItem *item;
3319+
3320+ g_return_if_fail (MESSAGING_MENU_IS_APP (app));
3321+ g_return_if_fail (source_id != NULL);
3322+ g_return_if_fail (label != NULL);
3323+
3324+ item = g_menu_find_item_with_action (app->menu, source_id, &pos);
3325+ if (item == NULL)
3326+ return;
3327+
3328+ g_menu_item_set_attribute (item, G_MENU_ATTRIBUTE_LABEL, "s", label);
3329+ g_menu_replace_item (app->menu, pos, item);
3330+
3331+ g_object_unref (item);
3332+}
3333+
3334+/**
3335+ * messaging_menu_app_set_source_icon:
3336+ * @app: a #MessagingMenuApp
3337+ * @source_id: a source id
3338+ * @icon: (allow-none): the new icon for the source
3339+ *
3340+ * Changes the icon of @source_id to @icon.
3341+ */
3342+void
3343+messaging_menu_app_set_source_icon (MessagingMenuApp *app,
3344+ const gchar *source_id,
3345+ GIcon *icon)
3346+{
3347+ gint pos;
3348+ GMenuItem *item;
3349+
3350+ g_return_if_fail (MESSAGING_MENU_IS_APP (app));
3351+ g_return_if_fail (source_id != NULL);
3352+
3353+ item = g_menu_find_item_with_action (app->menu, source_id, &pos);
3354+ if (item == NULL)
3355+ return;
3356+
3357+ if (icon)
3358+ {
3359+ gchar *iconstr;
3360+
3361+ iconstr = g_icon_to_string (icon);
3362+ g_menu_item_set_attribute (item, "x-canonical-icon", "s", iconstr);
3363+
3364+ g_free (iconstr);
3365+ }
3366+ else
3367+ {
3368+ g_menu_item_set_attribute_value (item, "x-canonical-icon", NULL);
3369+ }
3370+
3371+ g_menu_replace_item (app->menu, pos, item);
3372+
3373+ g_object_unref (item);
3374+}
3375+
3376+/**
3377+ * messaging_menu_app_set_source_count:
3378+ * @app: a #MessagingMenuApp
3379+ * @source_id: a source id
3380+ * @count: the new count for the source
3381+ *
3382+ * Updates the count of @source_id to @count.
3383+ */
3384+void messaging_menu_app_set_source_count (MessagingMenuApp *app,
3385+ const gchar *source_id,
3386+ guint count)
3387+{
3388+ messaging_menu_app_set_source_action (app, source_id, count, 0, "");
3389+}
3390+
3391+/**
3392+ * messaging_menu_app_set_source_time:
3393+ * @app: a #MessagingMenuApp
3394+ * @source_id: a source id
3395+ * @time: the new time for the source, in microseconds
3396+ *
3397+ * Updates the time of @source_id to @time.
3398+ */
3399+void
3400+messaging_menu_app_set_source_time (MessagingMenuApp *app,
3401+ const gchar *source_id,
3402+ gint64 time)
3403+{
3404+ messaging_menu_app_set_source_action (app, source_id, 0, time, "");
3405+}
3406+
3407+/**
3408+ * messaging_menu_app_set_source_string:
3409+ * @app: a #MessagingMenuApp
3410+ * @source_id: a source id
3411+ * @str: the new string for the source
3412+ *
3413+ * Updates the string displayed next to @source_id to @str.
3414+ */
3415+void
3416+messaging_menu_app_set_source_string (MessagingMenuApp *app,
3417+ const gchar *source_id,
3418+ const gchar *str)
3419+{
3420+ messaging_menu_app_set_source_action (app, source_id, 0, 0, str);
3421+}
3422+
3423+/**
3424+ * messaging_menu_app_draw_attention:
3425+ * @app: a #MessagingMenuApp
3426+ * @source_id: a source id
3427+ *
3428+ * Indicates that @source_id has important unread messages. Currently, this
3429+ * means that the messaging menu's envelope icon will turn blue.
3430+ *
3431+ * Use messaging_menu_app_remove_attention() to stop indicating that the source
3432+ * needs attention.
3433+ */
3434+void
3435+messaging_menu_app_draw_attention (MessagingMenuApp *app,
3436+ const gchar *source_id)
3437+{
3438+ messaging_menu_app_set_draws_attention (app, source_id, TRUE);
3439+}
3440+
3441+/**
3442+ * messaging_menu_app_remove_attention:
3443+ * @app: a #MessagingMenuApp
3444+ * @source_id: a source id
3445+ *
3446+ * Stop indicating that @source_id needs attention.
3447+ *
3448+ * This function does not need to be called when the source is removed
3449+ * with messaging_menu_app_remove_source() or the user has activated the
3450+ * source.
3451+ *
3452+ * Use messaging_menu_app_draw_attention() to make @source_id draw attention
3453+ * again.
3454+ */
3455+void
3456+messaging_menu_app_remove_attention (MessagingMenuApp *app,
3457+ const gchar *source_id)
3458+{
3459+ messaging_menu_app_set_draws_attention (app, source_id, TRUE);
3460+}
3461
3462=== added file 'libmessaging-menu/messaging-menu.h'
3463--- libmessaging-menu/messaging-menu.h 1970-01-01 00:00:00 +0000
3464+++ libmessaging-menu/messaging-menu.h 2013-06-07 21:39:23 +0000
3465@@ -0,0 +1,148 @@
3466+/*
3467+ * Copyright 2012 Canonical Ltd.
3468+ *
3469+ * This program is free software: you can redistribute it and/or modify it
3470+ * under the terms of the GNU General Public License version 3, as
3471+ * published by the Free Software Foundation.
3472+ *
3473+ * This program is distributed in the hope that it will be useful, but
3474+ * WITHOUT ANY WARRANTY; without even the implied warranties of
3475+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
3476+ * PURPOSE. See the GNU General Public License for more details.
3477+ *
3478+ * You should have received a copy of the GNU General Public License along
3479+ * with this program. If not, see <http://www.gnu.org/licenses/>.
3480+ *
3481+ * Authors:
3482+ * Lars Uebernickel <lars.uebernickel@canonical.com>
3483+ */
3484+
3485+#ifndef __messaging_menu_h__
3486+#define __messaging_menu_h__
3487+
3488+#include <gio/gio.h>
3489+
3490+G_BEGIN_DECLS
3491+
3492+#define MESSAGING_MENU_TYPE_APP messaging_menu_app_get_type()
3493+#define MESSAGING_MENU_APP(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MESSAGING_MENU_TYPE_APP, MessagingMenuApp))
3494+#define MESSAGING_MENU_APP_CLASS(c) (G_TYPE_CHECK_CLASS_CAST ((c), MESSAGING_MENU_TYPE_APP, MessagingMenuAppClass))
3495+#define MESSAGING_MENU_IS_APP(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MESSAGING_MENU_TYPE_APP))
3496+
3497+/**
3498+ * MessagingMenuStatus:
3499+ * @MESSAGING_MENU_STATUS_AVAILABLE: available
3500+ * @MESSAGING_MENU_STATUS_AWAY: away
3501+ * @MESSAGING_MENU_STATUS_BUSY: busy
3502+ * @MESSAGING_MENU_STATUS_INVISIBLE: invisible
3503+ * @MESSAGING_MENU_STATUS_OFFLINE: offline
3504+ *
3505+ * An enumeration for the possible chat statuses the messaging menu can be in.
3506+ */
3507+typedef enum {
3508+ MESSAGING_MENU_STATUS_AVAILABLE,
3509+ MESSAGING_MENU_STATUS_AWAY,
3510+ MESSAGING_MENU_STATUS_BUSY,
3511+ MESSAGING_MENU_STATUS_INVISIBLE,
3512+ MESSAGING_MENU_STATUS_OFFLINE
3513+} MessagingMenuStatus;
3514+
3515+
3516+typedef GObjectClass MessagingMenuAppClass;
3517+typedef struct _MessagingMenuApp MessagingMenuApp;
3518+
3519+GType messaging_menu_app_get_type (void) G_GNUC_CONST;
3520+
3521+MessagingMenuApp * messaging_menu_app_new (const gchar *desktop_id);
3522+
3523+void messaging_menu_app_register (MessagingMenuApp *app);
3524+void messaging_menu_app_unregister (MessagingMenuApp *app);
3525+
3526+void messaging_menu_app_set_status (MessagingMenuApp *app,
3527+ MessagingMenuStatus status);
3528+
3529+void messaging_menu_app_insert_source (MessagingMenuApp *app,
3530+ gint position,
3531+ const gchar *id,
3532+ GIcon *icon,
3533+ const gchar *label);
3534+
3535+void messaging_menu_app_append_source (MessagingMenuApp *app,
3536+ const gchar *id,
3537+ GIcon *icon,
3538+ const gchar *label);
3539+
3540+void messaging_menu_app_insert_source_with_count (MessagingMenuApp *app,
3541+ gint position,
3542+ const gchar *id,
3543+ GIcon *icon,
3544+ const gchar *label,
3545+ guint count);
3546+
3547+void messaging_menu_app_append_source_with_count (MessagingMenuApp *app,
3548+ const gchar *id,
3549+ GIcon *icon,
3550+ const gchar *label,
3551+ guint count);
3552+
3553+void messaging_menu_app_insert_source_with_time (MessagingMenuApp *app,
3554+ gint position,
3555+ const gchar *id,
3556+ GIcon *icon,
3557+ const gchar *label,
3558+ gint64 time);
3559+
3560+void messaging_menu_app_append_source_with_time (MessagingMenuApp *app,
3561+ const gchar *id,
3562+ GIcon *icon,
3563+ const gchar *label,
3564+ gint64 time);
3565+
3566+void messaging_menu_app_append_source_with_string (MessagingMenuApp *app,
3567+ const gchar *id,
3568+ GIcon *icon,
3569+ const gchar *label,
3570+ const gchar *str);
3571+
3572+void messaging_menu_app_insert_source_with_string (MessagingMenuApp *app,
3573+ gint position,
3574+ const gchar *id,
3575+ GIcon *icon,
3576+ const gchar *label,
3577+ const gchar *str);
3578+
3579+void messaging_menu_app_remove_source (MessagingMenuApp *app,
3580+ const gchar *source_id);
3581+
3582+gboolean messaging_menu_app_has_source (MessagingMenuApp *app,
3583+ const gchar *source_id);
3584+
3585+void messaging_menu_app_set_source_label (MessagingMenuApp *app,
3586+ const gchar *source_id,
3587+ const gchar *label);
3588+
3589+void messaging_menu_app_set_source_icon (MessagingMenuApp *app,
3590+ const gchar *source_id,
3591+ GIcon *icon);
3592+
3593+void messaging_menu_app_set_source_count (MessagingMenuApp *app,
3594+ const gchar *source_id,
3595+ guint count);
3596+
3597+void messaging_menu_app_set_source_time (MessagingMenuApp *app,
3598+ const gchar *source_id,
3599+ gint64 time);
3600+
3601+void messaging_menu_app_set_source_string (MessagingMenuApp *app,
3602+ const gchar *source_id,
3603+ const gchar *str);
3604+
3605+void messaging_menu_app_draw_attention (MessagingMenuApp *app,
3606+ const gchar *source_id);
3607+
3608+void messaging_menu_app_remove_attention (MessagingMenuApp *app,
3609+ const gchar *source_id);
3610+
3611+G_END_DECLS
3612+
3613+#endif
3614
3615=== added file 'libmessaging-menu/messaging-menu.pc.in'
3616--- libmessaging-menu/messaging-menu.pc.in 1970-01-01 00:00:00 +0000
3617+++ libmessaging-menu/messaging-menu.pc.in 2013-06-07 21:39:23 +0000
3618@@ -0,0 +1,11 @@
3619+prefix=@prefix@
3620+exec_prefix=@exec_prefix@
3621+libdir=@libdir@
3622+includedir=@includedir@/messaging-menu
3623+
3624+Name: Messaging Menu Library
3625+Description: Messaging Menu client library
3626+Version: @VERSION@
3627+Requires: gio-unix-2.0
3628+Libs: -L${libdir} -lmessaging-menu
3629+Cflags: -I${includedir}
3630
3631=== added directory 'm4'
3632=== added file 'm4/ax_python_module.m4'
3633--- m4/ax_python_module.m4 1970-01-01 00:00:00 +0000
3634+++ m4/ax_python_module.m4 2013-06-07 21:39:23 +0000
3635@@ -0,0 +1,49 @@
3636+# ===========================================================================
3637+# http://www.gnu.org/software/autoconf-archive/ax_python_module.html
3638+# ===========================================================================
3639+#
3640+# SYNOPSIS
3641+#
3642+# AX_PYTHON_MODULE(modname[, fatal])
3643+#
3644+# DESCRIPTION
3645+#
3646+# Checks for Python module.
3647+#
3648+# If fatal is non-empty then absence of a module will trigger an error.
3649+#
3650+# LICENSE
3651+#
3652+# Copyright (c) 2008 Andrew Collier <colliera@ukzn.ac.za>
3653+#
3654+# Copying and distribution of this file, with or without modification, are
3655+# permitted in any medium without royalty provided the copyright notice
3656+# and this notice are preserved. This file is offered as-is, without any
3657+# warranty.
3658+
3659+#serial 5
3660+
3661+AU_ALIAS([AC_PYTHON_MODULE], [AX_PYTHON_MODULE])
3662+AC_DEFUN([AX_PYTHON_MODULE],[
3663+ if test -z $PYTHON;
3664+ then
3665+ PYTHON="python"
3666+ fi
3667+ PYTHON_NAME=`basename $PYTHON`
3668+ AC_MSG_CHECKING($PYTHON_NAME module: $1)
3669+ $PYTHON -c "import $1" 2>/dev/null
3670+ if test $? -eq 0;
3671+ then
3672+ AC_MSG_RESULT(yes)
3673+ eval AS_TR_CPP(HAVE_PYMOD_$1)=yes
3674+ else
3675+ AC_MSG_RESULT(no)
3676+ eval AS_TR_CPP(HAVE_PYMOD_$1)=no
3677+ #
3678+ if test -n "$2"
3679+ then
3680+ AC_MSG_ERROR(failed to find required module $1)
3681+ exit 1
3682+ fi
3683+ fi
3684+])
3685
3686=== added file 'm4/gcov.m4'
3687--- m4/gcov.m4 1970-01-01 00:00:00 +0000
3688+++ m4/gcov.m4 2013-06-07 21:39:23 +0000
3689@@ -0,0 +1,86 @@
3690+# Checks for existence of coverage tools:
3691+# * gcov
3692+# * lcov
3693+# * genhtml
3694+# * gcovr
3695+#
3696+# Sets ac_cv_check_gcov to yes if tooling is present
3697+# and reports the executables to the variables LCOV, GCOVR and GENHTML.
3698+AC_DEFUN([AC_TDD_GCOV],
3699+[
3700+ AC_ARG_ENABLE(gcov,
3701+ AS_HELP_STRING([--enable-gcov],
3702+ [enable coverage testing with gcov]),
3703+ [use_gcov=$enableval], [use_gcov=no])
3704+
3705+ if test "x$use_gcov" = "xyes"; then
3706+ # we need gcc:
3707+ if test "$GCC" != "yes"; then
3708+ AC_MSG_ERROR([GCC is required for --enable-gcov])
3709+ fi
3710+
3711+ # Check if ccache is being used
3712+ AC_CHECK_PROG(SHTOOL, shtool, shtool)
3713+ case `$SHTOOL path $CC` in
3714+ *ccache*[)] gcc_ccache=yes;;
3715+ *[)] gcc_ccache=no;;
3716+ esac
3717+
3718+ if test "$gcc_ccache" = "yes" && (test -z "$CCACHE_DISABLE" || test "$CCACHE_DISABLE" != "1"); then
3719+ AC_MSG_ERROR([ccache must be disabled when --enable-gcov option is used. You can disable ccache by setting environment variable CCACHE_DISABLE=1.])
3720+ fi
3721+
3722+ lcov_version_list="1.6 1.7 1.8 1.9"
3723+ AC_CHECK_PROG(LCOV, lcov, lcov)
3724+ AC_CHECK_PROG(GENHTML, genhtml, genhtml)
3725+
3726+ if test "$LCOV"; then
3727+ AC_CACHE_CHECK([for lcov version], glib_cv_lcov_version, [
3728+ glib_cv_lcov_version=invalid
3729+ lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'`
3730+ for lcov_check_version in $lcov_version_list; do
3731+ if test "$lcov_version" = "$lcov_check_version"; then
3732+ glib_cv_lcov_version="$lcov_check_version (ok)"
3733+ fi
3734+ done
3735+ ])
3736+ else
3737+ lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list"
3738+ AC_MSG_ERROR([$lcov_msg])
3739+ fi
3740+
3741+ case $glib_cv_lcov_version in
3742+ ""|invalid[)]
3743+ lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)."
3744+ AC_MSG_ERROR([$lcov_msg])
3745+ LCOV="exit 0;"
3746+ ;;
3747+ esac
3748+
3749+ if test -z "$GENHTML"; then
3750+ AC_MSG_ERROR([Could not find genhtml from the lcov package])
3751+ fi
3752+
3753+ ac_cv_check_gcov=yes
3754+ ac_cv_check_lcov=yes
3755+
3756+ # Remove all optimization flags from CFLAGS
3757+ changequote({,})
3758+ CFLAGS=`echo "$CFLAGS" | $SED -e 's/-O[0-9]*//g'`
3759+ changequote([,])
3760+
3761+ # Add the special gcc flags
3762+ COVERAGE_CFLAGS="-O0 -fprofile-arcs -ftest-coverage"
3763+ COVERAGE_CXXFLAGS="-O0 -fprofile-arcs -ftest-coverage"
3764+ COVERAGE_LDFLAGS="-lgcov"
3765+
3766+ # Check availability of gcovr
3767+ AC_CHECK_PROG(GCOVR, gcovr, gcovr)
3768+ if test -z "$GCOVR"; then
3769+ ac_cv_check_gcovr=no
3770+ else
3771+ ac_cv_check_gcovr=yes
3772+ fi
3773+
3774+fi
3775+]) # AC_TDD_GCOV
3776
3777=== added file 'm4/gtest.m4'
3778--- m4/gtest.m4 1970-01-01 00:00:00 +0000
3779+++ m4/gtest.m4 2013-06-07 21:39:23 +0000
3780@@ -0,0 +1,63 @@
3781+# Copyright (C) 2012 Canonical, Ltd.
3782+#
3783+# Permission is hereby granted, free of charge, to any person obtaining a copy
3784+# of this software and associated documentation files (the "Software"), to deal
3785+# in the Software without restriction, including without limitation the rights
3786+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3787+# copies of the Software, and to permit persons to whom the Software is
3788+# furnished to do so, subject to the following conditions:
3789+#
3790+# The above copyright notice and this permission notice (including the next
3791+# paragraph) shall be included in all copies or substantial portions of the
3792+# Software.
3793+#
3794+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3795+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3796+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3797+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3798+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3799+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3800+# SOFTWARE.
3801+
3802+# Checks whether the gtest source is available on the system. Allows for
3803+# adjusting the include and source path. Sets have_gtest=yes if the source is
3804+# present. Sets GTEST_CPPFLAGS and GTEST_SOURCE to the preprocessor flags and
3805+# source location respectively.
3806+AC_DEFUN([CHECK_GTEST],
3807+[
3808+ AC_ARG_WITH([gtest-include-path],
3809+ [AS_HELP_STRING([--with-gtest-include-path],
3810+ [location of the Google test headers])],
3811+ [GTEST_CPPFLAGS="-I$withval"])
3812+
3813+ AC_ARG_WITH([gtest-source-path],
3814+ [AS_HELP_STRING([--with-gtest-source-path],
3815+ [location of the Google test sources, defaults to /usr/src/gtest])],
3816+ [GTEST_SOURCE="$withval"],
3817+ [GTEST_SOURCE="/usr/src/gtest"])
3818+
3819+ GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"
3820+
3821+ AC_LANG_PUSH([C++])
3822+
3823+ tmp_CPPFLAGS="$CPPFLAGS"
3824+ CPPFLAGS="$CPPFLAGS $GTEST_CPPFLAGS"
3825+
3826+ AC_CHECK_HEADER([gtest/gtest.h])
3827+
3828+ CPPFLAGS="$tmp_CPPFLAGS"
3829+
3830+ AC_LANG_POP
3831+
3832+ AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
3833+ [$GTEST_SOURCE/src/gtest_main.cc],
3834+ [have_gtest_source=yes],
3835+ [have_gtest_source=no])
3836+
3837+ AS_IF([test "x$ac_cv_header_gtest_gtest_h" = xyes -a \
3838+ "x$have_gtest_source" = xyes],
3839+ [have_gtest=yes]
3840+ [AC_SUBST(GTEST_CPPFLAGS)]
3841+ [AC_SUBST(GTEST_SOURCE)],
3842+ [have_gtest=no])
3843+]) # CHECK_GTEST
3844
3845=== modified file 'po/POTFILES.in'
3846--- po/POTFILES.in 2011-07-02 14:42:05 +0000
3847+++ po/POTFILES.in 2013-06-07 21:39:23 +0000
3848@@ -1,9 +1,3 @@
3849 [encoding: UTF-8]
3850-src/messages-service-dbus.c
3851 src/indicator-messages.c
3852 src/messages-service.c
3853-src/default-applications.c
3854-src/launcher-menu-item.c
3855-src/im-menu-item.c
3856-src/app-menu-item.c
3857-src/status-items.c
3858
3859=== added file 'po/indicator-messages.pot'
3860--- po/indicator-messages.pot 1970-01-01 00:00:00 +0000
3861+++ po/indicator-messages.pot 2013-06-07 21:39:23 +0000
3862@@ -0,0 +1,46 @@
3863+# SOME DESCRIPTIVE TITLE.
3864+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3865+# This file is distributed under the same license as the PACKAGE package.
3866+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
3867+#
3868+#, fuzzy
3869+msgid ""
3870+msgstr ""
3871+"Project-Id-Version: PACKAGE VERSION\n"
3872+"Report-Msgid-Bugs-To: \n"
3873+"POT-Creation-Date: 2012-11-16 14:53+0100\n"
3874+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
3875+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
3876+"Language-Team: LANGUAGE <LL@li.org>\n"
3877+"Language: \n"
3878+"MIME-Version: 1.0\n"
3879+"Content-Type: text/plain; charset=CHARSET\n"
3880+"Content-Transfer-Encoding: 8bit\n"
3881+
3882+#: ../src/messages-service.c:329
3883+msgid "Messages"
3884+msgstr ""
3885+
3886+#: ../src/messages-service.c:552
3887+msgid "Available"
3888+msgstr ""
3889+
3890+#: ../src/messages-service.c:553
3891+msgid "Away"
3892+msgstr ""
3893+
3894+#: ../src/messages-service.c:554
3895+msgid "Busy"
3896+msgstr ""
3897+
3898+#: ../src/messages-service.c:555
3899+msgid "Invisible"
3900+msgstr ""
3901+
3902+#: ../src/messages-service.c:556
3903+msgid "Offline"
3904+msgstr ""
3905+
3906+#: ../src/messages-service.c:659
3907+msgid "Clear"
3908+msgstr ""
3909
3910=== modified file 'src/Makefile.am'
3911--- src/Makefile.am 2011-07-08 19:46:06 +0000
3912+++ src/Makefile.am 2013-06-07 21:39:23 +0000
3913@@ -15,262 +15,80 @@
3914 messaginglib_LTLIBRARIES = libmessaging.la
3915 libmessaging_la_SOURCES = \
3916 indicator-messages.c \
3917- gen-messages-service.xml.h \
3918- gen-messages-service.xml.c \
3919+ ido-menu-item.c \
3920+ ido-menu-item.h \
3921+ im-app-menu-item.c \
3922+ im-app-menu-item.h \
3923+ im-source-menu-item.c \
3924+ im-source-menu-item.h \
3925+ ido-detail-label.c \
3926+ ido-detail-label.h \
3927+ indicator-messages-service.c \
3928+ indicator-messages-service.h
3929 dbus-data.h
3930 libmessaging_la_CFLAGS = \
3931 $(APPLET_CFLAGS) \
3932+ $(COVERAGE_CFLAGS) \
3933 -Wall \
3934 -Wl,-Bsymbolic-functions \
3935 -Wl,-z,defs \
3936 -Wl,--as-needed \
3937 -Werror \
3938 -DG_LOG_DOMAIN=\"Indicator-Messages\"
3939-libmessaging_la_LIBADD = $(APPLET_LIBS)
3940-libmessaging_la_LDFLAGS = -module -avoid-version
3941+libmessaging_la_LIBADD = $(APPLET_LIBS) -lm
3942+libmessaging_la_LDFLAGS = \
3943+ $(COVERAGE_LDFLAGS) \
3944+ -module -avoid-version
3945
3946 ######################################
3947 # Building the messages service
3948 ######################################
3949
3950 indicator_messages_service_SOURCES = \
3951- default-applications.h \
3952- default-applications.c \
3953 messages-service.c \
3954- messages-service-dbus.c \
3955- messages-service-dbus.h \
3956- gen-messages-service.xml.h \
3957- gen-messages-service.xml.c \
3958- im-menu-item.c \
3959- im-menu-item.h \
3960- app-menu-item.c \
3961- app-menu-item.h \
3962- launcher-menu-item.c \
3963- launcher-menu-item.h \
3964- seen-db.c \
3965- seen-db.h \
3966- dirs.h \
3967+ indicator-messages-service.c \
3968+ indicator-messages-service.h \
3969+ app-section.c \
3970+ app-section.h \
3971 dbus-data.h \
3972- \
3973- status-items.c \
3974- status-items.h
3975+ gactionmuxer.c \
3976+ gactionmuxer.h \
3977+ gsettingsstrv.c \
3978+ gsettingsstrv.h \
3979+ gmenuutils.c \
3980+ gmenuutils.h
3981
3982 indicator_messages_service_CFLAGS = \
3983 $(APPLET_CFLAGS) \
3984+ $(COVERAGE_CFLAGS) \
3985 -Wall \
3986 -Wl,-Bsymbolic-functions \
3987 -Wl,-z,defs \
3988 -Wl,--as-needed \
3989 -Werror \
3990- -DG_LOG_DOMAIN=\"Indicator-Messages\" \
3991- -DSTATUS_PROVIDER_DIR=\"$(STATUS_PROVIDER_DIR)\"
3992+ -DG_LOG_DOMAIN=\"Indicator-Messages\"
3993
3994 indicator_messages_service_LDADD = \
3995- $(APPLET_LIBS) \
3996- libindicator-messages-status-provider.la
3997-
3998-gen-%.xml.h: %.xml
3999- @echo "Building $@ from $<"
4000- @echo "extern const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<))));" > $@
4001-
4002-gen-%.xml.c: %.xml
4003- @echo "Building $@ from $<"
4004- echo "const char * _$(subst -,_,$(subst .,_,$(basename $(notdir $<)))) = " > $@
4005- @sed -e "s:\":\\\\\":g" -e s:^:\": -e s:\$$:\\\\n\": $< >> $@
4006- @echo ";" >> $@
4007+ $(APPLET_LIBS)
4008+
4009+indicator_messages_service_LDFLAGS = \
4010+ $(COVERAGE_LDFLAGS)
4011+
4012+indicator-messages-service.c: $(top_srcdir)/src/messages-service.xml
4013+ $(AM_V_GEN) gdbus-codegen \
4014+ --interface-prefix com.canonical.indicator.messages. \
4015+ --generate-c-code indicator-messages-service \
4016+ --c-namespace IndicatorMessages \
4017+ $^
4018+indicator-messages-service.h: indicator-messages-service.c
4019
4020 BUILT_SOURCES += \
4021- gen-messages-service.xml.h \
4022- gen-messages-service.xml.c
4023+ indicator-messages-service.c \
4024+ indicator-messages-service.h
4025
4026 EXTRA_DIST += \
4027 messages-service.xml
4028
4029-######################################
4030-# Status Provider Library
4031-######################################
4032-
4033-STATUS_PROVIDER_API_VERSION = 1
4034-STATUS_PROVIDER_DIR = $(libexecdir)/status-providers/$(STATUS_PROVIDER_API_VERSION)
4035-statusprovidersdir = $(STATUS_PROVIDER_DIR)
4036-statusproviders_LTLIBRARIES =
4037-
4038-EXTRA_DIST += \
4039- indicator-messages-status-provider-0.5.pc.in.in
4040-CLEANFILES += \
4041- indicator-messages-status-provider-0.5.pc
4042-
4043-pkgconfig_DATA = indicator-messages-status-provider-0.5.pc
4044-pkgconfigdir = $(libdir)/pkgconfig
4045-
4046-%.pc: %.pc.in
4047- sed \
4048- -e "s|\@status_provider_dir\@|$(STATUS_PROVIDER_DIR)|" \
4049- -e "s|\@status_provider_api_version\@|$(STATUS_PROVIDER_API_VERSION)|" \
4050- $< > $@
4051-
4052-lib_LTLIBRARIES = \
4053- libindicator-messages-status-provider.la
4054-
4055-libindicator_messages_status_provider_la_HEADERS = \
4056- status-provider.h
4057-
4058-libindicator_messages_status_provider_la_SOURCES = \
4059- $(libindicator_messages_status_provider_HEADERS) \
4060- status-provider.c
4061-
4062-libindicator_messages_status_provider_ladir = \
4063- $(includedir)/libindicator-messages-status-provider-$(STATUS_PROVIDER_API_VERSION)/
4064-
4065-libindicator_messages_status_provider_la_LDFLAGS = \
4066- -version-info $(STATUS_PROVIDER_API_VERSION):0:0 \
4067- -no-undefined \
4068- -export-symbols-regex "^[^_].*"
4069-
4070-libindicator_messages_status_provider_la_LIBADD = \
4071- $(APPLET_LIBS)
4072-
4073-libindicator_messages_status_provider_la_CFLAGS = \
4074- $(APPLET_CFLAGS) \
4075- -Wall -Werror
4076-
4077-######################################
4078-# Status provider: Pidgin
4079-######################################
4080-
4081-statusproviders_LTLIBRARIES += libpidgin.la
4082-libpidgin_la_SOURCES = \
4083- status-provider-pidgin.h \
4084- status-provider-pidgin.c \
4085- status-provider-pidgin-marshal.h \
4086- status-provider-pidgin-marshal.c
4087-libpidgin_la_CFLAGS = \
4088- $(APPLET_CFLAGS) \
4089- $(STATUS_PROVIDER_PIDGIN_CFLAGS) \
4090- -Wall -Werror \
4091- -DG_LOG_DOMAIN=\"Status-Provider-Pidgin\"
4092-libpidgin_la_LIBADD = \
4093- libindicator-messages-status-provider.la \
4094- $(APPLET_LIBS) \
4095- $(STATUS_PROVIDER_PIDGIN_LIBS)
4096-libpidgin_la_LDFLAGS = -module -avoid-version
4097-
4098-status-provider-pidgin-marshal.h: $(srcdir)/status-provider-pidgin.list
4099- glib-genmarshal --header \
4100- --prefix=_status_provider_pidgin_marshal $(srcdir)/status-provider-pidgin.list \
4101- > status-provider-pidgin-marshal.h
4102-
4103-status-provider-pidgin-marshal.c: $(srcdir)/status-provider-pidgin.list
4104- glib-genmarshal --body \
4105- --prefix=_status_provider_pidgin_marshal $(srcdir)/status-provider-pidgin.list \
4106- > status-provider-pidgin-marshal.c
4107-
4108-BUILT_SOURCES += \
4109- status-provider-pidgin-marshal.h \
4110- status-provider-pidgin-marshal.c
4111-
4112-EXTRA_DIST += \
4113- status-provider-pidgin.list
4114-
4115-######################################
4116-# Status provider: Mission Control 4
4117-######################################
4118-
4119-statusproviders_LTLIBRARIES += libtelepathy.la
4120-libtelepathy_la_SOURCES = \
4121- status-provider-telepathy.h \
4122- status-provider-telepathy.c \
4123- status-provider-telepathy-marshal.h \
4124- status-provider-telepathy-marshal.c
4125-libtelepathy_la_CFLAGS = \
4126- $(APPLET_CFLAGS) \
4127- $(STATUS_PROVIDER_TELEPATHY_CFLAGS) \
4128- -Wall -Werror \
4129- -DG_LOG_DOMAIN=\"Status-Provider-Telepathy\"
4130-libtelepathy_la_LIBADD = \
4131- libindicator-messages-status-provider.la \
4132- $(APPLET_LIBS) \
4133- $(STATUS_PROVIDER_TELEPATHY_LIBS)
4134-libtelepathy_la_LDFLAGS = -module -avoid-version
4135-
4136-status-provider-telepathy-marshal.h: $(srcdir)/status-provider-telepathy.list
4137- glib-genmarshal --header \
4138- --prefix=_status_provider_telepathy_marshal $(srcdir)/status-provider-telepathy.list \
4139- > status-provider-telepathy-marshal.h
4140-
4141-status-provider-telepathy-marshal.c: $(srcdir)/status-provider-telepathy.list
4142- glib-genmarshal --body \
4143- --prefix=_status_provider_telepathy_marshal $(srcdir)/status-provider-telepathy.list \
4144- > status-provider-telepathy-marshal.c
4145-
4146-BUILT_SOURCES += \
4147- status-provider-telepathy-marshal.h \
4148- status-provider-telepathy-marshal.c
4149-
4150-EXTRA_DIST += \
4151- status-provider-telepathy.list
4152-
4153-######################################
4154-# Status provider: Mission Control 5
4155-######################################
4156-
4157-statusproviders_LTLIBRARIES += libmc5.la
4158-libmc5_la_SOURCES = \
4159- status-provider-mc5.h \
4160- status-provider-mc5.c \
4161- status-provider-mc5-marshal.h \
4162- status-provider-mc5-marshal.c
4163-libmc5_la_CFLAGS = \
4164- $(APPLET_CFLAGS) \
4165- $(STATUS_PROVIDER_MC5_CFLAGS) \
4166- -Wall -Werror \
4167- -DG_LOG_DOMAIN=\"Status-Provider-MC5\"
4168-libmc5_la_LIBADD = \
4169- libindicator-messages-status-provider.la \
4170- $(APPLET_LIBS) \
4171- $(STATUS_PROVIDER_MC5_LIBS)
4172-libmc5_la_LDFLAGS = -module -avoid-version
4173-
4174-status-provider-mc5-marshal.h: $(srcdir)/status-provider-mc5.list
4175- glib-genmarshal --header \
4176- --prefix=_status_provider_mc5_marshal $(srcdir)/status-provider-mc5.list \
4177- > status-provider-mc5-marshal.h
4178-
4179-status-provider-mc5-marshal.c: $(srcdir)/status-provider-mc5.list
4180- glib-genmarshal --body \
4181- --prefix=_status_provider_mc5_marshal $(srcdir)/status-provider-mc5.list \
4182- > status-provider-mc5-marshal.c
4183-
4184-BUILT_SOURCES += \
4185- status-provider-mc5-marshal.h \
4186- status-provider-mc5-marshal.c
4187-
4188-EXTRA_DIST += \
4189- status-provider-mc5.list
4190-
4191-######################################
4192-# Status provider: Emesene
4193-######################################
4194-
4195-statusproviders_LTLIBRARIES += libemesene.la
4196-libemesene_la_SOURCES = \
4197- status-provider-emesene.h \
4198- status-provider-emesene.c
4199-libemesene_la_CFLAGS = \
4200- $(APPLET_CFLAGS) \
4201- $(STATUS_PROVIDER_EMESENE_CFLAGS) \
4202- -Wall -Werror \
4203- -DG_LOG_DOMAIN=\"Status-Provider-Emesene\"
4204-libemesene_la_LIBADD = \
4205- libindicator-messages-status-provider.la \
4206- $(APPLET_LIBS) \
4207- $(STATUS_PROVIDER_EMESENE_LIBS)
4208-libemesene_la_LDFLAGS = -module -avoid-version
4209-
4210-######################################
4211-# Extras
4212-######################################
4213-
4214 CLEANFILES += \
4215 $(BUILT_SOURCES)
4216
4217
4218=== renamed file 'src/app-menu-item.c' => 'src/app-section.c'
4219--- src/app-menu-item.c 2011-04-06 16:24:05 +0000
4220+++ src/app-section.c 2013-06-07 21:39:23 +0000
4221@@ -2,9 +2,10 @@
4222 An indicator to show information that is in messaging applications
4223 that the user is using.
4224
4225-Copyright 2009 Canonical Ltd.
4226+Copyright 2012 Canonical Ltd.
4227
4228 Authors:
4229+ Lars Uebernickel <lars.uebernickel@canonical.com>
4230 Ted Gould <ted@canonical.com>
4231
4232 This program is free software: you can redistribute it and/or modify it
4233@@ -26,554 +27,790 @@
4234
4235 #include <glib/gi18n.h>
4236 #include <gio/gdesktopappinfo.h>
4237-#include <libdbusmenu-glib/client.h>
4238-#include <libdbusmenu-glib/menuitem-proxy.h>
4239-#include "app-menu-item.h"
4240+#include <gio/gio.h>
4241+#include <libindicator/indicator-desktop-shortcuts.h>
4242+#include "app-section.h"
4243 #include "dbus-data.h"
4244-#include "default-applications.h"
4245-#include "seen-db.h"
4246+#include "gmenuutils.h"
4247+#include "gactionmuxer.h"
4248+
4249+struct _AppSectionPrivate
4250+{
4251+ GDesktopAppInfo * appinfo;
4252+ GFileMonitor *desktop_file_monitor;
4253+
4254+ IndicatorDesktopShortcuts * ids;
4255+
4256+ GMenu *menu;
4257+ GMenuModel *source_menu;
4258+
4259+ GSimpleActionGroup *static_shortcuts;
4260+ GActionGroup *source_actions;
4261+ GActionMuxer *muxer;
4262+
4263+ gboolean draws_attention;
4264+ gboolean uses_chat_status;
4265+ gchar *chat_status;
4266+
4267+ guint name_watch_id;
4268+};
4269
4270 enum {
4271- COUNT_CHANGED,
4272- NAME_CHANGED,
4273- SHORTCUT_ADDED,
4274- SHORTCUT_REMOVED,
4275- LAST_SIGNAL
4276-};
4277-
4278-static guint signals[LAST_SIGNAL] = { 0 };
4279-
4280-typedef struct _AppMenuItemPrivate AppMenuItemPrivate;
4281-
4282-struct _AppMenuItemPrivate
4283-{
4284- IndicateListener * listener;
4285- IndicateListenerServer * server;
4286-
4287- gchar * type;
4288- GAppInfo * appinfo;
4289- GKeyFile * keyfile;
4290- gchar * desktop;
4291- guint unreadcount;
4292-
4293- DbusmenuClient * client;
4294- DbusmenuMenuitem * root;
4295- GList * shortcuts;
4296-};
4297-
4298-#define APP_MENU_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), APP_MENU_ITEM_TYPE, AppMenuItemPrivate))
4299+ PROP_0,
4300+ PROP_APPINFO,
4301+ PROP_ACTIONS,
4302+ PROP_DRAWS_ATTENTION,
4303+ PROP_USES_CHAT_STATUS,
4304+ PROP_CHAT_STATUS,
4305+ NUM_PROPERTIES
4306+};
4307+
4308+static GParamSpec *properties[NUM_PROPERTIES];
4309+static guint destroy_signal;
4310
4311 /* Prototypes */
4312-static void app_menu_item_class_init (AppMenuItemClass *klass);
4313-static void app_menu_item_init (AppMenuItem *self);
4314-static void app_menu_item_dispose (GObject *object);
4315-static void app_menu_item_finalize (GObject *object);
4316-static void activate_cb (AppMenuItem * self, guint timestamp, gpointer data);
4317-static void count_changed (IndicateListener * listener, IndicateListenerServer * server, guint count, gpointer data);
4318-static void count_cb (IndicateListener * listener, IndicateListenerServer * server, guint value, gpointer data);
4319-static void menu_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * menupath, gpointer data);
4320-static void desktop_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * value, gpointer data);
4321-static void update_label (AppMenuItem * self);
4322+static void app_section_class_init (AppSectionClass *klass);
4323+static void app_section_init (AppSection *self);
4324+static void app_section_get_property (GObject *object,
4325+ guint property_id,
4326+ GValue *value,
4327+ GParamSpec *pspec);
4328+static void app_section_set_property (GObject *object,
4329+ guint property_id,
4330+ const GValue *value,
4331+ GParamSpec *pspec);
4332+static void app_section_dispose (GObject *object);
4333+static void app_section_finalize (GObject *object);
4334+static void activate_cb (GSimpleAction *action,
4335+ GVariant *param,
4336+ gpointer userdata);
4337+static void launch_action_change_state (GSimpleAction *action,
4338+ GVariant *value,
4339+ gpointer user_data);
4340+static void app_section_set_app_info (AppSection *self,
4341+ GDesktopAppInfo *appinfo);
4342+static gboolean any_action_draws_attention (GActionGroup *group,
4343+ const gchar *ignored_action);
4344+static void action_added (GActionGroup *group,
4345+ const gchar *action_name,
4346+ gpointer user_data);
4347+static void action_state_changed (GActionGroup *group,
4348+ const gchar *action_name,
4349+ GVariant *value,
4350+ gpointer user_data);
4351+static void action_removed (GActionGroup *group,
4352+ const gchar *action_name,
4353+ gpointer user_data);
4354+static gboolean action_draws_attention (GVariant *state);
4355+static void desktop_file_changed_cb (GFileMonitor *monitor,
4356+ GFile *file,
4357+ GFile *other_file,
4358+ GFileMonitorEvent event,
4359+ gpointer user_data);
4360
4361 /* GObject Boilerplate */
4362-G_DEFINE_TYPE (AppMenuItem, app_menu_item, DBUSMENU_TYPE_MENUITEM);
4363+G_DEFINE_TYPE (AppSection, app_section, G_TYPE_OBJECT);
4364
4365 static void
4366-app_menu_item_class_init (AppMenuItemClass *klass)
4367+app_section_class_init (AppSectionClass *klass)
4368 {
4369 GObjectClass *object_class = G_OBJECT_CLASS (klass);
4370
4371- g_type_class_add_private (klass, sizeof (AppMenuItemPrivate));
4372-
4373- object_class->dispose = app_menu_item_dispose;
4374- object_class->finalize = app_menu_item_finalize;
4375-
4376- signals[COUNT_CHANGED] = g_signal_new(APP_MENU_ITEM_SIGNAL_COUNT_CHANGED,
4377- G_TYPE_FROM_CLASS(klass),
4378- G_SIGNAL_RUN_LAST,
4379- G_STRUCT_OFFSET (AppMenuItemClass, count_changed),
4380- NULL, NULL,
4381- g_cclosure_marshal_VOID__UINT,
4382- G_TYPE_NONE, 1, G_TYPE_UINT);
4383- signals[NAME_CHANGED] = g_signal_new(APP_MENU_ITEM_SIGNAL_NAME_CHANGED,
4384- G_TYPE_FROM_CLASS(klass),
4385- G_SIGNAL_RUN_LAST,
4386- G_STRUCT_OFFSET (AppMenuItemClass, name_changed),
4387- NULL, NULL,
4388- g_cclosure_marshal_VOID__STRING,
4389- G_TYPE_NONE, 1, G_TYPE_STRING);
4390- signals[SHORTCUT_ADDED] = g_signal_new(APP_MENU_ITEM_SIGNAL_SHORTCUT_ADDED,
4391- G_TYPE_FROM_CLASS(klass),
4392- G_SIGNAL_RUN_LAST,
4393- G_STRUCT_OFFSET (AppMenuItemClass, shortcut_added),
4394- NULL, NULL,
4395- g_cclosure_marshal_VOID__OBJECT,
4396- G_TYPE_NONE, 1, G_TYPE_OBJECT);
4397- signals[SHORTCUT_REMOVED] = g_signal_new(APP_MENU_ITEM_SIGNAL_SHORTCUT_REMOVED,
4398- G_TYPE_FROM_CLASS(klass),
4399- G_SIGNAL_RUN_LAST,
4400- G_STRUCT_OFFSET (AppMenuItemClass, shortcut_removed),
4401- NULL, NULL,
4402- g_cclosure_marshal_VOID__OBJECT,
4403- G_TYPE_NONE, 1, G_TYPE_OBJECT);
4404-
4405- return;
4406+ g_type_class_add_private (klass, sizeof (AppSectionPrivate));
4407+
4408+ object_class->get_property = app_section_get_property;
4409+ object_class->set_property = app_section_set_property;
4410+ object_class->dispose = app_section_dispose;
4411+ object_class->finalize = app_section_finalize;
4412+
4413+ properties[PROP_APPINFO] = g_param_spec_object ("app-info",
4414+ "AppInfo",
4415+ "The GAppInfo for the app that this menu represents",
4416+ G_TYPE_APP_INFO,
4417+ G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY);
4418+
4419+ properties[PROP_ACTIONS] = g_param_spec_object ("actions",
4420+ "Actions",
4421+ "The actions exported by this application",
4422+ G_TYPE_ACTION_GROUP,
4423+ G_PARAM_READABLE);
4424+
4425+ properties[PROP_DRAWS_ATTENTION] = g_param_spec_boolean ("draws-attention",
4426+ "Draws attention",
4427+ "Whether the section currently draws attention",
4428+ FALSE,
4429+ G_PARAM_READABLE);
4430+
4431+ properties[PROP_USES_CHAT_STATUS] = g_param_spec_boolean ("uses-chat-status",
4432+ "Uses chat status",
4433+ "Whether the section uses the global chat status",
4434+ FALSE,
4435+ G_PARAM_READABLE);
4436+
4437+ properties[PROP_CHAT_STATUS] = g_param_spec_string ("chat-status",
4438+ "Chat status",
4439+ "Current chat status of the application",
4440+ NULL,
4441+ G_PARAM_READWRITE |
4442+ G_PARAM_STATIC_STRINGS);
4443+
4444+ g_object_class_install_properties (object_class, NUM_PROPERTIES, properties);
4445+
4446+ destroy_signal = g_signal_new ("destroy",
4447+ APP_SECTION_TYPE,
4448+ G_SIGNAL_RUN_FIRST,
4449+ 0,
4450+ NULL, NULL,
4451+ g_cclosure_marshal_VOID__VOID,
4452+ G_TYPE_NONE, 0);
4453 }
4454
4455 static void
4456-app_menu_item_init (AppMenuItem *self)
4457+app_section_init (AppSection *self)
4458 {
4459- g_debug("Building new App Menu Item");
4460- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4461-
4462- priv->listener = NULL;
4463- priv->server = NULL;
4464- priv->type = NULL;
4465+ AppSectionPrivate *priv;
4466+
4467+ self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
4468+ APP_SECTION_TYPE,
4469+ AppSectionPrivate);
4470+ priv = self->priv;
4471+
4472 priv->appinfo = NULL;
4473- priv->keyfile = NULL;
4474- priv->desktop = NULL;
4475- priv->unreadcount = 0;
4476-
4477- priv->client = NULL;
4478- priv->root = NULL;
4479- priv->shortcuts = NULL;
4480-
4481- dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE);
4482-
4483- return;
4484-}
4485-
4486-/* A wrapper to make the prototypes work for GFunc */
4487-static void
4488-func_unref (gpointer data, gpointer user_data)
4489-{
4490- g_signal_emit(user_data, signals[SHORTCUT_REMOVED], 0, data, TRUE);
4491- g_object_unref(G_OBJECT(data));
4492- return;
4493-}
4494-
4495-/* Disconnect the count_changed signal and unref the listener */
4496-static void
4497-app_menu_item_dispose (GObject *object)
4498-{
4499- AppMenuItem * self = APP_MENU_ITEM(object);
4500- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4501-
4502- if (priv->listener != NULL) {
4503- g_signal_handlers_disconnect_by_func(G_OBJECT(priv->listener), count_changed, self);
4504- g_object_unref(priv->listener);
4505- priv->listener = NULL;
4506- }
4507-
4508- if (priv->shortcuts != NULL) {
4509- g_list_foreach(priv->shortcuts, func_unref, object);
4510- g_list_free(priv->shortcuts);
4511- priv->shortcuts = NULL;
4512- }
4513-
4514- if (priv->root != NULL) {
4515- g_object_unref(priv->root);
4516- priv->root = NULL;
4517- }
4518-
4519- if (priv->client != NULL) {
4520- g_object_unref(priv->client);
4521- priv->client = NULL;
4522- }
4523-
4524- if (priv->appinfo != NULL) {
4525- g_object_unref(priv->appinfo);
4526- priv->appinfo = NULL;
4527- }
4528-
4529- if (priv->keyfile != NULL) {
4530- g_object_unref(priv->keyfile);
4531- priv->keyfile = NULL;
4532- }
4533-
4534- G_OBJECT_CLASS (app_menu_item_parent_class)->dispose (object);
4535-}
4536-
4537-/* Free the memory used by our type, desktop file and application
4538- info structures. */
4539-static void
4540-app_menu_item_finalize (GObject *object)
4541-{
4542- AppMenuItem * self = APP_MENU_ITEM(object);
4543- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4544-
4545- if (priv->type != NULL) {
4546- g_free(priv->type);
4547- priv->type = NULL;
4548- }
4549-
4550- if (priv->desktop != NULL) {
4551- g_free(priv->desktop);
4552- priv->desktop = NULL;
4553- }
4554-
4555- G_OBJECT_CLASS (app_menu_item_parent_class)->finalize (object);
4556-
4557- return;
4558-}
4559-
4560-AppMenuItem *
4561-app_menu_item_new (IndicateListener * listener, IndicateListenerServer * server)
4562-{
4563- AppMenuItem * self = g_object_new(APP_MENU_ITEM_TYPE, NULL);
4564-
4565- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4566-
4567- /* Copy the listener so we can use it later */
4568- priv->listener = listener;
4569- g_object_ref(G_OBJECT(listener));
4570-
4571- /* Can not ref as not real GObject */
4572- priv->server = server;
4573-
4574- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_TYPE, APPLICATION_MENUITEM_TYPE);
4575-
4576- /* Set up listener signals */
4577- g_signal_connect(G_OBJECT(listener), INDICATE_LISTENER_SIGNAL_SERVER_COUNT_CHANGED, G_CALLBACK(count_changed), self);
4578-
4579- /* Get the values we care about from the server */
4580- indicate_listener_server_get_desktop(listener, server, desktop_cb, self);
4581- indicate_listener_server_get_count(listener, server, count_cb, self);
4582- indicate_listener_server_get_menu(listener, server, menu_cb, self);
4583-
4584- g_signal_connect(G_OBJECT(self), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(activate_cb), NULL);
4585-
4586- indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_DISPLAY);
4587- indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_SERVER_SIGNAL);
4588- indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_COUNT);
4589- indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_DISPLAY);
4590- indicate_listener_server_show_interest(listener, server, INDICATE_INTEREST_INDICATOR_SIGNAL);
4591- indicate_listener_set_server_max_indicators(listener, server, MAX_NUMBER_OF_INDICATORS);
4592-
4593- return self;
4594-}
4595-
4596-static void
4597-update_label (AppMenuItem * self)
4598-{
4599- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4600- const gchar * name = get_default_name(priv->desktop);
4601-
4602- if (name == NULL) {
4603- name = app_menu_item_get_name(self);
4604- }
4605-
4606- if (priv->unreadcount > 0) {
4607- /* TRANSLATORS: This is the name of the program and the number of indicators. So it
4608- would read something like "Mail Client (5)" */
4609- gchar * label = g_strdup_printf(_("%s (%d)"), _(name), priv->unreadcount);
4610- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_NAME, label);
4611- g_free(label);
4612- } else {
4613- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_NAME, _(name));
4614- }
4615-
4616- return;
4617-}
4618-
4619-/* Callback to the signal that the server count
4620- has changed to a new value. This checks to see if
4621- it's actually changed and if so signals everyone and
4622- updates the label. */
4623-static void
4624-count_changed (IndicateListener * listener, IndicateListenerServer * server, guint count, gpointer data)
4625-{
4626- g_return_if_fail(IS_APP_MENU_ITEM(data));
4627- AppMenuItem * self = APP_MENU_ITEM(data);
4628- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4629-
4630- if (priv->unreadcount != count) {
4631- priv->unreadcount = count;
4632- update_label(self);
4633- g_signal_emit(G_OBJECT(self), signals[COUNT_CHANGED], 0, priv->unreadcount, TRUE);
4634- }
4635-
4636- return;
4637-}
4638-
4639-/* Callback for getting the count property off
4640- of the server. */
4641-static void
4642-count_cb (IndicateListener * listener, IndicateListenerServer * server, guint value, gpointer data)
4643-{
4644- count_changed(listener, server, value, data);
4645- return;
4646-}
4647-
4648-/* Callback for when we ask the server for the path
4649- to it's desktop file. We then turn it into an
4650- app structure and start sucking data out of it.
4651- Mostly the name. And the icon. */
4652-static void
4653-desktop_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * value, gpointer data)
4654-{
4655- g_return_if_fail(IS_APP_MENU_ITEM(data));
4656- AppMenuItem * self = APP_MENU_ITEM(data);
4657- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4658-
4659- if (priv->appinfo != NULL) {
4660- g_object_unref(G_OBJECT(priv->appinfo));
4661- priv->appinfo = NULL;
4662- }
4663-
4664- if (priv->desktop != NULL) {
4665- g_free(priv->desktop);
4666- priv->desktop = NULL;
4667- }
4668-
4669- if (value == NULL || value[0] == '\0') {
4670- return;
4671- }
4672-
4673- seen_db_add(value);
4674-
4675- priv->appinfo = G_APP_INFO(g_desktop_app_info_new_from_filename(value));
4676- g_return_if_fail(priv->appinfo != NULL);
4677-
4678- priv->keyfile = g_key_file_new();
4679- g_key_file_load_from_file(priv->keyfile, value, G_KEY_FILE_NONE, NULL);
4680-
4681- priv->desktop = g_strdup(value);
4682-
4683- dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
4684- dbusmenu_menuitem_property_set_bool(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_RUNNING, TRUE);
4685-
4686- update_label(self);
4687-
4688- const gchar * def_icon = get_default_icon(priv->desktop);
4689- if (def_icon == NULL) {
4690- gchar * iconstr = NULL;
4691-
4692- /* Check for the over ride key and see if we should be using that
4693- icon. If we can't get it, then go back to the app info */
4694- if (g_key_file_has_key(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, NULL) && iconstr == NULL) {
4695- GError * error = NULL;
4696-
4697- iconstr = g_key_file_get_string(priv->keyfile, G_KEY_FILE_DESKTOP_GROUP, ICON_KEY, &error);
4698-
4699- if (error != NULL) {
4700- /* Can't figure out why this would happen, but sure, let's print something */
4701- g_warning("Error getting '" ICON_KEY "' from desktop file: %s", error->message);
4702- g_error_free(error);
4703- }
4704- }
4705-
4706- /* For some reason that didn't work, let's try the app info */
4707- if (iconstr == NULL) {
4708- GIcon * icon = g_app_info_get_icon(priv->appinfo);
4709- iconstr = g_icon_to_string(icon);
4710- }
4711-
4712- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_ICON, iconstr);
4713- g_free(iconstr);
4714- } else {
4715- dbusmenu_menuitem_property_set(DBUSMENU_MENUITEM(self), APPLICATION_MENUITEM_PROP_ICON, def_icon);
4716- }
4717-
4718- g_signal_emit(G_OBJECT(self), signals[NAME_CHANGED], 0, app_menu_item_get_name(self), TRUE);
4719-
4720- return;
4721-}
4722-
4723-/* Relay this signal into causing a rebuild of the shortcuts
4724- from those above us. */
4725-static void
4726-child_added_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint position, gpointer data)
4727-{
4728- g_return_if_fail(IS_APP_MENU_ITEM(data));
4729- AppMenuItem * self = APP_MENU_ITEM(data);
4730- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4731- DbusmenuMenuitemProxy * mip = dbusmenu_menuitem_proxy_new(child);
4732-
4733- priv->shortcuts = g_list_insert(priv->shortcuts, mip, position);
4734-
4735- g_signal_emit(G_OBJECT(data), signals[SHORTCUT_ADDED], 0, mip, TRUE);
4736- return;
4737-}
4738-
4739-/* Relay this signal into causing a rebuild of the shortcuts
4740- from those above us. */
4741-static void
4742-child_removed_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, gpointer data)
4743-{
4744- g_return_if_fail(IS_APP_MENU_ITEM(data));
4745- AppMenuItem * self = APP_MENU_ITEM(data);
4746- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4747-
4748- GList * pitems = priv->shortcuts;
4749- while (pitems != NULL) {
4750- DbusmenuMenuitemProxy * mip = DBUSMENU_MENUITEM_PROXY(pitems->data);
4751-
4752- if (dbusmenu_menuitem_proxy_get_wrapped(mip) == child) {
4753- break;
4754- }
4755-
4756- pitems = g_list_next(pitems);
4757- }
4758-
4759- if (pitems != NULL) {
4760- DbusmenuMenuitemProxy * mip = DBUSMENU_MENUITEM_PROXY(pitems->data);
4761- priv->shortcuts = g_list_remove(priv->shortcuts, mip);
4762-
4763- g_signal_emit(G_OBJECT(data), signals[SHORTCUT_REMOVED], 0, mip, TRUE);
4764- g_object_unref(mip);
4765- }
4766-
4767- return;
4768-}
4769-
4770-/* Relay this signal into causing a rebuild of the shortcuts
4771- from those above us. */
4772-static void
4773-child_moved_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint newpos, guint oldpos, gpointer data)
4774-{
4775- g_return_if_fail(IS_APP_MENU_ITEM(data));
4776- AppMenuItem * self = APP_MENU_ITEM(data);
4777- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4778-
4779- DbusmenuMenuitemProxy * mip = DBUSMENU_MENUITEM_PROXY(g_list_nth_data(priv->shortcuts, oldpos));
4780-
4781- if (mip != NULL) {
4782- if (dbusmenu_menuitem_proxy_get_wrapped(mip) != child) {
4783- mip = NULL;
4784- }
4785- }
4786-
4787- if (mip != NULL) {
4788- priv->shortcuts = g_list_remove(priv->shortcuts, mip);
4789- priv->shortcuts = g_list_insert(priv->shortcuts, mip, newpos);
4790- g_signal_emit(G_OBJECT(data), signals[SHORTCUT_ADDED], 0, NULL, TRUE);
4791- }
4792-
4793- return;
4794-}
4795-
4796-/* We've got a new root. We need to proxy it and handle it's children
4797- if that's a relevant thing to do. */
4798-static void
4799-root_changed (DbusmenuClient * client, DbusmenuMenuitem * newroot, gpointer data)
4800-{
4801- g_debug("Root Changed");
4802- AppMenuItem * self = APP_MENU_ITEM(data);
4803- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4804-
4805- if (priv->root != NULL) {
4806- if (dbusmenu_menuitem_get_children(DBUSMENU_MENUITEM(priv->root)) != NULL) {
4807- g_list_foreach(priv->shortcuts, func_unref, data);
4808- g_list_free(priv->shortcuts);
4809- priv->shortcuts = NULL;
4810- }
4811- g_object_unref(priv->root);
4812- priv->root = NULL;
4813- }
4814-
4815- /* We need to proxy the new root across to the old
4816- world of indicator land. */
4817- priv->root = newroot;
4818-
4819- if (priv->root != NULL) {
4820- g_object_ref(priv->root);
4821- g_signal_connect(G_OBJECT(priv->root), DBUSMENU_MENUITEM_SIGNAL_CHILD_ADDED, G_CALLBACK(child_added_cb), self);
4822- g_signal_connect(G_OBJECT(priv->root), DBUSMENU_MENUITEM_SIGNAL_CHILD_REMOVED, G_CALLBACK(child_removed_cb), self);
4823- g_signal_connect(G_OBJECT(priv->root), DBUSMENU_MENUITEM_SIGNAL_CHILD_MOVED, G_CALLBACK(child_moved_cb), self);
4824-
4825- /* See if we have any menuitems to worry about,
4826- otherwise we'll just move along. */
4827- GList * children = dbusmenu_menuitem_get_children(DBUSMENU_MENUITEM(priv->root));
4828- if (children != NULL) {
4829- g_debug("\tProcessing %d children", g_list_length(children));
4830- while (children != NULL) {
4831- DbusmenuMenuitemProxy * mip = dbusmenu_menuitem_proxy_new(DBUSMENU_MENUITEM(children->data));
4832- priv->shortcuts = g_list_append(priv->shortcuts, mip);
4833- g_signal_emit(G_OBJECT(self), signals[SHORTCUT_ADDED], 0, mip, TRUE);
4834- children = g_list_next(children);
4835- }
4836- }
4837- }
4838-
4839- return;
4840-}
4841-
4842-/* Gets the path to menuitems if there are some. Now we need to
4843- make them special. */
4844-static void
4845-menu_cb (IndicateListener * listener, IndicateListenerServer * server, const gchar * menupath, gpointer data)
4846-{
4847- g_debug("Got Menu: %s", menupath);
4848- g_return_if_fail(IS_APP_MENU_ITEM(data));
4849- AppMenuItem * self = APP_MENU_ITEM(data);
4850- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4851-
4852- priv->client = dbusmenu_client_new(indicate_listener_server_get_dbusname(server), menupath);
4853- g_signal_connect(G_OBJECT(priv->client), DBUSMENU_CLIENT_SIGNAL_ROOT_CHANGED, G_CALLBACK(root_changed), self);
4854-
4855- DbusmenuMenuitem * root = dbusmenu_client_get_root(priv->client);
4856- if (root != NULL) {
4857- root_changed(priv->client, root, self);
4858- }
4859-
4860- return;
4861-}
4862-
4863-static void
4864-activate_cb (AppMenuItem * self, guint timestamp, gpointer data)
4865-{
4866- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
4867-
4868- indicate_listener_display(priv->listener, priv->server, NULL, timestamp);
4869-
4870- return;
4871-}
4872-
4873-guint
4874-app_menu_item_get_count (AppMenuItem * appitem)
4875-{
4876- g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), 0);
4877- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
4878-
4879- return priv->unreadcount;
4880-}
4881-
4882-IndicateListenerServer *
4883-app_menu_item_get_server (AppMenuItem * appitem) {
4884- g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
4885- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
4886-
4887- return priv->server;
4888-}
4889-
4890-const gchar *
4891-app_menu_item_get_name (AppMenuItem * appitem)
4892-{
4893- g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
4894- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
4895-
4896- if (priv->appinfo == NULL) {
4897- return INDICATE_LISTENER_SERVER_DBUS_NAME(priv->server);
4898- } else {
4899- return g_app_info_get_name(priv->appinfo);
4900- }
4901-}
4902-
4903-const gchar *
4904-app_menu_item_get_desktop (AppMenuItem * appitem)
4905-{
4906- g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
4907- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
4908- return priv->desktop;
4909-}
4910-
4911-/* Get the dynamic items added onto the end of
4912- and app entry. */
4913-GList *
4914-app_menu_item_get_items (AppMenuItem * appitem)
4915-{
4916- g_return_val_if_fail(IS_APP_MENU_ITEM(appitem), NULL);
4917- AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(appitem);
4918- return priv->shortcuts;
4919+
4920+ priv->menu = g_menu_new ();
4921+ priv->static_shortcuts = g_simple_action_group_new ();
4922+
4923+ priv->muxer = g_action_muxer_new ();
4924+ g_action_muxer_insert (priv->muxer, NULL, G_ACTION_GROUP (priv->static_shortcuts));
4925+
4926+ priv->draws_attention = FALSE;
4927+
4928+ return;
4929+}
4930+
4931+static void
4932+app_section_get_property (GObject *object,
4933+ guint property_id,
4934+ GValue *value,
4935+ GParamSpec *pspec)
4936+{
4937+ AppSection *self = APP_SECTION (object);
4938+
4939+ switch (property_id)
4940+ {
4941+ case PROP_APPINFO:
4942+ g_value_set_object (value, app_section_get_app_info (self));
4943+ break;
4944+
4945+ case PROP_DRAWS_ATTENTION:
4946+ g_value_set_boolean (value, app_section_get_draws_attention (self));
4947+ break;
4948+
4949+ case PROP_USES_CHAT_STATUS:
4950+ g_value_set_boolean (value, app_section_get_uses_chat_status (self));
4951+ break;
4952+
4953+ case PROP_CHAT_STATUS:
4954+ g_value_set_string (value, app_section_get_status (self));
4955+ break;
4956+
4957+ default:
4958+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
4959+ }
4960+}
4961+
4962+static void
4963+app_section_set_property (GObject *object,
4964+ guint property_id,
4965+ const GValue *value,
4966+ GParamSpec *pspec)
4967+{
4968+ AppSection *self = APP_SECTION (object);
4969+
4970+ switch (property_id)
4971+ {
4972+ case PROP_APPINFO:
4973+ app_section_set_app_info (self, g_value_get_object (value));
4974+ break;
4975+
4976+ case PROP_CHAT_STATUS:
4977+ app_section_set_status (self, g_value_get_string (value));
4978+ break;
4979+
4980+ default:
4981+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
4982+ }
4983+}
4984+
4985+static void
4986+app_section_dispose (GObject *object)
4987+{
4988+ AppSection * self = APP_SECTION(object);
4989+ AppSectionPrivate * priv = self->priv;
4990+
4991+ if (priv->desktop_file_monitor) {
4992+ g_signal_handlers_disconnect_by_func (priv->desktop_file_monitor, desktop_file_changed_cb, self);
4993+ g_clear_object (&priv->desktop_file_monitor);
4994+ }
4995+
4996+ g_clear_object (&priv->menu);
4997+ g_clear_object (&priv->static_shortcuts);
4998+
4999+ if (priv->name_watch_id) {
5000+ g_bus_unwatch_name (priv->name_watch_id);
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches