wok-next annotate libunique/stuff/patches/libunique-1.1.6-upstream_fixes-1.patch @ rev 21143

Small updates.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Fri Jan 25 15:37:19 2019 +0200 (2019-01-25)
parents
children
rev   line source
al@19693 1 Submitted By: Armin K. <krejzi at email dot com>
al@19693 2 Date: 2013-03-16
al@19693 3 Initial Package Version: 1.1.6
al@19693 4 Upstream Status: In Upstream VCS
al@19693 5 Origin: Upstream VCS
al@19693 6 Description: Varius fixes from upstream including build system fixes, compilation
al@19693 7 fixes and new GDBus backend.
al@19693 8
al@19693 9 --- a/build/autotools/introspection.m4 2009-09-21 14:31:14.000000000 +0200
al@19693 10 +++ b/build/autotools/introspection.m4 2013-03-16 23:47:50.178671206 +0100
al@19693 11 @@ -59,12 +59,18 @@
al@19693 12 INTROSPECTION_GENERATE=`$PKG_CONFIG --variable=g_ir_generate gobject-introspection-1.0`
al@19693 13 INTROSPECTION_GIRDIR=`$PKG_CONFIG --variable=girdir gobject-introspection-1.0`
al@19693 14 INTROSPECTION_TYPELIBDIR="$($PKG_CONFIG --variable=typelibdir gobject-introspection-1.0)"
al@19693 15 + INTROSPECTION_CFLAGS=`$PKG_CONFIG --cflags gobject-introspection-1.0`
al@19693 16 + INTROSPECTION_LIBS=`$PKG_CONFIG --libs gobject-introspection-1.0`
al@19693 17 + INTROSPECTION_MAKEFILE=`$PKG_CONFIG --variable=datadir gobject-introspection-1.0`/gobject-introspection-1.0/Makefile.introspection
al@19693 18 fi
al@19693 19 AC_SUBST(INTROSPECTION_SCANNER)
al@19693 20 AC_SUBST(INTROSPECTION_COMPILER)
al@19693 21 AC_SUBST(INTROSPECTION_GENERATE)
al@19693 22 AC_SUBST(INTROSPECTION_GIRDIR)
al@19693 23 AC_SUBST(INTROSPECTION_TYPELIBDIR)
al@19693 24 + AC_SUBST(INTROSPECTION_CFLAGS)
al@19693 25 + AC_SUBST(INTROSPECTION_LIBS)
al@19693 26 + AC_SUBST(INTROSPECTION_MAKEFILE)
al@19693 27
al@19693 28 AM_CONDITIONAL(HAVE_INTROSPECTION, test "x$found_introspection" = "xyes")
al@19693 29 ])
al@19693 30 --- a/build/autotools/Makefile.am 2009-11-01 18:52:21.000000000 +0100
al@19693 31 +++ b/build/autotools/Makefile.am 2013-03-16 23:47:50.178671206 +0100
al@19693 32 @@ -1,7 +1,4 @@
al@19693 33 EXTRA_DIST = \
al@19693 34 - shave-libtool.in \
al@19693 35 - shave.in \
al@19693 36 - shave.m4 \
al@19693 37 as-compiler-flag.m4 \
al@19693 38 introspection.m4 \
al@19693 39 Makefile.am.enums \
al@19693 40 --- a/build/autotools/Makefile.am.silent 2009-11-01 19:00:57.000000000 +0100
al@19693 41 +++ b/build/autotools/Makefile.am.silent 2013-03-16 23:47:50.178671206 +0100
al@19693 42 @@ -1,10 +1,5 @@
al@19693 43 # custom rules for quiet builds
al@19693 44
al@19693 45 -if USE_SHAVE
al@19693 46 -QUIET_GEN = $(Q:@=@echo ' GEN '$@;)
al@19693 47 -QUIET_LN = $(Q:@=@echo ' LN '$@;)
al@19693 48 -QUIET_RM = $(Q:@=@echo ' RM '$@;)
al@19693 49 -else
al@19693 50 QUIET_GEN = $(AM_V_GEN)
al@19693 51
al@19693 52 QUIET_LN = $(QUIET_LN_$(V))
al@19693 53 @@ -14,4 +9,3 @@
al@19693 54 QUIET_RM = $(QUIET_RM_$(V))
al@19693 55 QUIET_RM_ = $(QUIET_RM_$(AM_DEFAULT_VERBOSITY))
al@19693 56 QUIET_RM_0 = @echo ' RM '$@;
al@19693 57 -endif # USE_SHAVE
al@19693 58 --- a/build/autotools/shave.in 2009-09-21 14:31:14.000000000 +0200
al@19693 59 +++ b/build/autotools/shave.in 1970-01-01 01:00:00.000000000 +0100
al@19693 60 @@ -1,79 +0,0 @@
al@19693 61 -#!/bin/sh
al@19693 62 -
al@19693 63 -# we need sed
al@19693 64 -SED=@SED@
al@19693 65 -if test -z "$SED" ; then
al@19693 66 -SED=sed
al@19693 67 -fi
al@19693 68 -
al@19693 69 -lt_unmangle ()
al@19693 70 -{
al@19693 71 - last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
al@19693 72 -}
al@19693 73 -
al@19693 74 -# the tool to wrap (cc, cxx, ar, ranlib, ..)
al@19693 75 -tool="$1"
al@19693 76 -shift
al@19693 77 -
al@19693 78 -# the reel tool (to call)
al@19693 79 -REEL_TOOL="$1"
al@19693 80 -shift
al@19693 81 -
al@19693 82 -pass_through=0
al@19693 83 -preserved_args=
al@19693 84 -while test "$#" -gt 0; do
al@19693 85 - opt="$1"
al@19693 86 - shift
al@19693 87 -
al@19693 88 - case $opt in
al@19693 89 - --shave-mode=*)
al@19693 90 - mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
al@19693 91 - ;;
al@19693 92 - -o)
al@19693 93 - lt_output="$1"
al@19693 94 - preserved_args="$preserved_args $opt"
al@19693 95 - ;;
al@19693 96 - *)
al@19693 97 - preserved_args="$preserved_args $opt"
al@19693 98 - ;;
al@19693 99 - esac
al@19693 100 -done
al@19693 101 -
al@19693 102 -# mode=link is handled in the libtool wrapper
al@19693 103 -case "$mode,$tool" in
al@19693 104 -link,*)
al@19693 105 - pass_through=1
al@19693 106 - ;;
al@19693 107 -*,cxx)
al@19693 108 - Q=" CXX "
al@19693 109 - ;;
al@19693 110 -*,cc)
al@19693 111 - Q=" CC "
al@19693 112 - ;;
al@19693 113 -*,fc)
al@19693 114 - Q=" FC "
al@19693 115 - ;;
al@19693 116 -*,f77)
al@19693 117 - Q=" F77 "
al@19693 118 - ;;
al@19693 119 -*,objc)
al@19693 120 - Q=" OBJC "
al@19693 121 - ;;
al@19693 122 -*,*)
al@19693 123 - # should not happen
al@19693 124 - Q=" CC "
al@19693 125 - ;;
al@19693 126 -esac
al@19693 127 -
al@19693 128 -lt_unmangle "$lt_output"
al@19693 129 -output=$last_result
al@19693 130 -
al@19693 131 -if test -z $V; then
al@19693 132 - if test $pass_through -eq 0; then
al@19693 133 - echo "$Q$output"
al@19693 134 - fi
al@19693 135 - $REEL_TOOL $preserved_args
al@19693 136 -else
al@19693 137 - echo $REEL_TOOL $preserved_args
al@19693 138 - $REEL_TOOL $preserved_args
al@19693 139 -fi
al@19693 140 --- a/build/autotools/shave-libtool.in 2009-09-21 14:31:14.000000000 +0200
al@19693 141 +++ b/build/autotools/shave-libtool.in 1970-01-01 01:00:00.000000000 +0100
al@19693 142 @@ -1,69 +0,0 @@
al@19693 143 -#!/bin/sh
al@19693 144 -
al@19693 145 -# we need sed
al@19693 146 -SED=@SED@
al@19693 147 -if test -z "$SED" ; then
al@19693 148 -SED=sed
al@19693 149 -fi
al@19693 150 -
al@19693 151 -lt_unmangle ()
al@19693 152 -{
al@19693 153 - last_result=`echo $1 | $SED -e 's#.libs/##' -e 's#[0-9a-zA-Z_\-\.]*_la-##'`
al@19693 154 -}
al@19693 155 -
al@19693 156 -# the real libtool to use
al@19693 157 -LIBTOOL="$1"
al@19693 158 -shift
al@19693 159 -
al@19693 160 -# if 1, don't print anything, the underlaying wrapper will do it
al@19693 161 -pass_though=0
al@19693 162 -
al@19693 163 -# scan the arguments, keep the right ones for libtool, and discover the mode
al@19693 164 -preserved_args=
al@19693 165 -while test "$#" -gt 0; do
al@19693 166 - opt="$1"
al@19693 167 - shift
al@19693 168 -
al@19693 169 - case $opt in
al@19693 170 - --mode=*)
al@19693 171 - mode=`echo $opt | $SED -e 's/[-_a-zA-Z0-9]*=//'`
al@19693 172 - preserved_args="$preserved_args $opt"
al@19693 173 - ;;
al@19693 174 - -o)
al@19693 175 - lt_output="$1"
al@19693 176 - preserved_args="$preserved_args $opt"
al@19693 177 - ;;
al@19693 178 - *)
al@19693 179 - preserved_args="$preserved_args $opt"
al@19693 180 - ;;
al@19693 181 - esac
al@19693 182 -done
al@19693 183 -
al@19693 184 -case "$mode" in
al@19693 185 -compile)
al@19693 186 - # shave will be called and print the actual CC/CXX/LINK line
al@19693 187 - preserved_args="$preserved_args --shave-mode=$mode"
al@19693 188 - pass_though=1
al@19693 189 - ;;
al@19693 190 -link)
al@19693 191 - preserved_args="$preserved_args --shave-mode=$mode"
al@19693 192 - Q=" LINK "
al@19693 193 - ;;
al@19693 194 -*)
al@19693 195 - # let's u
al@19693 196 - # echo "*** libtool: Unimplemented mode: $mode, fill a bug report"
al@19693 197 - ;;
al@19693 198 -esac
al@19693 199 -
al@19693 200 -lt_unmangle "$lt_output"
al@19693 201 -output=$last_result
al@19693 202 -
al@19693 203 -if test -z $V; then
al@19693 204 - if test $pass_though -eq 0; then
al@19693 205 - echo "$Q$output"
al@19693 206 - fi
al@19693 207 - $LIBTOOL --silent $preserved_args
al@19693 208 -else
al@19693 209 - echo $LIBTOOL $preserved_args
al@19693 210 - $LIBTOOL $preserved_args
al@19693 211 -fi
al@19693 212 --- a/build/autotools/shave.m4 2009-09-21 14:31:14.000000000 +0200
al@19693 213 +++ b/build/autotools/shave.m4 1970-01-01 01:00:00.000000000 +0100
al@19693 214 @@ -1,77 +0,0 @@
al@19693 215 -dnl Make automake/libtool output more friendly to humans
al@19693 216 -dnl Damien Lespiau <damien.lespiau@gmail.com>
al@19693 217 -dnl
al@19693 218 -dnl SHAVE_INIT([shavedir],[default_mode])
al@19693 219 -dnl
al@19693 220 -dnl shavedir: the directory where the shave scripts are, it defaults to
al@19693 221 -dnl $(top_builddir)
al@19693 222 -dnl default_mode: (enable|disable) default shave mode. This parameter
al@19693 223 -dnl controls shave's behaviour when no option has been
al@19693 224 -dnl given to configure. It defaults to disable.
al@19693 225 -dnl
al@19693 226 -dnl * SHAVE_INIT should be called late in your configure.(ac|in) file (just
al@19693 227 -dnl before AC_CONFIG_FILE/AC_OUTPUT is perfect. This macro rewrites CC and
al@19693 228 -dnl LIBTOOL, you don't want the configure tests to have these variables
al@19693 229 -dnl re-defined.
al@19693 230 -dnl * This macro requires GNU make's -s option.
al@19693 231 -
al@19693 232 -AC_DEFUN([_SHAVE_ARG_ENABLE],
al@19693 233 -[
al@19693 234 - AC_ARG_ENABLE([shave],
al@19693 235 - AS_HELP_STRING(
al@19693 236 - [--enable-shave],
al@19693 237 - [use shave to make the build pretty [[default=$1]]]),,
al@19693 238 - [enable_shave=$1]
al@19693 239 - )
al@19693 240 -])
al@19693 241 -
al@19693 242 -AC_DEFUN([SHAVE_INIT],
al@19693 243 -[
al@19693 244 - dnl you can tweak the default value of enable_shave
al@19693 245 - m4_if([$2], [enable], [_SHAVE_ARG_ENABLE(yes)], [_SHAVE_ARG_ENABLE(no)])
al@19693 246 -
al@19693 247 - if test x"$enable_shave" = xyes; then
al@19693 248 - dnl where can we find the shave scripts?
al@19693 249 - m4_if([$1],,
al@19693 250 - [shavedir="$ac_pwd"],
al@19693 251 - [shavedir="$ac_pwd/$1"])
al@19693 252 - AC_SUBST(shavedir)
al@19693 253 -
al@19693 254 - dnl make is now quiet
al@19693 255 - AC_SUBST([MAKEFLAGS], [-s])
al@19693 256 - AC_SUBST([AM_MAKEFLAGS], ['`test -z $V && echo -s`'])
al@19693 257 -
al@19693 258 - dnl we need sed
al@19693 259 - AC_CHECK_PROG(SED,sed,sed,false)
al@19693 260 -
al@19693 261 - dnl substitute libtool
al@19693 262 - SHAVE_SAVED_LIBTOOL=$LIBTOOL
al@19693 263 - LIBTOOL="${SHELL} ${shavedir}/shave-libtool '${SHAVE_SAVED_LIBTOOL}'"
al@19693 264 - AC_SUBST(LIBTOOL)
al@19693 265 -
al@19693 266 - dnl substitute cc/cxx
al@19693 267 - SHAVE_SAVED_CC=$CC
al@19693 268 - SHAVE_SAVED_CXX=$CXX
al@19693 269 - SHAVE_SAVED_FC=$FC
al@19693 270 - SHAVE_SAVED_F77=$F77
al@19693 271 - SHAVE_SAVED_OBJC=$OBJC
al@19693 272 - CC="${SHELL} ${shavedir}/shave cc ${SHAVE_SAVED_CC}"
al@19693 273 - CXX="${SHELL} ${shavedir}/shave cxx ${SHAVE_SAVED_CXX}"
al@19693 274 - FC="${SHELL} ${shavedir}/shave fc ${SHAVE_SAVED_FC}"
al@19693 275 - F77="${SHELL} ${shavedir}/shave f77 ${SHAVE_SAVED_F77}"
al@19693 276 - OBJC="${SHELL} ${shavedir}/shave objc ${SHAVE_SAVED_OBJC}"
al@19693 277 - AC_SUBST(CC)
al@19693 278 - AC_SUBST(CXX)
al@19693 279 - AC_SUBST(FC)
al@19693 280 - AC_SUBST(F77)
al@19693 281 - AC_SUBST(OBJC)
al@19693 282 -
al@19693 283 - V=@
al@19693 284 - else
al@19693 285 - V=1
al@19693 286 - fi
al@19693 287 - Q='$(V:1=)'
al@19693 288 - AC_SUBST(V)
al@19693 289 - AC_SUBST(Q)
al@19693 290 -])
al@19693 291 -
al@19693 292 --- a/configure.ac 2009-11-12 14:57:39.000000000 +0100
al@19693 293 +++ b/configure.ac 2013-03-16 23:48:53.856423651 +0100
al@19693 294 @@ -14,7 +14,7 @@
al@19693 295 # This is the X.Y used in the protocol negotiation
al@19693 296 m4_define([unique_protocol_version], [1.0])
al@19693 297
al@19693 298 -AC_PREREQ([2.59])
al@19693 299 +AC_PREREQ([2.63])
al@19693 300
al@19693 301 AC_INIT([unique], [unique_version],
al@19693 302 [http://bugzilla.gnome.org/enter_bug.cgi?product=libunique],
al@19693 303 @@ -23,8 +23,20 @@
al@19693 304 AC_CONFIG_SRCDIR([unique/unique.h])
al@19693 305 AC_CONFIG_MACRO_DIR([build/autotools])
al@19693 306
al@19693 307 -AM_INIT_AUTOMAKE([1.10])
al@19693 308 -AM_CONFIG_HEADER([config.h])
al@19693 309 +AM_INIT_AUTOMAKE([1.11 no-define -Wno-portability dist-bzip2])
al@19693 310 +AC_CONFIG_HEADERS([config.h])
al@19693 311 +
al@19693 312 +AM_SILENT_RULES([yes])
al@19693 313 +
al@19693 314 +AC_PROG_CC_C_O
al@19693 315 +
al@19693 316 +AM_PATH_GLIB_2_0
al@19693 317 +
al@19693 318 +LT_PREREQ([2.2])
al@19693 319 +LT_INIT([disable-static])
al@19693 320 +
al@19693 321 +# Honor aclocal flags
al@19693 322 +ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
al@19693 323
al@19693 324 # version symbols
al@19693 325 UNIQUE_MAJOR_VERSION=unique_major_version
al@19693 326 @@ -49,21 +61,6 @@
al@19693 327 AC_SUBST(UNIQUE_LT_VERSION_INFO)
al@19693 328 AC_SUBST(UNIQUE_LT_CURRENT_MINUS_AGE)
al@19693 329
al@19693 330 -AC_ISC_POSIX
al@19693 331 -AC_PROG_CC
al@19693 332 -AC_PROG_INSTALL
al@19693 333 -AC_PROG_MAKE_SET
al@19693 334 -AC_C_CONST
al@19693 335 -AC_PROG_LIBTOOL
al@19693 336 -AC_PATH_PROG(GLIB_MKENUMS, [glib-mkenums])
al@19693 337 -AC_PATH_PROG(GLIB_GENMARSHAL, [glib-genmarshal])
al@19693 338 -
al@19693 339 -AM_SANITY_CHECK
al@19693 340 -AM_PROG_CC_STDC
al@19693 341 -
al@19693 342 -# Honor aclocal flags
al@19693 343 -ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"
al@19693 344 -
al@19693 345 m4_define([glib_required], [2.12.0])
al@19693 346 m4_define([gtk_required], [2.11.0])
al@19693 347 m4_define([dbus_required], [0.70])
al@19693 348 @@ -119,10 +116,22 @@
al@19693 349
al@19693 350 AM_CONDITIONAL([HAVE_DBUS], [test "x$have_dbus" = "xyes"])
al@19693 351
al@19693 352 +dnl GDBus backend
al@19693 353 +dnl This is the default backend if GIO is recent enough
al@19693 354 +m4_define([gdbus_gio_required],[2.25.7])
al@19693 355 +PKG_CHECK_MODULES([GDBUS],[gio-2.0 >= gdbus_gio_required],[have_gdbus=yes],[have_gdbus=no])
al@19693 356 +
al@19693 357 +AS_IF([test "x$have_gdbus" = "xyes"],
al@19693 358 + [
al@19693 359 + AC_DEFINE([HAVE_GDBUS],[1],[Define if GDBus backend is enabled])
al@19693 360 + ]
al@19693 361 + )
al@19693 362 +
al@19693 363 +AM_CONDITIONAL([HAVE_GDBUS],[test "$have_gdbus" = "yes"])
al@19693 364 +
al@19693 365 dnl Bacon backend
al@19693 366 dnl This is the fallback backend, so we *need* these headers and functions
al@19693 367 dnl even if we end up using D-Bus
al@19693 368 -dnl D-Bus backend dependencies
al@19693 369 m4_define([have_bacon_default], [yes])
al@19693 370 AC_ARG_ENABLE([bacon],
al@19693 371 [AC_HELP_STRING([--enable-bacon=@<:@yes/no@:>@],
al@19693 372 @@ -150,7 +159,13 @@
al@19693 373
al@19693 374 dnl Choose the default backend
al@19693 375 AC_MSG_CHECKING([for default IPC mechanism])
al@19693 376 -AS_IF([test "x$have_dbus" = "xyes"],
al@19693 377 +AS_IF([test "x$have_gdbus" = "xyes"],
al@19693 378 + [
al@19693 379 + UNIQUE_DEFAULT_BACKEND=gdbus
al@19693 380 + AC_MSG_RESULT([GDBus])
al@19693 381 + ],
al@19693 382 +
al@19693 383 + [test "x$have_dbus" = "xyes"],
al@19693 384 [
al@19693 385 UNIQUE_DEFAULT_BACKEND=dbus
al@19693 386 AC_MSG_RESULT([D-Bus])
al@19693 387 @@ -178,9 +193,9 @@
al@19693 388 AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
al@19693 389 [
al@19693 390 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS],
al@19693 391 - ["-Werror -Wall -Wshadow -Wcast-align
al@19693 392 - -Wno-uninitialized -Wempty-body -Wformat-security
al@19693 393 - -Winit-self"])
al@19693 394 + ["-Wall -Wshadow -Wcast-align
al@19693 395 + -Wno-uninitialized -Wempty-body
al@19693 396 + -Wformat-security -Winit-self"])
al@19693 397 ]
al@19693 398 )
al@19693 399
al@19693 400 @@ -230,27 +245,10 @@
al@19693 401 AM_GLIB_DEFINE_LOCALEDIR(UNIQUE_LOCALEDIR)
al@19693 402
al@19693 403 # introspection
al@19693 404 -GOBJECT_INTROSPECTION_CHECK([0.6.3])
al@19693 405 +GOBJECT_INTROSPECTION_CHECK([0.6.7])
al@19693 406
al@19693 407 # gtk-doc
al@19693 408 -GTK_DOC_CHECK([1.11])
al@19693 409 -
al@19693 410 -# nice builds
al@19693 411 -m4_ifdef([AM_SILENT_RULES],
al@19693 412 - [
al@19693 413 - AM_SILENT_RULES([yes])
al@19693 414 - use_shave=no
al@19693 415 - ],
al@19693 416 - [
al@19693 417 - SHAVE_INIT([build/autotools], [enable])
al@19693 418 - AC_CONFIG_FILES([
al@19693 419 - build/autotools/shave-libtool
al@19693 420 - build/autotools/shave
al@19693 421 - ])
al@19693 422 - use_shave=yes
al@19693 423 - ])
al@19693 424 -
al@19693 425 -AM_CONDITIONAL([USE_SHAVE], [test "x$use_shave" = "xyes"])
al@19693 426 +GTK_DOC_CHECK([1.13])
al@19693 427
al@19693 428 AC_CONFIG_FILES([
al@19693 429 Makefile
al@19693 430 @@ -264,6 +262,7 @@
al@19693 431 unique/uniqueversion.h
al@19693 432 unique/bacon/Makefile
al@19693 433 unique/dbus/Makefile
al@19693 434 + unique/gdbus/Makefile
al@19693 435 tests/Makefile
al@19693 436 po/Makefile.in
al@19693 437 ])
al@19693 438 @@ -282,6 +281,7 @@
al@19693 439 Backends:
al@19693 440 Unix Domain Socket: $have_bacon
al@19693 441 D-BUS: $have_dbus
al@19693 442 + GDBus: $have_gdbus
al@19693 443
al@19693 444 Default backend: $UNIQUE_DEFAULT_BACKEND
al@19693 445 "
al@19693 446 --- a/doc/reference/Makefile.am 2009-09-21 14:31:14.000000000 +0200
al@19693 447 +++ b/doc/reference/Makefile.am 2013-03-16 23:48:20.572522852 +0100
al@19693 448 @@ -50,7 +50,8 @@
al@19693 449 uniquemarshal.h \
al@19693 450 stamp-uniquemarshal.h \
al@19693 451 bacon \
al@19693 452 - dbus
al@19693 453 + dbus \
al@19693 454 + gdbus
al@19693 455
al@19693 456 EXTRA_HFILES =
al@19693 457
al@19693 458 --- a/unique/dbus/uniquebackend-dbus.c 2009-11-01 20:15:26.000000000 +0100
al@19693 459 +++ b/unique/dbus/uniquebackend-dbus.c 2013-03-16 23:48:03.088891381 +0100
al@19693 460 @@ -84,7 +84,6 @@
al@19693 461 static gboolean
al@19693 462 unique_backend_dbus_request_name (UniqueBackend *backend)
al@19693 463 {
al@19693 464 - UniqueBackendDBus *backend_dbus;
al@19693 465 const gchar *name;
al@19693 466 DBusGConnection *connection;
al@19693 467 DBusGProxy *proxy;
al@19693 468 @@ -97,8 +96,6 @@
al@19693 469 if (!connection)
al@19693 470 return FALSE;
al@19693 471
al@19693 472 - backend_dbus = UNIQUE_BACKEND_DBUS (backend);
al@19693 473 -
al@19693 474 retval = TRUE;
al@19693 475 name = unique_backend_get_name (backend);
al@19693 476 g_assert (name != NULL);
al@19693 477 @@ -207,10 +204,14 @@
al@19693 478 cmd, data, time_,
al@19693 479 &resp,
al@19693 480 &error);
al@19693 481 - if (error)
al@19693 482 + if (!res)
al@19693 483 {
al@19693 484 - g_warning ("Error while sending message: %s", error->message);
al@19693 485 - g_error_free (error);
al@19693 486 + if (error)
al@19693 487 + {
al@19693 488 + g_warning ("Error while sending message: %s", error->message);
al@19693 489 + g_error_free (error);
al@19693 490 + }
al@19693 491 +
al@19693 492 g_free (cmd);
al@19693 493
al@19693 494 return UNIQUE_RESPONSE_INVALID;
al@19693 495 --- a/unique/gdbus/.gitignore 1970-01-01 01:00:00.000000000 +0100
al@19693 496 +++ b/unique/gdbus/.gitignore 2013-03-16 23:48:20.572522852 +0100
al@19693 497 @@ -0,0 +1,2 @@
al@19693 498 +libunique_gdbus_la-uniquebackend-gdbus.lo
al@19693 499 +libunique-gdbus.la
al@19693 500 --- a/unique/gdbus/Makefile.am 1970-01-01 01:00:00.000000000 +0100
al@19693 501 +++ b/unique/gdbus/Makefile.am 2013-03-16 23:48:20.572522852 +0100
al@19693 502 @@ -0,0 +1,24 @@
al@19693 503 +include $(top_srcdir)/build/autotools/Makefile.am.silent
al@19693 504 +
al@19693 505 +noinst_LTLIBRARIES = libunique-gdbus.la
al@19693 506 +
al@19693 507 +libunique_gdbus_la_SOURCES = \
al@19693 508 + uniquebackend-gdbus.h \
al@19693 509 + uniquebackend-gdbus.c
al@19693 510 +
al@19693 511 +libunique_gdbus_la_PPCFLAGS = \
al@19693 512 + -DG_LOG_DOMAIN=\"Unique-GDBus\" \
al@19693 513 + -DG_DISABLE_SINGLE_INCLUDES \
al@19693 514 + -I$(top_srcdir) \
al@19693 515 + $(AM_CPPFLAGS)
al@19693 516 +
al@19693 517 +libunique_gdbus_la_CFLAGS = \
al@19693 518 + $(UNIQUE_CFLAGS) \
al@19693 519 + $(UNIQUE_DEBUG_CFLAGS) \
al@19693 520 + $(MAINTAINER_CFLAGS) \
al@19693 521 + $(GDBUS_CFLAGS) \
al@19693 522 + $(AM_CFLAGS)
al@19693 523 +
al@19693 524 +libunique_gdbus_la_LIBADD = \
al@19693 525 + $(UNIQUE_LIBS) \
al@19693 526 + $(GDBUS_LIBS)
al@19693 527 --- a/unique/gdbus/uniquebackend-gdbus.c 1970-01-01 01:00:00.000000000 +0100
al@19693 528 +++ b/unique/gdbus/uniquebackend-gdbus.c 2013-03-16 23:48:20.575856242 +0100
al@19693 529 @@ -0,0 +1,303 @@
al@19693 530 +/* Unique - Single Instance application library
al@19693 531 + * uniquebackend-gdbus.c: GDBus implementation of UniqueBackend
al@19693 532 + *
al@19693 533 + * Copyright (C) 2007 Emmanuele Bassi <ebassi@o-hand.com>
al@19693 534 + * Copyright © 2010 Christian Persch
al@19693 535 + *
al@19693 536 + * This library is free software; you can redistribute it and/or
al@19693 537 + * modify it under the terms of the GNU Lesser General Public
al@19693 538 + * License as published by the Free Software Foundation; either
al@19693 539 + * version 2.1 of the License, or (at your option) any later version.
al@19693 540 + *
al@19693 541 + * This library is distributed in the hope that it will be useful,
al@19693 542 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
al@19693 543 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
al@19693 544 + * Lesser General Public License for more details.
al@19693 545 + *
al@19693 546 + * You should have received a copy of the GNU Lesser General Public
al@19693 547 + * License along with this library; if not, write to the Free Software
al@19693 548 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
al@19693 549 + * 02110-1301 USA
al@19693 550 + */
al@19693 551 +
al@19693 552 +#ifdef HAVE_CONFIG_H
al@19693 553 +#include "config.h"
al@19693 554 +#endif
al@19693 555 +
al@19693 556 +#include <gio/gio.h>
al@19693 557 +#include <gdk/gdk.h>
al@19693 558 +
al@19693 559 +#include "../uniqueinternals.h"
al@19693 560 +#include "uniquebackend-gdbus.h"
al@19693 561 +
al@19693 562 +struct _UniqueBackendGDBus
al@19693 563 +{
al@19693 564 + UniqueBackend parent_instance;
al@19693 565 +
al@19693 566 + GDBusConnection *connection;
al@19693 567 + guint registration_id;
al@19693 568 + guint owner_id;
al@19693 569 + gboolean owns_name;
al@19693 570 + GMainLoop *loop;
al@19693 571 +};
al@19693 572 +
al@19693 573 +struct _UniqueBackendGDBusClass
al@19693 574 +{
al@19693 575 + UniqueBackendClass parent_class;
al@19693 576 + GDBusNodeInfo *introspection_data;
al@19693 577 +};
al@19693 578 +
al@19693 579 +G_DEFINE_TYPE (UniqueBackendGDBus, unique_backend_gdbus, UNIQUE_TYPE_BACKEND);
al@19693 580 +
al@19693 581 +static const char introspection_xml[] =
al@19693 582 + "<node name='/'>"
al@19693 583 + "<interface name='org.gtk.UniqueApp'>"
al@19693 584 + "<method name='SendMessage'>"
al@19693 585 + "<arg name='command' type='s' direction='in'/>"
al@19693 586 + "<arg name='message' type='(suuus)' direction='in'/>"
al@19693 587 + "<arg name='time' type='u' direction='in'/>"
al@19693 588 + "<arg name='response' type='s' direction='out'/>"
al@19693 589 + "</method>"
al@19693 590 + "</interface>"
al@19693 591 + "</node>";
al@19693 592 +
al@19693 593 +static void
al@19693 594 +method_call_cb (GDBusConnection *connection,
al@19693 595 + const gchar *sender,
al@19693 596 + const gchar *object_path,
al@19693 597 + const gchar *interface_name,
al@19693 598 + const gchar *method_name,
al@19693 599 + GVariant *parameters,
al@19693 600 + GDBusMethodInvocation *invocation,
al@19693 601 + gpointer user_data)
al@19693 602 +{
al@19693 603 + if (g_strcmp0 (interface_name, "org.gtk.UniqueApp") != 0 ||
al@19693 604 + g_strcmp0 (object_path, "/Factory") != 0)
al@19693 605 + return;
al@19693 606 +
al@19693 607 + if (g_strcmp0 (method_name, "SendMessage") == 0)
al@19693 608 + {
al@19693 609 + UniqueBackend *backend = UNIQUE_BACKEND (user_data);
al@19693 610 + const gchar *command_str, *data, *startup_id;
al@19693 611 + guint len, screen_num, workspace, time_;
al@19693 612 + UniqueMessageData message_data;
al@19693 613 + gint command;
al@19693 614 + UniqueResponse response;
al@19693 615 + GdkDisplay *display;
al@19693 616 +
al@19693 617 + g_variant_get (parameters,
al@19693 618 + "(&s(&suuu&s)u)",
al@19693 619 + &command_str,
al@19693 620 + &data, &len, &screen_num, &workspace, &startup_id,
al@19693 621 + &time_);
al@19693 622 +
al@19693 623 + command = unique_command_from_string (backend->parent, command_str);
al@19693 624 + if (command == 0)
al@19693 625 + {
al@19693 626 + g_dbus_method_invocation_return_error (invocation,
al@19693 627 + G_DBUS_ERROR,
al@19693 628 + G_DBUS_ERROR_INVALID_ARGS,
al@19693 629 + "Invalid command `%s' received",
al@19693 630 + command_str);
al@19693 631 + return;
al@19693 632 + }
al@19693 633 +
al@19693 634 + display = gdk_display_get_default ();
al@19693 635 +
al@19693 636 + message_data.data = len > 0 ? (guchar *) data : NULL;
al@19693 637 + message_data.length = (gint) len;
al@19693 638 + message_data.workspace = workspace;
al@19693 639 + message_data.startup_id = (char *) startup_id;
al@19693 640 + if (screen_num >= 0 && screen_num < gdk_display_get_n_screens (display))
al@19693 641 + message_data.screen = gdk_display_get_screen (display, screen_num);
al@19693 642 + else
al@19693 643 + message_data.screen = gdk_screen_get_default ();
al@19693 644 +
al@19693 645 + response = unique_app_emit_message_received (backend->parent, command, &message_data, time_);
al@19693 646 +
al@19693 647 + g_dbus_method_invocation_return_value (invocation,
al@19693 648 + g_variant_new ("(s)", unique_response_to_string (response)));
al@19693 649 + return;
al@19693 650 + }
al@19693 651 +}
al@19693 652 +
al@19693 653 +static void
al@19693 654 +name_acquired_cb (GDBusConnection *connection,
al@19693 655 + const gchar *name,
al@19693 656 + gpointer user_data)
al@19693 657 +{
al@19693 658 + UniqueBackendGDBus *backend_gdbus = UNIQUE_BACKEND_GDBUS (user_data);
al@19693 659 +
al@19693 660 + backend_gdbus->owns_name = TRUE;
al@19693 661 + if (backend_gdbus->loop && g_main_loop_is_running (backend_gdbus->loop))
al@19693 662 + g_main_loop_quit (backend_gdbus->loop);
al@19693 663 +}
al@19693 664 +
al@19693 665 +static void
al@19693 666 +name_lost_cb (GDBusConnection *connection,
al@19693 667 + const gchar *name,
al@19693 668 + gpointer user_data)
al@19693 669 +{
al@19693 670 + UniqueBackendGDBus *backend_gdbus = UNIQUE_BACKEND_GDBUS (user_data);
al@19693 671 +
al@19693 672 + backend_gdbus->owns_name = FALSE;
al@19693 673 + if (backend_gdbus->loop && g_main_loop_is_running (backend_gdbus->loop))
al@19693 674 + g_main_loop_quit (backend_gdbus->loop);
al@19693 675 +}
al@19693 676 +
al@19693 677 +static const GDBusInterfaceVTable interface_vtable = {
al@19693 678 + method_call_cb,
al@19693 679 + NULL,
al@19693 680 + NULL
al@19693 681 +};
al@19693 682 +
al@19693 683 +static gboolean
al@19693 684 +unique_backend_gdbus_request_name (UniqueBackend *backend)
al@19693 685 +{
al@19693 686 + UniqueBackendGDBus *backend_gdbus = UNIQUE_BACKEND_GDBUS (backend);
al@19693 687 + UniqueBackendGDBusClass *klass = UNIQUE_BACKEND_GDBUS_GET_CLASS (backend);
al@19693 688 + GError *error;
al@19693 689 +
al@19693 690 + error = NULL;
al@19693 691 + backend_gdbus->connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, &error);
al@19693 692 + if (!backend_gdbus->connection)
al@19693 693 + {
al@19693 694 + g_warning ("Unable to open a connection to the session bus: %s",
al@19693 695 + error->message);
al@19693 696 + g_error_free (error);
al@19693 697 +
al@19693 698 + return FALSE;
al@19693 699 + }
al@19693 700 +
al@19693 701 + backend_gdbus->registration_id =
al@19693 702 + g_dbus_connection_register_object (backend_gdbus->connection,
al@19693 703 + "/Factory",
al@19693 704 + klass->introspection_data->interfaces[0],
al@19693 705 + &interface_vtable,
al@19693 706 + backend, NULL,
al@19693 707 + &error);
al@19693 708 + if (backend_gdbus->registration_id == 0)
al@19693 709 + {
al@19693 710 + g_warning ("Unable to register object with the session bus: %s",
al@19693 711 + error->message);
al@19693 712 + g_error_free (error);
al@19693 713 +
al@19693 714 + return FALSE;
al@19693 715 + }
al@19693 716 +
al@19693 717 + backend_gdbus->owns_name = FALSE;
al@19693 718 +
al@19693 719 + backend_gdbus->owner_id =
al@19693 720 + g_bus_own_name_on_connection (backend_gdbus->connection,
al@19693 721 + unique_backend_get_name (backend),
al@19693 722 + G_BUS_NAME_OWNER_FLAGS_NONE,
al@19693 723 + name_acquired_cb,
al@19693 724 + name_lost_cb,
al@19693 725 + backend, NULL);
al@19693 726 +
al@19693 727 + backend_gdbus->loop = g_main_loop_new (NULL, FALSE);
al@19693 728 + g_main_loop_run (backend_gdbus->loop);
al@19693 729 + g_main_loop_unref (backend_gdbus->loop);
al@19693 730 + backend_gdbus->loop = NULL;
al@19693 731 +
al@19693 732 + return backend_gdbus->owns_name;
al@19693 733 +}
al@19693 734 +
al@19693 735 +static UniqueResponse
al@19693 736 +unique_backend_gdbus_send_message (UniqueBackend *backend,
al@19693 737 + gint command,
al@19693 738 + UniqueMessageData *message_data,
al@19693 739 + guint time_)
al@19693 740 +{
al@19693 741 + UniqueBackendGDBus *backend_gdbus = UNIQUE_BACKEND_GDBUS (backend);
al@19693 742 + GVariantBuilder builder;
al@19693 743 + GVariant *result;
al@19693 744 + const gchar *command_str, *resp;
al@19693 745 + UniqueResponse response;
al@19693 746 + GError *error;
al@19693 747 +
al@19693 748 + command_str = unique_command_to_string (backend->parent, command);
al@19693 749 +
al@19693 750 + g_variant_builder_init (&builder, G_VARIANT_TYPE ("(s(suuus)u)"));
al@19693 751 + g_variant_builder_add (&builder, "s", command_str ? command_str : "");
al@19693 752 + g_variant_builder_open (&builder, G_VARIANT_TYPE ("(suuus)"));
al@19693 753 + g_variant_builder_add (&builder, "s", message_data->data ? (char *) message_data->data : "");
al@19693 754 + g_variant_builder_add (&builder, "u", (guint) message_data->length);
al@19693 755 + g_variant_builder_add (&builder, "u", (guint) gdk_screen_get_number (message_data->screen));
al@19693 756 + g_variant_builder_add (&builder, "u", (guint) message_data->workspace);
al@19693 757 + g_variant_builder_add (&builder, "s", message_data->startup_id ? message_data->startup_id : "");
al@19693 758 + g_variant_builder_close (&builder);
al@19693 759 + g_variant_builder_add (&builder, "u", time_);
al@19693 760 +
al@19693 761 + error = NULL;
al@19693 762 + result = g_dbus_connection_call_sync (backend_gdbus->connection,
al@19693 763 + unique_backend_get_name (backend),
al@19693 764 + "/Factory",
al@19693 765 + "org.gtk.UniqueApp",
al@19693 766 + "SendMessage",
al@19693 767 + g_variant_builder_end (&builder),
al@19693 768 + G_VARIANT_TYPE ("(s)"),
al@19693 769 + G_DBUS_CALL_FLAGS_NO_AUTO_START,
al@19693 770 + -1,
al@19693 771 + NULL,
al@19693 772 + &error);
al@19693 773 + if (error)
al@19693 774 + {
al@19693 775 + g_warning ("Error while sending message: %s", error->message);
al@19693 776 + g_error_free (error);
al@19693 777 +
al@19693 778 + return UNIQUE_RESPONSE_INVALID;
al@19693 779 + }
al@19693 780 +
al@19693 781 + g_variant_get (result, "(&s)", &resp);
al@19693 782 + response = unique_response_from_string (resp);
al@19693 783 + g_variant_unref (result);
al@19693 784 +
al@19693 785 + return response;
al@19693 786 +}
al@19693 787 +
al@19693 788 +static void
al@19693 789 +unique_backend_gdbus_dispose (GObject *gobject)
al@19693 790 +{
al@19693 791 + UniqueBackendGDBus *backend_gdbus = UNIQUE_BACKEND_GDBUS (gobject);
al@19693 792 +
al@19693 793 + if (backend_gdbus->owner_id != 0)
al@19693 794 + {
al@19693 795 + g_bus_unown_name (backend_gdbus->owner_id);
al@19693 796 + backend_gdbus->owner_id = 0;
al@19693 797 + }
al@19693 798 + if (backend_gdbus->registration_id != 0)
al@19693 799 + {
al@19693 800 + g_assert (backend_gdbus->connection != NULL);
al@19693 801 + g_dbus_connection_unregister_object (backend_gdbus->connection,
al@19693 802 + backend_gdbus->registration_id);
al@19693 803 + backend_gdbus->registration_id = 0;
al@19693 804 + }
al@19693 805 + if (backend_gdbus->connection)
al@19693 806 + {
al@19693 807 + g_object_unref (backend_gdbus->connection);
al@19693 808 + backend_gdbus->connection = NULL;
al@19693 809 + }
al@19693 810 +
al@19693 811 + G_OBJECT_CLASS (unique_backend_gdbus_parent_class)->dispose (gobject);
al@19693 812 +}
al@19693 813 +
al@19693 814 +static void
al@19693 815 +unique_backend_gdbus_class_init (UniqueBackendGDBusClass *klass)
al@19693 816 +{
al@19693 817 + GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
al@19693 818 + UniqueBackendClass *backend_class = UNIQUE_BACKEND_CLASS (klass);
al@19693 819 +
al@19693 820 + gobject_class->dispose = unique_backend_gdbus_dispose;
al@19693 821 +
al@19693 822 + backend_class->request_name = unique_backend_gdbus_request_name;
al@19693 823 + backend_class->send_message = unique_backend_gdbus_send_message;
al@19693 824 +
al@19693 825 + klass->introspection_data = g_dbus_node_info_new_for_xml (introspection_xml, NULL);
al@19693 826 + g_assert (klass->introspection_data != NULL);
al@19693 827 +}
al@19693 828 +
al@19693 829 +static void
al@19693 830 +unique_backend_gdbus_init (UniqueBackendGDBus *backend)
al@19693 831 +{
al@19693 832 +}
al@19693 833 --- a/unique/gdbus/uniquebackend-gdbus.h 1970-01-01 01:00:00.000000000 +0100
al@19693 834 +++ b/unique/gdbus/uniquebackend-gdbus.h 2013-03-16 23:48:20.575856242 +0100
al@19693 835 @@ -0,0 +1,43 @@
al@19693 836 +/* Unique - Single Instance application library
al@19693 837 + * uniquebackend-gdbus.c: GDBus implementation of UniqueBackend
al@19693 838 + *
al@19693 839 + * Copyright (C) 2007 Emmanuele Bassi <ebassi@o-hand.com>
al@19693 840 + *
al@19693 841 + * This library is free software; you can redistribute it and/or
al@19693 842 + * modify it under the terms of the GNU Lesser General Public
al@19693 843 + * License as published by the Free Software Foundation; either
al@19693 844 + * version 2.1 of the License, or (at your option) any later version.
al@19693 845 + *
al@19693 846 + * This library is distributed in the hope that it will be useful,
al@19693 847 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
al@19693 848 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
al@19693 849 + * Lesser General Public License for more details.
al@19693 850 + *
al@19693 851 + * You should have received a copy of the GNU Lesser General Public
al@19693 852 + * License along with this library; if not, write to the Free Software
al@19693 853 + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
al@19693 854 + * 02110-1301 USA
al@19693 855 + */
al@19693 856 +
al@19693 857 +#ifndef __UNIQUE_BACKEND_GDBUS_H__
al@19693 858 +#define __UNIQUE_BACKEND_GDBUS_H__
al@19693 859 +
al@19693 860 +#include <unique/uniquebackend.h>
al@19693 861 +
al@19693 862 +G_BEGIN_DECLS
al@19693 863 +
al@19693 864 +#define UNIQUE_TYPE_BACKEND_GDBUS (unique_backend_gdbus_get_type ())
al@19693 865 +#define UNIQUE_BACKEND_GDBUS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), UNIQUE_TYPE_BACKEND_GDBUS, UniqueBackendGDBus))
al@19693 866 +#define UNIQUE_IS_BACKEND_GDBUS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), UNIQUE_TYPE_BACKEND_GDBUS))
al@19693 867 +#define UNIQUE_BACKEND_GDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), UNIQUE_TYPE_BACKEND_GDBUS, UniqueBackendGDBusClass))
al@19693 868 +#define UNIQUE_IS_BACKEND_GDBUS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), UNIQUE_TYPE_BACKEND_GDBUS))
al@19693 869 +#define UNIQUE_BACKEND_GDBUS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), UNIQUE_TYPE_BACKEND_GDBUS, UniqueBackendGDBusClass))
al@19693 870 +
al@19693 871 +typedef struct _UniqueBackendGDBus UniqueBackendGDBus;
al@19693 872 +typedef struct _UniqueBackendGDBusClass UniqueBackendGDBusClass;
al@19693 873 +
al@19693 874 +GType unique_backend_gdbus_get_type (void) G_GNUC_CONST;
al@19693 875 +
al@19693 876 +G_END_DECLS
al@19693 877 +
al@19693 878 +#endif /* __UNIQUE_BACKEND_GDBUS_H__ */
al@19693 879 --- a/unique/Makefile.am 2009-11-12 14:53:10.000000000 +0100
al@19693 880 +++ b/unique/Makefile.am 2013-03-16 23:48:20.572522852 +0100
al@19693 881 @@ -12,7 +12,11 @@
al@19693 882 SUBDIRS += dbus
al@19693 883 endif
al@19693 884
al@19693 885 -DIST_SUBDIRS = bacon dbus
al@19693 886 +if HAVE_GDBUS
al@19693 887 +SUBDIRS += gdbus
al@19693 888 +endif
al@19693 889 +
al@19693 890 +DIST_SUBDIRS = bacon dbus gdbus
al@19693 891
al@19693 892 INCLUDES = -I$(top_srcdir)
al@19693 893
al@19693 894 @@ -72,6 +76,10 @@
al@19693 895 unique_backend_libs += $(top_builddir)/unique/dbus/libunique-dbus.la
al@19693 896 endif
al@19693 897
al@19693 898 +if HAVE_GDBUS
al@19693 899 +unique_backend_libs += $(top_builddir)/unique/gdbus/libunique-gdbus.la
al@19693 900 +endif
al@19693 901 +
al@19693 902 uniquedir = $(includedir)/unique-1.0/unique
al@19693 903 unique_HEADERS = \
al@19693 904 $(unique_sources_h) \
al@19693 905 --- a/unique/uniqueapp.c 2009-11-01 19:33:13.000000000 +0100
al@19693 906 +++ b/unique/uniqueapp.c 2013-03-16 23:49:05.236617643 +0100
al@19693 907 @@ -781,7 +781,7 @@
al@19693 908 }
al@19693 909
al@19693 910
al@19693 911 -G_CONST_RETURN gchar *
al@19693 912 +const gchar *
al@19693 913 unique_command_to_string (UniqueApp *app,
al@19693 914 gint command)
al@19693 915 {
al@19693 916 @@ -863,7 +863,7 @@
al@19693 917 return retval;
al@19693 918 }
al@19693 919
al@19693 920 -G_CONST_RETURN gchar *
al@19693 921 +const gchar *
al@19693 922 unique_response_to_string (UniqueResponse response)
al@19693 923 {
al@19693 924 GEnumClass *enum_class;
al@19693 925 --- a/unique/uniquebackend.c 2009-11-09 12:02:06.000000000 +0100
al@19693 926 +++ b/unique/uniquebackend.c 2013-03-16 23:49:05.236617643 +0100
al@19693 927 @@ -111,7 +111,7 @@
al@19693 928 *
al@19693 929 * Return value: FIXME
al@19693 930 */
al@19693 931 -G_CONST_RETURN gchar *
al@19693 932 +const gchar *
al@19693 933 unique_backend_get_name (UniqueBackend *backend)
al@19693 934 {
al@19693 935 g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL);
al@19693 936 @@ -154,7 +154,7 @@
al@19693 937 *
al@19693 938 * Return value: FIXME
al@19693 939 */
al@19693 940 -G_CONST_RETURN gchar *
al@19693 941 +const gchar *
al@19693 942 unique_backend_get_startup_id (UniqueBackend *backend)
al@19693 943 {
al@19693 944 g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL);
al@19693 945 @@ -298,6 +298,9 @@
al@19693 946 #ifdef HAVE_DBUS
al@19693 947 #include "dbus/uniquebackend-dbus.h"
al@19693 948 #endif
al@19693 949 +#ifdef HAVE_GDBUS
al@19693 950 +#include "gdbus/uniquebackend-gdbus.h"
al@19693 951 +#endif
al@19693 952
al@19693 953 /**
al@19693 954 * unique_backend_create:
al@19693 955 @@ -329,6 +332,10 @@
al@19693 956 if (strcmp (backend_name, "dbus") == 0)
al@19693 957 backend_gtype = unique_backend_dbus_get_type ();
al@19693 958 #endif /* HAVE_DBUS */
al@19693 959 +#ifdef HAVE_GDBUS
al@19693 960 + if (strcmp (backend_name, "gdbus") == 0)
al@19693 961 + backend_gtype = unique_backend_gdbus_get_type ();
al@19693 962 +#endif /* HAVE_GDBUS */
al@19693 963 #if !defined(HAVE_BACON) && !defined(HAVE_DBUS)
al@19693 964 #error Need either bacon or dbus
al@19693 965 #endif
al@19693 966 --- a/unique/uniquebackend.h 2009-09-21 14:31:14.000000000 +0200
al@19693 967 +++ b/unique/uniquebackend.h 2013-03-16 23:49:05.236617643 +0100
al@19693 968 @@ -94,10 +94,10 @@
al@19693 969
al@19693 970 UniqueBackend * unique_backend_create (void);
al@19693 971
al@19693 972 -G_CONST_RETURN gchar *unique_backend_get_name (UniqueBackend *backend);
al@19693 973 +const gchar *unique_backend_get_name (UniqueBackend *backend);
al@19693 974 void unique_backend_set_name (UniqueBackend *backend,
al@19693 975 const gchar *name);
al@19693 976 -G_CONST_RETURN gchar *unique_backend_get_startup_id (UniqueBackend *backend);
al@19693 977 +const gchar *unique_backend_get_startup_id (UniqueBackend *backend);
al@19693 978 void unique_backend_set_startup_id (UniqueBackend *backend,
al@19693 979 const gchar *startup_id);
al@19693 980 GdkScreen * unique_backend_get_screen (UniqueBackend *backend);
al@19693 981 --- a/unique/uniqueinternals.h 2009-09-21 14:31:14.000000000 +0200
al@19693 982 +++ b/unique/uniqueinternals.h 2013-03-16 23:49:05.236617643 +0100
al@19693 983 @@ -44,11 +44,11 @@
al@19693 984 * and then back into an id
al@19693 985 */
al@19693 986 UniqueResponse unique_response_from_string (const gchar *response);
al@19693 987 -G_CONST_RETURN gchar *unique_response_to_string (UniqueResponse response);
al@19693 988 +const gchar *unique_response_to_string (UniqueResponse response);
al@19693 989
al@19693 990 gint unique_command_from_string (UniqueApp *app,
al@19693 991 const gchar *command);
al@19693 992 -G_CONST_RETURN gchar *unique_command_to_string (UniqueApp *app,
al@19693 993 +const gchar *unique_command_to_string (UniqueApp *app,
al@19693 994 gint command);
al@19693 995
al@19693 996 G_END_DECLS
al@19693 997 --- a/unique/uniquemessage.c 2009-11-09 12:02:06.000000000 +0100
al@19693 998 +++ b/unique/uniquemessage.c 2013-03-16 23:49:05.236617643 +0100
al@19693 999 @@ -185,7 +185,7 @@
al@19693 1000 *
al@19693 1001 * Since: 1.0.2
al@19693 1002 */
al@19693 1003 -G_CONST_RETURN guchar *
al@19693 1004 +const guchar *
al@19693 1005 unique_message_data_get (UniqueMessageData *message_data,
al@19693 1006 gsize *length)
al@19693 1007 {
al@19693 1008 @@ -525,7 +525,7 @@
al@19693 1009 * owned by the #UniqueMessageData structure and should not be
al@19693 1010 * modified or freed
al@19693 1011 */
al@19693 1012 -G_CONST_RETURN gchar *
al@19693 1013 +const gchar *
al@19693 1014 unique_message_data_get_startup_id (UniqueMessageData *message_data)
al@19693 1015 {
al@19693 1016 g_return_val_if_fail (message_data != NULL, NULL);
al@19693 1017 --- a/unique/uniquemessage.h 2009-09-21 14:31:14.000000000 +0200
al@19693 1018 +++ b/unique/uniquemessage.h 2013-03-16 23:49:05.236617643 +0100
al@19693 1019 @@ -48,7 +48,7 @@
al@19693 1020 void unique_message_data_set (UniqueMessageData *message_data,
al@19693 1021 const guchar *data,
al@19693 1022 gsize length);
al@19693 1023 -G_CONST_RETURN guchar *unique_message_data_get (UniqueMessageData *message_data,
al@19693 1024 +const guchar *unique_message_data_get (UniqueMessageData *message_data,
al@19693 1025 gsize *length);
al@19693 1026
al@19693 1027 gboolean unique_message_data_set_text (UniqueMessageData *message_data,
al@19693 1028 @@ -63,7 +63,7 @@
al@19693 1029 gchar * unique_message_data_get_filename (UniqueMessageData *message_data);
al@19693 1030
al@19693 1031 GdkScreen * unique_message_data_get_screen (UniqueMessageData *message_data);
al@19693 1032 -G_CONST_RETURN gchar * unique_message_data_get_startup_id (UniqueMessageData *message_data);
al@19693 1033 +const gchar * unique_message_data_get_startup_id (UniqueMessageData *message_data);
al@19693 1034 guint unique_message_data_get_workspace (UniqueMessageData *message_data);
al@19693 1035
al@19693 1036 G_END_DECLS